Monday, February 21, 2011

Enable OpenOffice in liferay

To enable document conversion in the Document Library portlet, follow the instructions bellow:

For Windows user


1)      Install OpenOffice.org v2.0.3 or higher (has been tested on many versions, include 3.2).
2)      Go to the folder where it was installed (for example, C:\Program Files\OpenOffice.org\program) and start OpenOffice service with the following command:
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard


For Linux user
1)      Goto Openoffice installing path.From command prompt type this line
 "cd /usr/lib/openoffice/program"

  2)   Same command prompt copy & paste this code
"sudo soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless –nofirststartwizard"

In latest linux we need run this commend with user name ubuntu 10.4 + use this code it will ask password give your root user password..
"sudo -H -u root /usr/lib/openoffice/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard"


For Mac user


1)      If you are running on Mac OS X, then you should run the following from the Terminal program (note that this is assuming you are running Open Office and it is installed in your /Applications directory.
/Applications/OpenOffice.org.app/Contents/MacOS/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless
In liferay GUI


2)      Go to control panel then click on the Server Administration tab, then OpenOffice tab. Click on enable, in case OpenOffice is listening to a different port change the it accordingly.

Places where this integration is used.

1)      Document Library portlet
You should see this when you View a document in Document Library, click on the desired conversion.

2)      Web content Display
You should see this when you click configuration select which are the format guest could download. Then click save button show the option to guest.

Sunday, February 20, 2011

Display hidden childs page in Liferay Footer

Step1. Add these lines into portal_normal.vm under this path your_theme/docroot/_diff/templates. (for importing bottom navigation files)
Add this inside the footer div  
#if ($has_navigation)
           #parse ("$full_templates_path/bottom_navigation.vm")
     #end
Step2. Create bottom_navigation.vm under this path  your_theme/docroot/_diff/templates
<table width="100%">
     <tr>
           <td>
                #set($layoutLocalServiceUtil = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
                #set($topPublicLayouts = $layoutLocalServiceUtil.getLayouts($layout.getGroupId(),false))
                #foreach ($lay_item in $topPublicLayouts)
                     #if ($lay_item.isHidden())
                           #if ($lay_item.getFriendlyURL() == "/footer-links")
                                <div id="footer-links">
                                     #foreach ($child in $lay_item.getChildren())
                                           <a href="$company_url$child.getFriendlyURL()">$child.getName()</a>
#end   
                           </div>
                           #end
                     #end    
                #end 
          </td>
    <tr>
</table>
Note: Here we are using pages is footer links as hidden parent page, based on your requirement you need charges this line. You need put your page URL.
 #if ($lay_item.getFriendlyURL() == "/footer-links")
Step3. Add these lines into custom.css under this path your_theme/docroot/_diff/custom.css
/**************** Footer Links *******/
/**************** Based on your requirements changes colors *******/
#footer{
      border-top:1px solid #DDD;
      text-align:left;
      margin:0auto;
      max-width:960px;
      margin-top:10px;
}
#footer-linksa,#footer-linksspan {
      color:#2A72C9;
      text-decoration:none;
      font:normal12px 'Lucida Sans Unicode','Lucida Grande',Tahoma,sans-serif;
      padding:2px0px;
}

#separator{
      height:13px;
      margin:0px8px;
      padding:2px0px;
      border-right:1pxdotted #ccc;
}
#footer-linksa:hover{
      text-decoration:underline;
}
Step4. Then ant deploy fromyour theme level