Alfresco Share Web Quick Start WYSIWYG File Browser WCM - 3.4 YUI
Written by Ian Norton Tuesday, 05 April 2011 15:51
The Alfresco Share WYSIWYG file browser is a small module built to add a file browser to the standard Alfresco Share editing window.

The module is intended for a Web Quick Start site that I am working on, I've only had the chance to test it in Share so far, hopefully AWE will tested and implemented by the end of the week.
The AMP for the alfresco repository adds a new webscript that outputs a directory structure as a JSON representation, Share is then able to use this and feeds it into YUI with uses YUI treeview to display the list back in a hierarchical list.
Applying the AMP files
Download both the Alfresco Repo AMP (alfresco-sharefilebrowser-service.amp (3.35 kB)) and the Alfresco Share AMP (share-filebrowser.amp (12.52 kB)), place the amps in the amps/ and amps_share/ directories respectively, run individually using the module management tool:
java -jar bin/alfresco-mmt.jar install amps/alfresco-sharefilebrowser-service.amp tomcat/webapps/alfresco.war -verbose -force
java -jar bin/alfresco-mmt.jar install amps_share/share-filebrowser.amp tomcat/webapps/share.war -verbose -force
Modify the 'share-config-custom.xml' file, this is found either in tomcat/shared/classes/alfresco/web-extension or tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension/ you will need to dependencies for the javascript file needed for the extension as well as specific parameters for the editor. For convenience I've grouped these changes into one file that you can download (share-config-custom.xml (10.38 kB))
Delete the exploded alfresco and share directories from the webapps folder and restart alfresco, when you reload Share you should have a small icon by the 'image URL' text input box which launches the file browser seen below:

Known Issues:
- The file browser's not particularly well integrated into Share, it's essentially it's own HTML page which renders an un-ordered list and uses YUI treeview to format it, i'd like to revise this to run from a share modal pop-up when i've got the time.
- Not tested in AWE, I intend to look at this in the next week or so.
- The resulting hyperlink to a page / document / image uses the "/share/proxy/alfresco/api/node/content/workspace/SpacesStore/cd631807-b3b0-468c-9196-3fa8bb3b1b5f/test.jpg", this obviously doesn't match the URL structure in quickstart
Files:
Alfresco AMP (alfresco-sharefilebrowser-service.amp (3.35 kB))
Share AMP (share-filebrowser.amp (12.52 kB))
Share Config XML (share-config-custom.xml (10.38 kB))