Thursday, 27 December 2018

Configuring Alfresco 5.0/5.1/5.2 repository with Liferay 7.0

If you are looking to integrate Liferay 7.0 with Alfresco 5.x enterprise or community, here are some simple steps you can follow to achieve it.

1) Make sure you have liferay and alfresco both up and running (either on same machine or different)

2) Liferay provides a Documents and Media portlet which shows the files/folders that you create/upload in liferay repository as well as it shows the files/folders which alfresco stores (once the alfresco repository is mapped to liferay)

3) Perform the steps below to integrate alfresco repository with liferay so that all files you upload in alfresco will show up in Documents and Media portlet of liferay. 
This will also enable you to upload files from liferay; which ultimately gets stored in alfresco; so you can view that uploaded file in alfresco also.

a) Liferay comes built-in with test user (test@liferay.com). Check the Profile section of this user once you have logged in to liferay with this test user. It will show screenName and also userId. Copy the screenName value on your clipboard (ex: test).

b) Create a file portlet-ext.properties (if not exists already) under LIFERAY_HOME (liferay installation dir)Add the following entries (assuming that your screenName is 'test'):
session.store.password=true
company.security.auth.type=test

c) Create a user in alfresco with username (same as userId in liferay; ex: 5651). Password should also be the same as the password of '5651' user which you are mapping.

4) After performing the above steps, just add repository from Documents and Media portlet. In the Repository Type, select either of the options (CMIS Repository Atompub OR WebServices). You may face issues while connecting to Alfresco using Atompub URL; in that case, you WebServices option and provide alfresco URL details asked for.
Details for it can be referred under this link:
https://dev.liferay.com/es/discover/portal/-/knowl...

Search:
1) Liferay 7 provides elastic search by default for smooth/faster searching.

2) Once the alfresco repository is integrated successfully with liferay (Documents and Media Portlet); you can view the documents/folders of alfresco inside this portlet.

3) The search option in this portlet will allow you to search not only within liferay repository but also within alfresco repository.

4) When you search for a keyword, the search results page provides you two tabs (a) local (b) name_of_alfresco_mapped_repository

The search results of alfresco will be shown under the tab (b) whereas the contents searched in local liferay repository are listed under tab (a).

Most important thing is this search includes full-text search (both in liferay repository as well as alfresco repository). That is, if you search for a keyword (present inside the content of the document), the search will be conducted not only across the file name, title, description, but also inside the contents of the document.

Logout Issue with liferay
If you face issues like when you click Logout from liferay, and then try to login again, then you are not allowed to login. You get message like invalid credentials and in log, you may get error like raw credentials must be valid, etc. In that case, try the following:
1) Disable SSO by commenting these properties from portlet-ext.properties file; and restart Liferay:
session.store.password=true
company.security.auth.type=test

2) Go to Liferay > Control Panel > Instance Settings > Configuration > Authentication.
In the openSSO tab, check the userId (It should be 5651, or the one that you are using as userId in liferay and the same name with which you have created user in alfresco).
3) Save the configuration.
4) Uncomment those two properties from portlet-ext.properties file; save it.
5) Restart liferay.

This should resolve your log out issue (i.e logging out expiring the liferay session).
This configuration also resolves the issue of alfresco repository mapping. That is, when alfresco repository is configured in liferay using one user's login; but the same user when logs into liferay home from another machine, the mapped repository does not show up in Documents and Media portlet.
The above configuration also resolves the issue mentioned.

No comments:

Post a Comment