Академический Документы
Профессиональный Документы
Культура Документы
Contents
[hide]
• 1 Version Applicability
• 2 Overview
• 3 Videos
• 4 Use Cases
• 5 Constraints
• 6 Portlets
o 6.1 Common Capabilities
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.
• Demonstration Video
• Installation Video
Use Cases
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.
Constraints
• Initial Supported Stack:
• Liferay Portal CE & EE 5.2.3 (Others TBD)
• Tomcat 6
• 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.
• Localisation TBC
• Multi-tenant TBC
Portlets
The DocLib Portlet technically consists of 2 portlets, a Repository Document Library
portlet and Sites Document Library portlet.
Common Capabilities
The following applies to both the Repository Document Library portlet and the Sites
Document Library portlet.
Change all the port numbers to avoid conflicts with the Alfresco’s Tomcat server, here
are the changes I made:
...
connectionTimeout="20000"
...
...
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar Step
3. Edit<ALFRESCO_HOME>/tomcat/shared/classes/alfresco-global.properties and
add the following lines to the end of the file:
• shared/classes/alfresco/alfresco-global.properties
authentication.chain=alfrescoNtlm1:alfrescoNtlm,external1:external
external.authentication.proxyUserName=
Step
4. Copy <ALFRESCO_HOME>/tomcat/webapps/share.war to <LIFERAY_HOME>/de
ploy
• shared/classes/alfresco/web-extension/share-config-custom.xml
Note: Modify endpoint-url parameters to match actual Repository deployment.
<alfresco-config>
<remote>
<endpoint>
<id>alfresco-noauth</id>
<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>
<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>
<class>org.springframework.extensions.webscripts.connector.Alfres
coConnector</class>
</connector>
<endpoint>
<id>alfresco</id>
<connector-id>alfrescoCookie</connector-id>
<endpoint-url>http://localhost:8080/alfresco/wcs</endpoint-url>
<identity>user</identity>
<external-auth>true</external-auth>
</endpoint>
</config>
</alfresco-config>
NOTE: If you’re running Alfresco’s Tomcat server on a different host or port, please
change the corresponding endpoint.
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.
<portlet>
<portlet-name>CMISFolder</portlet-name>
<init-param>
<name>scriptUrl</name>
<value>/share/service/sample/cmis/repo</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<short-title>CMIS Folder</short-title>
</portlet-info>
</portlet>
To make sure that your URLs are correctly generated, please use the “scripturl()”
function in your Freemarker templates to wrap them: