RE: CAS integrate with Liferay portal 5.2.1

thumbnail
413654, modified 17 Years ago. Junior Member Posts: 61 Join Date: 1/22/08 Recent Posts
I have to integrate my portal developed in liferay with another application. Both applications have access to the User and MyAccount (additional fields for users) entities.

If I want to update one user fields from my other application, those changes are not seen in liferay because of the caching.

I want to define there is no caching for those entities.

I tried to define the portal-ext.properties

#
# Set other Hibernate cache settings.
#
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.use_minimal_puts=true
hibernate.cache.use_structured_entries=false

#
# Value objects are cached by default. You can disable caching for all
# objects or per object.
#
# For mapping tables, the key is the mapping table itself.
#
value.object.finder.cache.enabled=true
value.object.finder.cache.enabled.com.liferay.portal.model.Layout=true
value.object.finder.cache.enabled.com.liferay.portal.model.User=false
value.object.finder.cache.enabled.Users_Roles=true
value.object.finder.cache.enabled.MyAccount=false

but doesn´t work. Any idea?
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
Hello,

I think, there is a possibility You could turn off the caching of the specified entities by modifying the hibernate configuration file

META-INF\portal-hbm.xml

in

webapps/ROOT/WEB-INF/lib/portal-impl.jar

- here You can set entity specific caching for hibernate.

But the seconf d problem is, there is used ehcache as a second level cache (it must be synchronized between the instances for example if You have more nodes in cluster) and I do not have any idea if it can be configured in this way... possibly you could by hibernate turn off the second level cache...

good luck, Archie.
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
One more remark - You could specify

#
# Set other Hibernate cache settings.
#
hibernate.cache.use_query_cache=false
hibernate.cache.use_second_level_cache=false

and not true, like You mentioned in Your post - this chould turn the cache off generally - but this is not a very good idea from performance reasons... I would rather try to turn off the second level cache, turn on the first level cache and then tunr off the cache specifically only by the entities which are updated from the second (legacy) system...

cheers, Archie
thumbnail
25796, modified 17 Years ago. Liferay Master Posts: 603 Join Date: 5/14/07 Recent Posts
Which fields are you updating?
thumbnail
413654, modified 17 Years ago. Junior Member Posts: 61 Join Date: 1/22/08 Recent Posts
I need to update the relations fields (foreign keys) with other entities (MyAccount-OtherEntity), data in MyAccount and I think I wont need to update the User fields, only read them.

I need then to have MyAccount with no cache.

I want to keep the cache for all the other entities.


value.object.finder.cache.enabled=true
value.object.finder.cache.enabled.com.liferay.portal.model.Layout=true
value.object.finder.cache.enabled.com.liferay.portal.model.User=true
value.object.finder.cache.enabled.Users_Roles=true
value.object.finder.cache.enabled.com.ext.portlet.myaccount.model.MyAccount=false

#
# Set other Hibernate cache settings.
#
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=false
hibernate.cache.use_minimal_puts=true
hibernate.cache.use_structured_entries=false

With this settings I have no cache for MyAccount, but also I have no cache for all other entities (I tested with User)
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
Hello,

why do You set

hibernate.cache.use_second_level_cache=false

?

I think, this should be true to enable the ehcache, containing the cached objects... The first level cache of hibernate keeps the objects only during the living Hibernate session, what is used during one request only. As far as i know the second level cache should contain the objects also between the requests...

with regards, Archie
thumbnail
413654, modified 17 Years ago. Junior Member Posts: 61 Join Date: 1/22/08 Recent Posts
I still can´t avoid cache for some entities. Anyone could help please?
thumbnail
493980, modified 16 Years ago. Regular Member Posts: 154 Join Date: 2/19/08 Recent Posts
Hey,
Did you ever have any luck with this issue? I've got an almost identical situation. I'm on liferay 4.4.2 fwiw
Thanks,
Eric
1693896, modified 17 Years ago. Junior Member Posts: 96 Join Date: 12/3/08 Recent Posts
Hai to every one.

i got a requirement like,how can i do the Liferay JOURNAL CMS Content caching.
But i found ehcache option for caching,it will for whole site,i need only for content(includes journal articles,journal content,journal content search any thing related to content.) to solve this problem query caching will help us or not.if yes give me the steps.

how can i achieve this.
please help to solve the problem

Nagireddy Y
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
Hello,

I do not know how it works exactly, but did You checked the functionality of the option "cacheble" by every template? From the description by tthis option I would guess the result display of the article in the page is cached if this is checed (so, not the article, but only the concrete visual interpretation of the article on the specified place) - I think, this is more important than the caching of the article itself.

There is made the caching of DB entities, so also of articles,e tc. if the cache is generally turned on...

Did You also tried following option?

#layout cache turned on - caches all guest pages:
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=true
thumbnail
34936, modified 17 Years ago. Expert Posts: 275 Join Date: 8/26/07 Recent Posts
Check the "cacheable" checkbox in journal templates.
1693896, modified 17 Years ago. Junior Member Posts: 96 Join Date: 12/3/08 Recent Posts
Hai to arthur.

i got a requirement like ,i want to display only the latest version of article on the
article tab of journal portlet.But older versions shouldn't get displayed in portlet.

How can i achieve this.

your suggestions are always welcome.

if any body,knows exact solution.please reply back to me.

Thanks
Nagireddy Y
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
Hello,

spontaneusly I would say, the simplest way is to expire all the úprevious versions of the article :-) But You probably know it - if You want the different behavior of the journal contant portlet than the default one, You have to possibly develop a new/different portlet or just to modify the functionality of the default one.

cheers, Archie
1693896, modified 17 Years ago. Junior Member Posts: 96 Join Date: 12/3/08 Recent Posts
hai to everyone.

i am trying to integrate CAS(Central Authentication Service) with Liferay portal 5.2.1. and i followed the below steps.

i copied the cas-server-3.2.1 into Liferayportal/tomcat/webapps folder,and i placed casclient.jar file in Liferayportal/tomcat/webapps/root/WEB-INF/lib folder.

then i generate the sslcertificate key using RSA Algorithm.

i use the below commands.

keytool -genkey -alias tomcat -keypass changeit -keyalg RSA
this command is used to generate the .keystore file in c:/documents and settingd/Nagi.Yedula/liferay folder.

Then i copied the .keystore file into my own file.
keytool -export -alias tomcat -keypass changeit -file %FILE_NAME%

Then i used the below command to make certificate as trusted.
keytool -import -alias tomcat -file %FILE_NAME% -keypass changeit -keystore %JAVA_HOME%/jre/lib/security/cacerts


Then i modified the web.xml file in webapps/root/WEB-INF/lib folder.
i added the CASFilter.

the i enable the SSL connector in server.xml of tomcat folder.

Then i start the Liferat tomcat serverthen i hit the http://localhost:8080/
then i click signin in menu.it was redirect to below url

https://localhost:8443/cas-web/login?service=http%3A%2F%2Flocalhost%3A8080%2Fc%2Fportal%2Flogin.

then browser saying.
localhost:8443 uses an invalid security certificate.

The certificate is not trusted because it is self signed.

(Error code: sec_error_ca_cert_invalid)

if any body come across the problem.if any body found the solution.please let ma know.

Thanks
Nagireddy Y
thumbnail
146511, modified 17 Years ago. Expert Posts: 459 Join Date: 9/13/07 Recent Posts
Hello,

I would propose to post this issue as a "brand new" thread...

Unfortunatelly I do not have experiences with CAS so I cannot help You with some advice...

good luck, Archie