Search This Blog

Showing posts with label portal. Show all posts
Showing posts with label portal. Show all posts

Monday, September 30, 2013

Session timeout redirection

The session timeout can be handled using few properties in the portal-ext.properties file. .

# Extending session automatically
session.timeout.auto.extend=false



#This property can be used to redirect to home page when the session expires.
session.timeout.redirect.on.expire=true

#Set the login url
auth.login.url=/web/guest/home


note :
for session.timeout.warning=30,
#it is redirects to http://localhost:8080/web/guest/home

for session.timeout.warning=0,
#it is redirects to
#http://localhost:8080/web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&saveLastPath=0&_58_struts_action=%2flogin%2flogin&_58_redirect=%2fweb%2f10311%2fwelcome

Wednesday, September 11, 2013

Unable to download documents from Document Library

This is one of the showstopper issue which people face when they use Liferay 6.1.20 EE GA2 with SSH. and IE 8,7 as the browser. While it works on other browsers like Firefox.The documents from the document library are not available.

Reason:

When the server uses SSL (https os Secure Socket Layer). The apache adds the following to the http headers.

Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate


The IE Browser is  not allowed to store the document in the local system and thus it fails to download the object.

refer:
response.setHeader( HttpHeaders.CACHE_CONTROL, HttpHeaders.CACHE_CONTROL_PUBLIC_VALUE);

present in the classes ServletResponseUtil, PortletResponseUtil.

Here is a link to the microsoft support , which explains the browser issue .
http://support.microsoft.com/default.aspx?scid=kb;en-us;316431

Solution:

Solution 1. Override the code of the classes ServletResponseUtil, PortletResponseUtil. in the setHeaders(request, response, fileName, contentType) method.

                           (or)

solution 2. Add the following line to the apache config file.


        Header unset Pragma

This will remove the pragma entry from the header and the issue would be solved. 






Wednesday, July 24, 2013

Form re submission of/on Page Reload Errror

The property 'action-url-redirect' must be added to the liferay-portlet.xml file. This will not allow the form to be re submitted once the page is refreshed after a form submission is already done.




By default the property is false and thus the form resubmission occurs

Friday, July 19, 2013

How to Remove default Success Message your-request-completed-successfully



There are several ways to remove the message from displaying.


To remove the display use any of the following mentioned approach:

1. Remove entirely from a Portlet :
 Add this init param to your portlet.xml:


2. Remove  from specific  Portlet actions:
Add this to your implementation of processAction method.
SessionMessages.add(actionRequest, 
(LiferayPortletConfig)portletConfig.getPortletName()+ 
SessionMessages.KEY_SUFFIX_HIDE_DEFAULT_SUCCESS_MESSAGE);
  

3.Using Hook for HOOK for html\common\themes\ portlet_messages.jspf

a) remove the message display from all the portlets.



Comment out the lines , then the message will not be displayed for any of the portlets in Liferay at all.

b) remove the message display from specific portlets.

  create a hook and edit the portlet_messages.jspf file. Use the portletId to show/hide the message display. As shown

 

4. Masking with Custom Message in Portlet : Change that message key in your portlet's language.properties file with your custom text. Like, in the language_en.properties file for your custom portlet. add the custom message to the key:

 your-request-processed-successfully=Success! Process completed with no Errors. 

How to remove the message you-have-entered-invalid-data

There are several ways to remove the message from displaying. This message is present in the portal at the following path :-

   html\taglib\ui\error\end.jsp   


To remove the display use any of the following mentioned approach:

1. Using HOOK for all portlets :create a hook and edit the end.jsp file. In which you can comment out the lines , then the message will not be displayed for any of the portlets in  Liferay.

2. Using HOOK for specific portlet: create a hook and edit the end.jsp file. Use the portletId to show/hide the message display.


 


3. Masking with Custom Message in Portlet :
Change that message key in your portlet's language.properties file with your custom text.
Like, in the language_en.properties file for your custom portlet. add the custom message to the key:

   you-have-entered-invalid-data=Server Error: Please try again. 


4. Using CSS property:
Hook the file end.jsp (at html\taglib\ui\error\end.jsp ) with a surrounding CSS.


in the custom CSS of your portlet add

   .portlet-msg-error-invalid-data-show-hide{
     display : none;
   }

Tuesday, July 16, 2013

Enable Transactional cache in Liferay

Show / Hide Lookand Feel Icon on a Liferay portlet

The property 'portlet.css.enabled' must be added to the Portal-ext.properties file.

If made true,

portlet.css.enabled=true

# shows the 'Look and Feel' icon on the portlet titlebar. Enabling the user to edit it.This is default.

If made false,

portlet.css.enabled=false

# hides the 'Look and Feel' icon on the portlet titlebar . Disabling it can speed up the portal performance.

My Blog List