Dec 13, 2007

Alfresco : ViewOne Pro Integration

  1. Download the V1Pro.zip from www.daeja.com. Give a legitimate email address as the trial license key will be mailed to this address and there's no way to install without this key.
  2. Extract the zip file, this will yield a directory structure, out of which v1files is the folder that has all the necessary files for configuring ViewOne.
  3. Double Click on the index.htm file in the parent directory, click on the 'Click here to see demonstration' link.
  4. Click the first/second or third demo (doesn't matter to activate the product).
  5. Click yes to trust the applet (no IE browsers) and Yes for installing ActiveX control (IE browser).
  6. Enter the License Key and notice ViewOne Pro installed. I am not sure what settings does the application does next, but it does appear to now start recognizing the lic.v1 file as a valid 14 day license.
  7. Copy the v1files directory to tomcat/webapps/alfresco
  8. Custom View under Details View
    1. In Alfresco upload a Presentation Template, that holds the code to display documents via the ViewOne Pro Applet. This template needs to be uploaded in the Data Dictionary/Presentation Templates folder. Our file is docPreview.ftl
    2. For any Custom View configuration of elements (documents or spaces), go to the 'Details View' of that element, click on the custom view and select apply template. In the drop down for templates, select the docPreview.ftl template added above. Notice ViewOne Pro displaying the images/pdfs.
  9. Open the document in a new tab/window
    1. This functionality is possible by modifying the tomcat\webapps\alfresco\jsp\browse\browse.jsp file. In this file, we will find the line %-- Primary column for icons view mode --%. Under this section, replace this a:actionLink id="col11-act2" value="#{r.name}" href="#{r.url}" target="new" styleClass="header" (which is the second link, the first being the icon of the document) with...
      a:actionLink id="col11-act2" value="#{r.name}" href="http://localhost:8080/alfresco/jsp/extension/dashboards/view1pro.jsp?name=#{r.url}" target="new" styleClass="header"
    2. Notice that for the above to work, we will have to add a file view1pro.jsp containing the Applet code to the Alfresco directory. Also notice that the extension directory is not present by default, its what we created.
    3. [TODO] The URL should be taking a relative path rather than a hard reference to localhost:8080.
  10. Finally Viewone in the MySpaces WebScript.
    1. Please refer to the avspaces blog for configuration on your own MySpaces window.
    2. Copy the myspaces_preview_panel.ftl (This is the one that renders the preview window) in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\client to avspaces_preview_panel.ftl. I am not sure why this is kept here, will find it someday [TODO].
    3. A few modifications (which results in avspaces_preview_panel.ftl)
      • include tiff as a mimetype in the isImage variable.
      • include pdf as a mimetype and introduce it via isPdf variable.
      • modify the isImage condition to include isPdf and render both via ViewOne.
      • to render delete the current tag under the center tag and introduce the applet tag.
    4. In the avspaces.js, find the line ~309 "noderef=" + resource.id + "&template=myspaces_preview_panel.ftl" and replace it with a reference to avspaces_preview_panel.ftl above.
    5. Make sure that tomcat is restarted and all the files are correctly picked up, I had to spend 3 hours chasing behind this ghost, until it finally picked up everything correctly. The way you can say whether your file is picked up correctly or not, is by modifying the Update, Edit Details labels in the ftl file, if they change, its being picked up correctly.

No Friend of Santa said...

We have followed these instructions, but when we click on a folder in the myspaces, it opens the viewer with a thumbnail of each document in the viewer. When I click on a thumbnail, it only previews the first page of the PDF and I can't get it to preview the other pages of that particular PDF. Is there something I have Missed?

BLUBLURR said...

Ani Dadu - Could you lend us a hand on getthing these integrated? We are running the latest version of alfresco and I think some of the steps may have changed.

Thanks

Unknown said...

Article is good, but this integration will work in Linux(Ubuntu 9.x). I folled your tutorial, i am not able to view Tool Box of Annotations.

Sunil said...

@Umamaheshwar : it is not showing the annotations tool box because it is old version of veiwone

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search