« Back

Alfresco 3.3 delivers CMIS support, integration with Liferay 6

General Blogs June 2, 2010 By Jonas Yuan

Alfresco 3.3 with implementation of CMIS provides interoperability of its enterprise content management system with Liferay 6. In previous blogs Integrating Alfresco through CMIS in Liferay and the book: Liferay Portal 6 Enterprise Intranets, we have discussed how to integrate Alfresco 3.2 through CMIS 1.0 in Liferay 6. In this article, we are going to introduce how to integrate Alfresco 3.3 through CMIS 1.0 in Liferay 6. 

This article will use Alfresco 3.3 E and Liferay portal 6.0.2 to show how to integrate Alfresco through CMIS in Liferay.  Of course, you can do the same for Alfresco 3.3 or above community (or enterprise) version.

Integration

You should be able to integrate Alfresco through CMIS in following steps

  • Install Liferay portal 6.0.2 (revision 54489) or above at $LIFERAY_HOME; Liferay-Tomcat bundle is expressed as $TOMCAT_AS_DIR; and $PORTAL_ROOT_HOME = $TOMCAT_AS_DIR/webapps/ROOT;
  • Locate Alfresco 3.3 WAR ${alfresco.war} and Share WAR ${shared.war} at $ALFRESCO_INSTALLATION/ tomcat/webapps
  • Drop ${alfresco.war} and ${shared.war} to $TOMCAT_AS_DIR/webapps;
  • Create a database alfresco in MySQL.
    drop database if exists alfresco;
    create database alfresco character set utf8;
    grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
    grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

  • Optionally, create database lportal in MySQL
    drop database if exists lportal;
    create database lportal character set utf8;
    grant all on lportal.* to 'lportal'@'localhost' identified by 'lportal' with grant option;
    grant all on lportal.* to 'lportal'@'localhost.localdomain' identified by 'lportal' with grant option;

  • Create a file named portal-ext.properties at $PORTAL_ROOT_HOME/WEB-INF/classes and add following lines in portal-ext.properties.
    dl.hook.impl=com.liferay.documentlibrary.util.CMISHook
    cmis.credentials.username=admin
    cmis.credentials.password=admin
    cmis.repository.url=http://localhost:8080/alfresco/service/api/cmis
    cmis.repository.version=1.0
    cmis.system.root.dir=Liferay Home

  • Optionally, add database connection in portal-ext.properties.
    ## MySQL
    jdbc.default.driverClassName=com.mysql.jdbc.Driver
    jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
    jdbc.default.username=lportal
    jdbc.default.password=lportal

Of course, you can use different database systems.

  • Start the portal

By the way, you can download Alfresco 3.3 E WAR and Share WAR directly from

/palm_tree/book/0387/chapter12/cmis/1.0/

Of course, you can get the latest WAR of Alfresco Community version or Enterprise (Trial) version from Alfresco website

http://www.alfresco.com/try/

Results

In Control panel of Liferay portal, select default community “liferay.com”; 

going to Content->Document Library, create a folder "Liferay Home" and upload a document under this folder as shown in following screenshot.

Logging in Alfresco as "admin/admin", you would see the folder "Liferay Home" and the document as shown in following screenshot. That is, Alfresco becomes direct repository of Liferay Document Library via CMIS. All real content is stored in Alfresco, while all metadata is stored in Liferay database.

In brief, Liferay supports CMIS 1.0 100%. Isn’t it? You can integrate other ECM or related systems easily via CMIS in Liferay portal, like Dennis Hamilton, EMC, FatWire, IBM, Microsoft, Open Text, Oracle and SAP, etc.

Threaded Replies Author Date
Hi! thanks Jonas, does versioning of the same... charles quacap June 2, 2010 6:59 AM
Hi Charles,thanks. Logically, versioning of the... Jonas Yuan June 2, 2010 10:08 AM
Thank you for the nice article: Just a quick... Cesar Capillas June 3, 2010 3:43 AM
Hi Cesar, thanks. Yes, you are right. The cmis... Jonas Yuan June 3, 2010 10:17 AM
Hi my alfresco port is 8080 and my liferay port... salma Ellouze February 28, 2011 11:38 PM
Hi I removed alfresco and I re installed the... salma Ellouze March 1, 2011 12:55 AM
Hi how can i now search content in alfresco via... salma Ellouze March 1, 2011 1:00 AM
Hi! I also try this with Alfresco in other... Ana Sir June 3, 2010 5:42 AM
Hi Ana, thanks. You do have good point. Liferay... Jonas Yuan June 3, 2010 10:35 AM
Hi, Jonas, Thank you for this interesting... Xinsheng Robert Chen June 7, 2010 8:48 AM
hi!can you please help me...i have been trying... anshul gangwani June 13, 2010 11:19 PM
Hi Anshul, thanks. It seems that you have... Jonas Yuan June 16, 2010 4:55 PM
Thanks Jonas for this interesting article. CMIS... SZ khan September 6, 2010 6:38 AM
Hi Sultee, thanks. Do you get this issue... Jonas Yuan September 8, 2010 3:22 PM
Jonas, imagine the situation, ok I want to use... ilke Muhtaroglu November 4, 2010 1:04 AM
Hi Ilke, you can use Open Search. Eventually,... Jonas Yuan November 4, 2010 4:53 PM
ilke: Alternatively to opensearch, there... Cesar Capillas November 5, 2010 1:29 AM
Thank you, Cesar. Example Alfresco 3.4 and... Jonas Yuan November 9, 2010 5:30 AM
Hi, i have a little problem to integrate... Tobias Richter November 16, 2010 2:07 AM
Hi Tobias, it seems that you miss alfresco... Jonas Yuan November 16, 2010 7:28 AM
Yap, thanks i solved that problem a log time... Tobias Richter January 27, 2011 2:58 AM

Hi! thanks Jonas, does versioning of the same file work when uploading from the liferay's side?
Posted on 6/2/10 6:59 AM.
Hi Charles,thanks. Logically, versioning of the same file should work when uploading from the Liferay side. Do you have a chance to test it? It would be nice that you could share your testing results here.
Posted on 6/2/10 10:08 AM in reply to charles quacap.
Thank you for the nice article:

Just a quick question Jonas, is it not necessary to declare cmis endpoint (repo.remote.endpoint.url) in alfresco main file config (alfresco-global.properties) for getting cmis repository available ? I think it should be, although I'm working with alfresco deployed in other machine. Maybe that's the point.

Regards.
Posted on 6/3/10 3:43 AM.
Hi!
I also try this with Alfresco in other machine and without setting the porperty "repo.remote.endpoint.url" that Cesar told it wasn't work.
And I have some doubts about it...is it posible to create the same folder/documents hierarchy in Alfresco?
Instead of:
Liferay Home -> 10130 -> 10274 -> 1 -> 1.0

Something like:
Liferay Home -> Sysmposium Registration Form.docx

Maybe overriding some code from Liferay or Alfresco??

Because I think searching in Alfresco with that folders and documents names will be a torture!

Thanks in advance!
Posted on 6/3/10 5:42 AM.
Hi Cesar, thanks. Yes, you are right. The cmis endpoint is required when Alfresco is installed in different server (different domain and port number) or Alfresco is installed in same server but using different port number like 80.

Generic configuration would be
cmis.repository.url=http://${domain}:${port}/alfresco/service/api/cmis.
Posted on 6/3/10 10:17 AM in reply to Cesar Capillas.
Hi Ana, thanks. You do have good point. Liferay CMIS here provides generic path for content (Document Library documents).

Liferay Home -> 10130 -> 10274 -> 1 -> 1.0

It covers portal instance (if you had multiple virtual instances), group info (you may have many organizations or communities for a given portal instance), and Document Library document ID (providing a link of document meta-data in Document Library and content in Alfresco).

In normal use cases, I think above info should be required. Isn't it?
Posted on 6/3/10 10:35 AM in reply to Ana Sir.
Hi, Jonas,


Thank you for this interesting article!
Posted on 6/7/10 8:48 AM in reply to Jonas Yuan.
hi!can you please help me...i have been trying to work out on this for so long but not able to find an error correctly...
i made an organization hierarchy and also made each organization's page wiki...i wanted to create a hierarchy in such a way that only top level organization-e.g,like the name of the organization acts like the administrator,its children organization-e.g,Engineering,HR,Sales and Finance are separate organizations and Engineering's further children organizations-LSI Division,MSI Division,Embedded and Enterprise...i wanted to create wikis in such a way that top level organization can do anything with the child orgs...Engineering org can edit and view its own wikis but not HR'S or other organizations and its sub-organziations-LSI,MSD,Sales and Finance can also edit and view its own wikis but cannot edit Engineering's wiki or top organization's wiki...
i also created different roles e.g-Org wiki admin,Org wiki edit and Org wiki view for three users i created resp for admin,edit and view purpose and so provided the resp permissions also.
Now my problem is when i log in using any of these 3 users,i can just edit the wiki page through which a particular organization's page i viewed that wiki and can just view other wikis whether its a parent-child org also...its with all the three users when infact they should have different access control according to the roles created....
please help me...
Posted on 6/13/10 11:19 PM.
Hi Anshul, thanks. It seems that you have questions on how to use Liferay organizations. You may refer details from the book: Liferay Portal 6 Enterprise Intranets.
Posted on 6/16/10 4:55 PM in reply to anshul gangwani.
Thanks Jonas for this interesting article.
CMIS integration worked, but when I try to delete a file it shows the following error:
*********************
13:31:29,214 User:admin ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 08060008 Could not de
lete folder with at least one Child
org.springframework.extensions.webscripts.WebScriptException: 08060008 Could not delete folder with at least one Child
at org.alfresco.repo.cmis.rest.CMISScript.deleteObject(CMISScript.java:1102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav­a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
at org.mozilla.javascript.gen.c4._c0(file:/D:/liferay-portal-tomcat-6.0.5/liferay-p­ortal-6.0.5/tomcat-6.0.26/webapps/alfresco/WEB-INF/classes/alfresco/t
emplates/we­bscripts/org/alfresco/cmis/item.delete.js:74)
Posted on 9/6/10 6:38 AM.
Hi Sultee, thanks. Do you get this issue solved?

You may take following steps:
1) shut down the portal;
2) clean up data (alfresco database, alfresco repository, liferay database and liferay repository);
3) start up the portal.

You would be able to fix the issue you mentioned by above steps.

Hope that it helps,
Posted on 9/8/10 3:22 PM in reply to Sultee khan.
Jonas,

imagine the situation, ok I want to use alfresco as a document repository, but when I do a search in search portlet of liferay I want the result to include the documents also from Alfresco. How is this possible ? CMIS will do this ? or it will enable liferay to use alfresco to store the documents...

ilke
Posted on 11/4/10 1:04 AM in reply to Jonas X. Yuan.
Hi Ilke, you can use Open Search. Eventually, there is an example called alfresco-content portlet. For more details, you may refer to the books: Liferay Portal 6 Enterprise Intranets or Liferay Portal 5.2 Systems Development.

Please let me know if you meet any issues,

Thanks

Jonas
Posted on 11/4/10 4:53 PM in reply to ilke Muhtaroglu.
ilke:

Alternatively to opensearch, there exists a community portlet called alfresco search based on alfresco web services.

http://www.liferay.com/downloads/liferay-portal/community-plugins/-/sof­tware_catalog/products/4633564
Posted on 11/5/10 1:29 AM in reply to ilke Muhtaroglu.
Thank you, Cesar.

Example Alfresco 3.4 and Liferay 6 CMIS integration would be ready shortly.
Posted on 11/9/10 5:30 AM in reply to Cesar Capillas.
Hi,

i have a little problem to integrate Alfresco, so maybe you´ve got the same problem an we can share our solutions.

If you like, follow this Link to the Forum, thanks.
http://www.liferay.com/de/community/forums/-/message_boards/message/64576­89?_19_preview=false#_19_message_6457689
Posted on 11/16/10 2:07 AM in reply to Jonas X. Yuan.
Hi Tobias, it seems that you miss alfresco database.

Create a database alfresco in MySQL.

drop database if exists alfresco;
create database alfresco character set utf8;
grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;
Posted on 11/16/10 7:28 AM in reply to Tobias Richter.
Yap,
thanks i solved that problem a log time ago, i think it was an MySQL Fail as you expected. I just reseted MySQL DB and also the User.

Now, I´ll finish my "projekt" and at that point I´ll set an "how to" for an: [Tomcat01(Lifray<->Alfresco)<->Tomcat02(CAS)<->LDAP] Server Komplex in the Liferay Forum.
----
Now i try to write with Alfresco in Liferay DB via "http://wiki.alfresco.com/wiki/Doclib_Portlet". I hope it will work.
The CAS integration with an LDAP as USER DB, work´s fine for both systems.

And thanks, with out this fine community, I´ll never get that far.
Posted on 1/27/11 2:58 AM in reply to Jonas X. Yuan.
Hi
my alfresco port is 8080 and my liferay port is 8081
should I use the Generic configuration and where?
if Yes, whith what should I replace {domaine} and {port} is it 8080?

I ask that because i have this error
ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 02010001 Ensure that the 'dir.root' property is pointing to the correct data location.
at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:332­)
at org.alfresco.repo.admin.ConfigurationChecker.access$000(ConfigurationChecker.jav­a:68)
at org.alfresco.repo.admin.ConfigurationChecker$1.execute(ConfigurationChecker.java­:180)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(Retrying­TransactionHelper.java:321)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(Retrying­TransactionHelper.java:247)
at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.ja­va:184)
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEven­t(AbstractLifecycleBean.java:56)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEve­nt(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(Abst­ractApplicationContext.java:294)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(Abs­tractApplicationContext.java:858)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractA­pplicationContext.java:419)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(Contex­tLoader.java:261)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextL­oader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(Context­LoaderListener.java:47)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListe­ner.java:63)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843­)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
a­t org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.ja­va:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav­a:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
1 mars 2011 07:52:33 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
1 mars 2011 07:52:33 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de d�marrage du contexte suite aux erreurs pr�c�dentes
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Posted on 2/28/11 11:38 PM in reply to Jonas Yuan.
Hi
I removed alfresco and I re installed the same version.
then i started up alfresco before starting liferay and the problem was disappeared.and I can create and delete documents in alfresco throw liferay portal.
Is that logic
Posted on 3/1/11 12:55 AM in reply to salma Ellouze.
Hi
how can i now search content in alfresco via liferay portal using lucene
Posted on 3/1/11 1:00 AM in reply to salma Ellouze.