eXo Platform 3.5

## Chapter 45. Link Producer Service

Link Producer Service - a simple service, which generates an .lnk file, that is compatible with the Microsoft link file format. It is an extension of the REST Framework library and is included into the WebDav service. On dispatching a GET request the service generates the content of an .lnk file, which points to a JCR resource via WebDav.

Link Producer has a simple configuration like described below:

    <component>

      <key>org.exoplatform.services.webdav.lnkproducer.LnkProducer</key>

      <type>org.exoplatform.services.webdav.lnkproducer.LnkProducer</type>

    </component>

When using JCR the resource can be addressed by WebDav reference (href) like `http://host:port/rest/jcr/repository/workspace/somenode/somefile.extention` , the link servlet must be called for this resource by several hrefs, like `http://localhost:8080/rest/lnkproducer/openit.lnk?path=/repository/workspace/somenode/somefile.extention`

Please note, that when using the portal mode the REST servlet is available using a reference (href) like `http://localhost:8080/portal/rest/...`

The name of the .lnk file can be any. But for the best compatibility it must be the same as the name of the JCR resource.

Here is a step by step sample of a use case of the link producer... At first, type valid reference to the resource, using the link producer in your browser's adress field:

Internet Explorer will give a dialog window requesting to Open a file or to Save it. Click on the Open button

In Windows system an .lnk file will be downloaded and opened with the application which is registered to open the files, which are pointed to by the .lnk file. In case of a .doc file, Windows opens Microsoft Office Word which will try to open a remote file (test0000.doc). Maybe it will be necessary to enter USERNAME and PASSWORD.

Next, you will be able to edit the file in Microsoft Word.

The Link Producer is necessary for opening/editing and then saving the remote files in Microsoft Office Word, without any further updates.

Also the Link Producer can be referenced to from an HTML page. If page contains code like

    <a href="http://localhost:8080/rest/lnkproducer/openit.lnk?path=/repository/workspace/somenode/somefile.extention">somefile.extention</a>

the file "somefile.extention" will open directly.

Copyright © 2009-2012. All rights reserved. eXo Platform SAS