Blogs

Blogs

Full Integration of Liferay 5.3, Alfresco 3.1 E, LDAP, SSO, and OpenX 2.6

The upgrade of the solution - Full Integration of Liferay 6, Alfresco 3.1 E, LDAP, SSO, and OpenX 2.6 – is ready.

liferay-5.3-alfresco-3.1-sso-ldap

What are the new features?

The new features include Liferay 5.3 (at revision 35656), Alfresco 3.1 E and OpenX.

  • It integrates FCKEditor 2.6.4 – in detail, you may refer to the book: Liferay portal 5.2 Systems Development.
  • It makes content-rich flashes (e.g., SWF, Video, Game, Slideshow, Video Queue, Video List, Play-list) available for Journal Articles (web content); 
  • The alfresco portlets include Alfresco Client, My Spaces, Document List, My Tasks, My Web Files, and My Web Forms.
  • The ads portlets include ad viewer and manage ads.

Where should I find real demo?

General information
http://liferay.cignex.com/

Alfresco 3.1 E, LDAP ADS and SSO CAS
http://liferay.cignex.com:8090/alfresco

Liferay Portal (5.3 with FCKEditor 2.6.4), Alfresco Portlet (3.1 E), LDAP ADS and SSO CAS
http://liferay.cignex.com:8080/c/portal/login

How can I use these features in my own servers?

Alfresco, LDAP and SSO CAS full integration.

1. First please download an example Alfresco 3.1, LDAP (ADS) and SSO CAS.
Download (save link as ...)
alfresco.war
2. Then create database (this is configurable) MySQL
create database alfresco31;
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;

Deploy war in your AS: tomcat/webapp

Note that, you may need to set "dir.root" as "dir.root=/opt/sso/alfresco31e/alf_data" in custom-repository.

3. Start your AS
Go to http://localhost:8080/alfresco

4. In CAS login page, login
possible users in LDAP server (docs.cignex.com) (configurable)
jonas/jonas
jane/jane
...
After login in CAS, you should be in Alfresco MyAlfresco page with your login name. No need re-login in Alfresco.

A solution of SSO plus LDAP for Liferay Portal 5.3 and Alfresco Portlet 3.1 E with full RESTFul Integration

1. First please download an example Liferay Portal 5.3, Alfresco Portlet 3.1 E, LDAP (ADS) and SSO CAS.

liferay-5.3-tomcat-6.0.20.zip

Download from (save link as ...)

http://liferay.cignex.com

unzip it in your local machine.

2. Then create database (this is configurable) MySQL

for Liferay Portal 5.3
create database lportal;
grant all on liferay53.* to 'liferay'@'localhost' identified by 'liferay' with grant option;
grant all on liferay53.* to 'liferay'@'localhost.localdomain' identified by 'liferay' with grant option;

for Alfresco Portlet
create database alfresco31;
grant all on alfresco31.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;
grant all on alfresco31.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;

3. Start your AS from unzipped file
tomcat/bin/startup.bat or sh startup.sh

Note that, you may need to reset "dir.root" as "dir.root=/opt/sso/liferay53/alf_data" in custom-repository.

Go to http://localhost:8080/c/portal/login

press sign in

You may need to configure LDAP:
ldap://docs.cignex.com:10389
ou=users,ou=system
uid=admin,ou=system

and configure SSO
https://docs.cignex.com/cas-web/login
https://docs.cignex.com/cas-web/logout
https://docs.cignex.com/cas-web/proxyValidate

Note that:

you need to set "How do users authenticate?" "by Screen Name" under "Authentication->general";
you need to set "Authentication Search Filter" "(cn=@screen_name@)" under "Authentication->LDAP";

4. In CAS login page (https://docs.cignex.com/cas-web), login

possible users in LDAP server (docs.cignex.com) (configurable)
jonas/jonas
jane/jane

...

After login in CAS, you should be in Liferay Portal with your login name. No need relogin in Liferay Portal.

Add Alfresco Ext Client. You should be in Alfresco Portlet with your login name. No need relogin in Alfresco Portlet.

 

A solution for OpenX (2.6.3) and Liferay (5.3.0 or above) full RESTful integration

Login as
jonas/jonas
 
1) Examples:

View: http://docs.cignex.com/ad_services/services?action=download&uid=5

Search: http://docs.cignex.com/ad_services/services?action=search

Report: http://docs.cignex.com/ad_services/services?action=report

2) Usage of ad-portlet plugin

You can also download the WAR (ad-portlet plugin with source code) at

http://liferay.cignex.com/ad_server/ad-portlet-5.3.0.1.war

In database (e.g., MySQL), you need to create a database 'bookpub'.

create database bookpub;
grant all on bookpub.* to
'lportal'@'localhost' identified by 'lportal' with grant option;
grant all on bookpub.* to
'lportal'@'localhost.localdomain' identified by 'lportal' with grant option;

3) Customization
You can use source code to customize the user experience. At the same time, you can configure database name and user as well.

Note that, Manage Ads (using jQuery) has a bug in IE. The JavaScript for adding an Ad does not work well in IE. But it is working fine in FireFox. 

 

Good luck!

Hello Jonas,
I have a problem! I am wondering how to configure your very useful portlet to use it with my own OpenX instance. Do I have to get your source code, update it (where?) and compile or can I change the portlet's configuration through a conf file ?

Thanks
Hello Guillaume, Thank you.

As mentioned in http://www.liferay.com/web/jonasxyuan/blog/-/blogs/full-restful-integration-of-liferay-and-openx, you can have source code. Thus you can change the portlet's configuration as you expected.

You can get source code at http://liferay.cignex.com/ad_server/. By the way, the source code will be available at Liferay SVN repository soon. For detailed instructions, you may refer to http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Integration+with+OpenX.
Hi, post looks at using external CAS, but the problem is - we need the system to be located on a server, which is not connected to the internet, what am i to do?

Is it possible to suggest an article on how to put up an SSO service and one for connecting platforms to it?
Hi Bolatzhan, than you. You can put CAS in the same server as that of Liferay portal. For example, current CAS is in docs.cignex.com. But you can move it to liferay.cignex.com. Thus for document, you just use docs.cignex.com and liferay.cignex.com pointing to a same domain name.
Hi Jonas,

I just want to use only 5.3 server wthout cas an Alfresco. What is the default login credentials for liferay ? I coulnt
Hi Jedi, thanks. If you were using LDAP, then the default login credentials should come from LDAP.
i am not using ldap and want to try liferay 5.3 only this time. thanks
Hi Jedi, thanks. You can use database storing all users info. Just leave LDAP configuration in the portal 5.3.
I can't wait for the do-it-yourself on the wiki emoticon, a 5.3 development book with this included would be nice

I wanted to ask something, this could also help on the uploading file system liferay got by default? I mean, could attachments on wikis and boards go directly to an alfresco space?
Hi Pablo, Thank you. You can integrate attachments on wikis and boards directly to an alfresco space - it needs addition code for customization.

Currently, Alfresco is used as a direct repository of Document Library and Image Gallery.

New book would cover this part in details and it will be available at the beginning of new year hopefully ...
I was trying to check the WYSIWYG on your demo site, to understand how you upload or use files from/to alfresco, but it doesn't load, it displays a pop up saying: bar name "liferay" undefined

Also it seems the Document Library and Image Gallery there are not using Alfresco as a Repository

Can you tell or make a wiki entry on where the portlets point to certain repository and how to tell them to use an Alfresco space instead?
Thank you, Pablo. I will make a wiki article for this. Eventually, details are available at Chapter 6: Customizing the WYSIWYG Editor of the book Liferay Portal 5.2 Systems Development. You can refer it
at http://www.amazon.com/Liferay-Portal-5-2-Systems-Development/dp/1847194702
or
http://www.liferay.com/web/jonas.yuan/blog/-/blogs/liferay-book:-liferay-portal-5-2-systems-development
Sorry to keep bothering, I wanted to use the latest LR 5.3, Alfresco Community 3.2 and CAS SSO on my own, and not use the bundle you provide

It shouldn't be too hard to do, just place the same parameters from LR CAS Filter into Alfresco, and also the filter mappings

But when I log in CAS it works for LR but the Alfresco portlet is still on guest, tried to do something from Alfresco wiki about telling the Authentication Filter to use cas user parameter but didn't worked either

What else am I missing so Alfresco listens to CAS?, been trying this for weeks emoticon
Hi Pablo, do you get issue fixed? Hope that you did.
Hi Jonas!
Is there also a way to integrate Alfresco as a set of portlets only with SSO and without LDAP binding? I mean, a member can register on Liferay and the account is also valid for Alfresco portlets. So afer log in to Liferay there is no relogin on Alfresco portlets necessary.
Hi P Cache, good point. Do you want to implement it?
I have some problems including :

ERROR [jsp:165] java.lang.NoClassDefFoundError: com/liferay/portal/kernel/util/SSOAutoLoginConstant

and

15:51:26,015 User:test ERROR [freemarker.runtime]

Error on line 37, column 7 in org/alfresco/portlets/doclist.get.html.ftl
userhome is undefined.
It cannot be assigned to home
The problematic instruction:
----------
==> assignment: home=userhome [on line 37, column 7 in org/alfresco/portlets/doclist.get.html.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Error on line 37, column 7 in org/alfresco/portlets/doclist.get.html.ftl
userhome is undefined.
It cannot be assigned to home
at freemarker.core.Assignment.accept(Assignment.java:111)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.IfBlock.accept(IfBlock.java:82)

after login to CAS it redirect me to liferay but alfresco portlets dont works properly , they work properly only for users who have spaces already in alfresco !!
Hi Seyed, Thanks. Do you use FreeMarker in Alfresco? It seems that only web scripts (with ftl) throws erros.

Note that FreeMarker got supported in Liferay 6, too.
Yes FreeMarker used in Alfresco but it is default of alfresco and its webscripts use FreeMarker for UI.

but root of problem is not FreeMarker. Alfresco authentication is root of problem. Alfresco can not create home folder for LDAP users or it can not create space for users who authenticated by LDAP and CAS.

I configure Alfresco to use LDAP for user authentication and use single-sign-on by CAS. when i try to login to Alfresco directly it works fine but when i login to Liferay by CAS alfresco portlets generate above exception.

it seems alfresco can not creates home folder (space) for users stored in LDAP. because i can signin to alfresco directly (http://localhost:8080/alfresco) and create space for users.
single-sign-on for users who have a space in alfresco already works fine but for new users that added by Liferay or added directly to LDAP doesn't work.
by this way i have to create space and home folder for all users manually by login to Alfresco directly.
Hi Jonas.
I've been able to successfully integrate your ad-portal into my liferay test instance and able to search the example openx server for banners.

However, I am getting javascript errors on both IE 8 and Firefox while attempting to select the banner checkboxes and not able to add an Ad. - I get the "Please select at least one banner" error. any ideas?

any help is appreciated. thanks!
Hi Marc, you may need to include jQuery js files and CSS in the portlet, since LR 6.0 does not include any jQuery by default.

Hope that it helps,

Jonas Yuan
Thanks Jonus.
I was able to test it by adding the jquery javascript include directly in the template, so it looks like that was it, but I am having some issues adding the javascript to the portlet props instead of the template. (sorry, I'm a portlet newbie).

I read thru your Building jQuery based plugins in Liferay 6
blog did the following:

1. added the following to ../webapps/ad-portlet/WEB-INF/liferay-portlet.xml

<portlet>
<portlet-name>1</portlet-name>
<icon>/images/world.png</icon>
<header-portlet-css>/css/style.css</header-portlet-css>
<header-portlet-javascript>/js/jquery.js</header-portlet-javascript>
<footer-portlet-javascript>/js/jquery-ui-custom.js</footer-portlet-javascript>
<css-class-wrapper>sample-jquery-portlet</css-class-wrapper>
</portlet>

2. copied the js files to ../webapps/ad-portlet/js and css files to ../webapps/ad-portlet/css

that doesn't appear to include the javascript though in the page with the portlet. am I missing something?

thanks again!
[...] Haven’t tried using SSO approaches yet: 1. Rivet Logic STAr (Secure Token Authentication rivet amp for Alfresco) used with AWPr 2. Jonas Yuan / Cignex LDAP ADS and SSO CAS  and also blog post on a... [...] Read More
Hi i have a problem ,
how to use SSO in liferay portal if alfresco it is been integrated ?
Meanwhile i have to login in liferay portal and again login in alfresco and alfresco it is been integrated in liferay portal ??