For Alfresco Community 3.4.a and newer and Enterprise 3.3.5 or 3.4 and newer, please see Doclib Portlet instead.
One of the new features added to Alfresco Enterprise 3.2r is the ability to turn Web Scripts into standalone portlets that run on Liferay or other portals and include support for Single Sign-On (SSO) and generating portal-friendly URLs.
This capability is further enhanced in Alfresco Community 3.4 and later versions as we can now deploy the Alfresco Share Document Library as a portlet.
The DocLib Portlet aims to surface the rich document management capabilities provided by the Share Document Library (DocLib) within a Portal.
For any other requirement there also is an alfresco-demo-portlets project hosted on Google Code that will show how to implement portlets for any portlet-container using the Alfresco Web Services API, WebScriptPortlet, CMIS and Spring Surf: [alfresco-portlets-demo]
The following videos demonstrate the basic features and installation process.
Portals provide a framework for integrating information, applications, people, processes etc. They are designed to aggregate and personalize information through application-specific portlets. They typically offer some basic content management capabilities but do not provide the rich content management services supported by Alfresco.
Portal users want to use Alfresco's document management capabilities within the context of the Portal rather then via a standalone UI.
The Doclib Portet will allow Alfresco's document management capabilities for the repository or Share Sites to surfaced directly within the portal (initially Liferay) via portlets. This will allow all the core document management capabilities to be used within the context of the portal page, without opening in separate tabs/windows.
Initial Supported Stack:
Liferay Portal CE & EE 5.2.3 (Others TBD)
IE7+, Firefox 3.6
Portal server components to be delivered as a war installable within the portal application server instance.
Alfresco server components installable against Alfresco Enterprise 3.3.1.
Other parts of the Share client including dashboard and pages components, other than the document library, will not be portlet enabled.
The DocLib Portlet technically consists of 2 portlets, a Repository Document Library portlet and Sites Document Library portlet.
The following applies to both the Repository Document Library portlet and the Sites Document Library portlet.
The standard Share header will *not* be available i.e. My Dashboard, My Profile etc, site name, page component links.
Filters - All Documents/I'm Editing/Others are Editing/Recently Modified, Recently Added, My Favorites
Hierarchical folder browsing
Simple Document Details Page (Popup)
Document Details Page including:
All existing standard Document Actions
Note: Share (links) will NOT be available
Edit Document Metadata
Simple Folder Details Page (Popup)
Folder Details Page
All existing standard folder actions *except* View in Alfresco Explorer (see below) and Share (links)
Edit Folder Metadata
Actions Not Available in Portlet DocLib
Navigation to other page components e.g. profile, wiki, blog, calendar
Navigation to header components e.g. My Dashboard, My Profile, Sites, Search etc.
Document Details - Share panel (links)
Folder actions - View in Alfresco Explorer
Share (links) from the Folder and Document Details pages will not be available
New Actions Only Available in Portlet DocLib
A new "Open Share" action will provided to allow the user to open the full Share client. [TBC]
An option will be provided to allow links to user profiles will navigate to the profile page for the user provided by the portal itself.
Share Document Library Portlet
This portlet also includes a launch page that allows the user to pick the site they would like to work with from a list of sites they have access to. This will be the default starting page for the Sites Document Library portlet.
Alternatively, the portlet configuration can define a start page URL that defines the document library for an existing Share site to be used.
Repository Document Library Portlet
Configuration to define the start page URL for the starting (root) space for the dashlet, defaults to company home. Identical to the "Repository" link within Share itself.
Installation and Configuration (Liferay)
Liferay v5.2.3 installed & working. We have not tested and therefore do not support Liferay 6 at this time.
Admin user knows where Liferay's "deploy" folder is.
NOTE: Yes, the value for proxyUserName needs to be blank.
Put the Share war into Liferay's tomcat
Step 4. Copy <ALFRESCO_HOME>/tomcat/webapps/share.war to <LIFERAY_HOME>/deploy
Change the share.loader
Step 5. Copy the entire <ALFRESCO_HOME>/tomcat/shared directory to <LIFERAY_HOME>/<tomcat>/
NOTE: Technically, we only need the shared/classes/alfresco/web-extension/ directory, but copying the whole shared directory is a convenient alternative.
Activate Liferay's Share external SSO
Step 6. Open <LIFERAY_HOME>/<tomcat>hared/classes/alfresco/web-extension/share-config-custom.xml.sample to share-config-custom.xml and edit the file to uncomment the second config block to enable remote authenticator. The comments are on lines 44 and 73. The result should look like this:
Note: Modify endpoint-url parameters to match actual Repository deployment.
<alfresco-config> <!-- Overriding endpoints to reference a remote Alfresco server --> <config evaluator="string-compare" condition="Remote"> <remote> <endpoint> <id>alfresco-noauth</id> <name>Alfresco - unauthenticated access</name> <description>Access to Alfresco Repository WebScripts that do not require authentication</description> <connector-id>alfresco</connector-id> <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url> <identity>none</identity> </endpoint> <endpoint> <id>alfresco-feed</id> <name>Alfresco Feed</name> <description>Alfresco Feed - supports basic HTTP authentication</description> <connector-id>http</connector-id> <endpoint-url>http://localhost:8080/alfresco/s</endpoint-url> <basic-auth>true</basic-auth> <identity>user</identity> </endpoint> <connector> <id>alfrescoCookie</id> <name>Alfresco Connector</name> <description>Connects to an Alfresco instance using cookie-based authentication</description> <class>org.springframework.extensions.webscripts.connector.AlfrescoConnector</class> </connector> <endpoint> <id>alfresco</id> <name>Alfresco - user access</name> <description>Access to Alfresco Repository WebScripts that require user authentication</description> <connector-id>alfrescoCookie</connector-id> <endpoint-url>http://localhost:8080/alfresco/wcs</endpoint-url> <identity>user</identity> <external-auth>true</external-auth> </endpoint> </remote> </config> </alfresco-config>
NOTE: If you're running Alfresco's Tomcat server on a different host or port, please change the corresponding endpoint.
Start both tomcats
Step 7. Startup Alfresco, then follow up with starting Liferay.
Step 8. Once Alfresco and Liferay are started, add and try out the basic CMIS Repo Browser portlet. It should appear under the "Alfresco" category.
This integration makes use of an external authenticator that will automatically create an Alfresco user account whenever a new Liferay user accesses an Alfresco portlet.
Developing New Portlets
To create your own custom portlet, I recommend you look at the CMIS Repo code under in the share.war file under WEB-INF/classes/alfresco/webscripts/org/alfresco/test/cmisrepo.* and cmisfolder.*.
In short, you'll need to create a Web Script which can be placed inside the share.war file under WEB-INF/classes/alfresco/webscripts or in<LIFERAY_HOME>/<tomcat>/shared/classes/alfresco/web-extension/webscripts (create the directory if it doesn't already exist.
You'll also need to edit the portlet.xml file in the share.war/WEB-INF directory to add a new entry for your portlet using the Alfresco "ProxyPortlet" as the portlet class.