Search This Blog

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

Set JAVA_HOME variable in Windows



 Find Install Directory

Look for the install path for the Java or Software Development Kit(SDK), to find the installation path do the following:
  1. JDK (Java Development Kit) during default installation, are kept in a directory under C:\Program Files\Java. If it is not there we need to find it on the system.
  2. At the path, there will be a sub-directory like jdk1.6.0_03.

    So, the installation path is  C:\Program Files\Java\jdk1.6.0_08.

 Apply Setting

Once you have found the JDK (Java Development Kit) install path:
  1. Right click on the "My Computer" icon on your desktop and select "Properties".
  2. Click the "Advanced" Tab
  3. Click the "Environment Variables" button
  4. In the  "System Variable" tab, click "New"
  5. Enter the variable name as "JAVA_HOME"
  6. Enter the value as the installation path for the Development Kit
  7. Click "OK" button.
  8. Click "Apply" Changes 

  Check JAVA installation

  1. Click on the "Start" button.
  2. Type in "cmd" in the search bar. Press "Enter" button on the keyboard.
  3. The command prompt must open up. Enter the command "java-version" in it.
  4. It must come up with the java details installed on the system.

Translate Liferay in Your Language.(Pootle)



Now, it is your opportunity to translate Liferay in your own language. Liferay has started a forum for the ardent Liferay lovers to collaborate and translate the entire portal in their own language. This helps the community to customize and present their products with their own liking in their own language. The translate project also shows the percentage of completion of the entire project for each language. Here are two snapshots of the project updated to 30th Sept 2013.




 Liferay Translate or Pootle Here is the link to the project:- http://translate.liferay.com/pootle/ The project can also be accessed through the menu on our home page. Happy Translating Liferay!!

Wednesday, September 11, 2013

Add "HTTPOnly" and "Secure" attribute to Cookie for Liferay

Here are the ways
---------------------------
Secure Attribute
Writing a servlet filter to overwrite the session cookie:

private void rewriteCookieToHeader(HttpServletRequest request, HttpServletResponse response) {
if (response.containsHeader("SET-COOKIE")) {
String sessionid = request.getSession().getId();
String contextPath = request.getContextPath();
String secure = "";
if (request.isSecure()) {
secure = "; Secure";
}
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid
+ "; Path=" + contextPath + "; HttpOnly" + secure);
}
}
------------------------

HTTPOnly Attribute

Go to Tomcat conf/context.xml file ,add

restart tomcat.

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. 






My Blog List