Alfresco onlineeditbywebdav 2013

854 views

Published on

  • Be the first to comment

  • Be the first to like this

Alfresco onlineeditbywebdav 2013

  1. 1. Online edit Office files with customized WebDAV 2013.11. 27 Takeshi Totani © 2013
  2. 2. Online editing Office files Once upon a time... You could open CIFS folders from your Web browser. ● Current functionality Alfresco provides SharePoint protocol emulation (vti) module ●You can edit Office files from Share interface. ● 2013.11..27 2 © 2013
  3. 3. Why re-invent online edit? Be simpler Alfresco SharePoint module runs jetty inside tomcat webapps :-( ●We are not interested in SharePoint collaboration (vti), we just want to edit online! ● Current limitations Vti cannot online-edit content which is located outside Share sites. ●WebDAV requires authentication even when you are logged in to Share. ●WebDAV file path length easily reaches IE s url limitation when multibyte characters are included in the path as these characters are URL encoded to 6 or 9 alphabet characters for each! ● 2013.11..27 3 © 2013
  4. 4. Implementation strategy Prepare new WebDAV interface Add servlet and filter definition to web.xml ●WebDAV classes are based on the Alfresco original ones. ● WebDAV path Path is constructed as: ●<ALFRESCO_TICKET>/<CONTENT_UUID>.<EXTENSION> ● <ALFRESCO_TICKET>: alfreco login ticket ● <CONTENT_UUID>: last part of alfresco noderef ● <EXTENSION>: file extension ● This technic can resolve the three previous issues! ● 2013.11..27 4 © 2013
  5. 5. Demo 2013.11..27 5 © 2013
  6. 6. WebDAV implementation Implement methods Only implement limited methods needed for online edit: ● GET ● LOCK/UNLOCK ● PROPFIND/PROPPATCH ● PUT ● DELETE ● OPTIONS ● Authentication Ticket based authentication ●use Alfresco java method: ● authenticationService.validate(ticket); 2013.11..27 6 © 2013
  7. 7. Share extension Add Doclib custom action share-config-custom.xml <!-- Custom DocLibActions config section --> <config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="online-edit" type="javascript" label="label.my_action_online_edit"> <param name="function">onActionEditOnline</param> <permissions> <permission allow="true">Write</permission> </permissions> <evaluator>evaluator.doclib.action.isContentType</evaluator> </action> </actions> <actionGroups> <actionGroup id="document-browse"> <action index="400" id="online-edit" /> </actionGroup> </actionGroups> </config> Get current user s login ticket Cannot get login ticket from Share client side. ●Prepared small WebScript to get the ticket. ● share-config-custom.xml model.ticket = session.getTicket(); 2013.11..27 7 © 2013
  8. 8. Windows Client settings: update registry values All Windows Clients Create the key below if it does not exist. ● HKCU/Software/Microsoft/Office/<version No>/Common/ Internet/OpenDocumentsReadWriteWhileBrowsing 1 Windows Vista/7 Clients Update value ● HKLM/SYSTEM/CurrentControlSet/services/WebClient/ Parameters/BasicAuthLevel 2 ※not tested for Windows 8 2013.11..27 8 © 2013
  9. 9. source code and reference Project files github repo: https://github.com/to2y/AlfrescoOnlineEditWebDAV ●run on (at least) Alfresco community 4.2.d ●comments and/or pull requests are welcome! ● Reference http://wiki.alfresco.com/wiki ●http://www.slideshare.net/terajun/alfrescoui ● Contact takeshi.totani@aegif.jp ● 2013.11..27 9 © 2013

×