SlideShare a Scribd company logo
In thisdocumentationyouwill understand
all the features and functionalities of
Liferay, Social Office and Social
Networking so that it will help in
collaboratingusersand organization in an
efficient and easy way.
Liferay
With Social Office & Social
Networking
Shikhar Saran Srivastava
shikhar.447@rediffmail.com
8339041831
http://shikhar.honor.es
Table of Contents
1. Purpose…………………………………………………………………………………………………………………….5
2. Liferay Portal…………………………………………………………………………………………………………….5
3. What is LiferayPortal CE?.…………………………………………………………………………………………5
4. Installationand Setup…………………………………………………………………………………………….5-6
5. After Downloading/Obtainingwhat to do?.................................................................6
6. UsingLiferay SetupWizard………………………………………………………………………………….…6-7
7. Usingthe Control Panel……………………………………………………………………………………….…7-8
8. What is Social Office?..................................................................................................8
9. InstallingSocial Office………………………………………………………………………………………….…8-9
10. Login into Social Office………………………………………………………………………………………….9-11
11. Installationof Social Office inside LIferayPortal…………………………………………………….…11
12. 2nd
Way ofInstallation ofSocial Office inside LiferayPortal………………………...….…...11-12
13. InstallingSocial Networking……………………………………...………………………………………...12-13
14. Liferay Featuresand Functionalities…………………………………………………………….…...….….13
14.1 Users………………………………………………………………………………………………...………………14
14.1.1 Usersand Organizations……………………………………………………...…………….14-15
14.1.2 UserGroups……………………………………………………………………………….……...15-16
14.1.3 Roles……………………………………………………………………………….……………………...16
14.1.4 Password Policies……………………………………………………………………………...……17
14.1.5 Monitoring………………………………………………………………………………………...…...18
14.2 Sites…………………………………………………………………………………………………….…………...18
14.2.1 Sites………………………………….……………………………………………………….…….18-29
14.2.2 Site Template……………………………………………………………………………...…………30
14.2.3 Page Template…………………………………………………………………………...………….30
14.2.4 Site Content……………………………………………………………………………………...30-31
14.2.5 Creatingthe Site Pages……………………………….…………………………….…………...31
14.2.6 Portlets…………………………………………………………………………………………….31-32
14.2.7 Page Permission……………………………………………………………………….……...32-33
14.3 Apps………………………………………………………………………………………………………………...33
14.3.1 App Manager………………………………………………………………………...…………33-34
14.3.2 Store………………………………………………………………………….…………………………34
14.3.3 Purchased……………………………………………………………………….……………………34
14.3.4 PluginsConfiguration………………………………………………………...…………….35-36
14.3.5 License Manager………………………………………………………………………...………...36
14.3.6 OpenSocial Admin…………………………………………………………….…………….36-37
14.4 Configuration………………………………………………………………………………….………………37
14.4.1 Portal Settings………………………………………………………………...………………37-40
14.4.2 Custom Fields……………………………………………………………...………………….40-42
14.4.3 ServerAdministration…………………………………………………………………….42-46
14.4.4 Portal Instances………………………………………………………………….………….46-47
14.4.5 Social Office Configuration………………………………………………………………….47
15. Social Office CE………………………………………………………………………………………….………….47
15.1 What is Social Office?......................................................................................47
15.2 What’sthe difference betweenLiferayPortal and LiferaySocial Office…….47-48
15.3 Social Office PluginsAvailable……………………………………………………………...….48-49
15.4 UsingLiferay as a Social Platform………………………………………………………...….49-51
15.5 How to Use Social Office?..............................................................................51
15.5.1 My Dashboard……………………………………………………………………….……...51-52
15.5.2 CreatingCommunities……………………………………………………….…….……52-53
15.5.3 Descriptionof pre-definedpages…………………………………….…………………53
15.5.3.1 Dashboard………………………………………………………...…………….53
15.5.3.2 Calendar………………………………………………………………...……….54
15.5.3.3 My Documents…………………………………………………………….54-55
15.5.3.4 Forums……………………………………………………………….………...….55
15.5.3.5 Blog………………………………………………………….………………...55-56
15.5.3.6 Wiki………………………………………………………….………...…………...56
15.5.3.7 Contacts Center……………………………………….………….……...56-57
15.5.3.8 Chat……………………………………………………….……….…….………...57
15.5.3.9 Messages………………………………………………….…...…….……57-58
16. WokingSmart with LiferaySocial Office………………………………………………………….58-59
17. Upgradingyour LiferaySocial Office Version………………………………………………...……...59
17.1 Upgradingfrom Social Office version2.x to 3.x……………………………….…………...59
17.2 Upgradingfrom Social Office 3.0.0. to 3.0.1…………………………………………………60
18. Some Out of the Box Features…………………………………………………………………………….60
18.1 AccessingLiferay Services………………………………………………...……………….……….60
18.2 Beanshell…………………………………………………………………………………….………….60-61
18.3 Groovy………………………………………………………………………………………………………...61
18.4 JavaScript……………………………………………………………………………………………….61-62
18.5 Ruby…………………………………………………………………………………………….……………...62
18.6 Python………………………………………………………………………………………………….…….62
19. Authoring the basic content……………………………………………………………………...………...62
19.1 CreatingContent the simple way………………………………………………………………...63
19.2 RICH, WYSIWYG Editing…………………………………………………………….…………...63-66
19.3 Creatinga displaypage……………………………………………………………….…………66-68
20. ConfiguringAdditional PortletSettings………………………………………………………………68
20.1 USERS……………………………………………………………………………………………………68-69
20.2 Mail host names………………………………………………………………………………………...69
20.3 E-Mail Notifications……………………………………………………………………….……...69-71
20.4 ContentSharing……………………………………………………………………………….………...71
20.5 Identification………………………………………………………………………………………….….71
20.6 Miscellaneous:DisplaySettings………………………………………………...………….71-73
21. ConfiguringLiferayfor high availability…………………………………………………….……….73
22. Integrating ExistingUsersinto Liferay………………………………………………………….……73
22.1 LDAP…………………………………………………………………………………………………....74-80
22.2 OpenSSO…………………………………………………………………………………………………...80
22.3 Authentication:Central AuthenticationService (CAS)…………………….…….80-81
22.4 Authentication:Facebook…………………………………………………………………….……81
22.5 Authentication:NTLM……………………………………………………………………………81-82
22.6 Authentication:OpenID………………………………………………………….……………….82
22.7 Authentication:OpenSSO…………………………………………………………………….82-83
23. UsingScripting for AdvancedFlexibility……………………………………………….…………….83
24. UsingLiferay Portal as A Collaborative Platform…………………………………….………84-85
25. Manual Configurationfor SendingMails…………………………………………………….….85-86
26. Running Scripts from the control panel………………………………………………………….86-88
27. Extendingand CustomizingLiferayfor your own needs………………………………………88
Purpose
The purpose of thisdocumentisto equipthe readerwiththe basicsetuprequiredbefore youstart
the basic setuprequiredbefore youstartthe developmentforthe Aakari3 InternshipProgram.As
far as possible there are linksandimagesshowninthe document,however due toversionupdates
there mightbe some differenceswhichwillhave tobe managedbythe reader.If there is anykindof
difficultyfacedpleasepostittoi3-internship-discuss@aakaronline.com .
Liferay Portal
LiferayPortal isan enterprise webplatformforbuildingbusinesssolutionsthatdeliverimmediate
resultsandlong-termvalue.
What is Liferay Portal CE?
LiferayPortal CE isthe opensource versionof Liferay'senterprise webplatformforbuildingbusiness
solutionsthatdeliverimmediate resultsandlong-termvalue.Itstartedoutasa personal
developmentprojectin2000 and wasopensourcedin2001.
Since then,LiferayPortal CE'spopularityhasskyrocketed,boastingover4milliondownloadsinits
lifetimeandwide acclaimfromindustryexpertstodeveloperstobusinessusers.
The projectis still thrivingwithavibrantcommunityof over45,000 thatcontributestothe growth
and developmentof the platform.
Installation and Setup
LiferayPortal isone of the mostflexible applicationsonthe markettodaywithregardto application
serverenvironments.Youcan install LiferayPortal oneverythingfromasharedTomcat installation
to a multi-node clusterrunningacommercial applicationserverandoneverythinginbetween.In
fact, Liferayisusedsuccessfullyinall of these scenarioseveryday.
You’ll findthatbecause Liferayisextremelyflexible initsdeploymentoptions,itiseasytoinstall as
well.If youalreadyhave anapplicationserver,youcanuse the toolsfordeploymentthatcame with
your applicationserver.If youdon’thave anapplicationserver,Liferayprovidesseveral application
serverbundlesfromwhichtochoose.These are veryeasytoinstall andwitha small amountof
configurationcanbe made intoproduction-readysystems.
The CE versionof Liferayisfreelydownloadable fromourwebsite at http://www.liferay.com.Click
the Downloads linkatthe topof the page andyou are presentedwithmultipleoptionsforgettinga
copy of Liferay,includingourconvenientbundlesora.war package for installationonyour
applicationserverof choice.
The EE versionof Liferayisprovidedtoyouasa resultof yoursupportsubscription.Everythingyou
needisprovidedinthe CustomerPortal,includingdownloadlinksthatallow youtoobtaina copy of
a Liferaybundle ora .war package for installationonyourapplicationserverof choice.
So whatis a bundle anyway?A bundle isanopensource applicationserverwithLiferaypreinstalled.
Thisis the mostconvenientwaytoinstall Liferay.Liferayisbundledwithanumberof opensource
applicationservers;all youneedtodois choose the one that bestfitsyourneeds.If youdon’t
currentlyhave anapplicationserver,youmaywantto start withthe Tomcat bundle,asTomcatis
one of the smallestandmoststraightforwardbundlestoconfigure.If youhave anopensource
applicationserverpreference,choose the serveryoupreferfromthe available LiferayPortal
bundles.All of the bundlesshipwithaJavaRuntime EnvironmentforWindows;if youare usinga
differentoperatingsystem,youwill needtohave a JDK(Java DevelopmentKit) installedpriorto
launchingLiferay.
Please note thatLiferayisnotable to provide applicationserverbundlesforproprietaryapplication
serverssuchas WebLogicor WebSphere,becausethe licensesforthese serversdon’tallow for
redistribution.LiferayPortal,however,runsjustaswell onthese applicationserversasitdoeson
opensource applicationservers.A .warfile anddependency.jarsare providedforproprietary
applicationserversand you’llneedtofollow aprocedure toinstall Liferayonthem.
After Obtaining/Downloading what to do?
1. Extract it to a particularlocation.
2. There are 2 ways to runthe tomcat server,checkoutboth:
3. Before runningityouhave to setupjavaenvironmentinyoursystem.
4. For that downloadjavafromthe java.com.
5. NowRightclickon the This PCicon onthe DesktopandGo to Properties->AdvancedSystem
Settings->EnvironmentVariables…
6. Clickon New…->Give name JAVA_HOME->Thengive the directorypathof java.
Example:C:ProgramFilesJavajdk1.7.0_25
7. Clickon New…Again->Give name CATALINA_HOME->Thengive the directorypathof Liferay
Tomcat directory(where youhadextractthe Liferay).
Example:D:liferay-portal-6.2-ce-ga5tomcat-7.0.62
8. Nowthere are 2 waysto run Liferay:
9. Go to cmd (CommandPrompt) &type commands:%CATALINA_HOME%binstartup.batrun
10. Go to extractedLiferaydirectory:liferay-portal-6.2-ce-ga5->tomcat-7.0.62->bin->startup.bat
11. It will take about5minto start the serverafterthat go to yourbrowserand type:
localhost:8080
NowYour Liferayisreadyto use.
Using Liferay Setup Wizard
To make it easyto configure Liferayoptimallyforyouruse,the firstthingyousee whenbrowsingto
your newlyinstalledLiferaybundleisasetupwizard.Thisgivesyoua convenientwaytoconfigure
Liferayforyour purposes.
There are three sectionsof the wizard:the portal,the administratorandthe database.Forthe
portal,youneedto supplythe followinginformation:
Portal Name: the name of the website you’re poweringwithLiferay.Inthisbook,we’llbuildasocial
networkforyournose.This site iscalledNosestersowe’ve suppliedNosesterinthe screenshot
below.
DefaultLanguage: choose the defaultlocale where yoursite resides.
For the administrator,youneedtosupplythe followinginformation:
First Name:the firstname of the user that hasthe administratoraccount.
Last Name:the lastname of the userthat has the administratoraccount.
Email: the email addressof the userthat has the administratoraccount.
LiferayisReadyto use Now.(Don’t change the username:test@liferay.com& Password: test)
Using The Control Panel
Reach the control panel byclickAdmindropdown:Admin->Control Panel. The Control Panel is
organizedinfourmainareas:Users, Sites,Apps,andConfiguration.The optionsinthe Configuration
sectionof the Control Panel categoryinclude configurationoptionswhichcontrol how the portal
operatesandintegrateswithothersystemsyoumayhave.Inthistopic,we’ll coverthe following
topics:
 Portal settings,suchasuser authenticationoptions,mail hostnames,emailnotifications,
identificationsettings,anddisplaysettings
 Customfields
 Serveradministrationoptions,includingoptionsforresources,loglevels,properties,
CAPTCHA,datamigration,file uploads,mail,external services,scripts,andshutdown
settings
 Portal instances
Afteryouhave createdusers,usergroups,organizations,roles,sites,andteamsyourportal will be
readyto host contentandapplications.Youcanconfigure Liferay’sportal settingstofityour
environmentandyourparticularportal project.It’seasyto adjustconfigurationsettingsusingthe
portlet-drivenuserinterface of Liferay’Control Panel.Let’sstartbyexaminingLiferay’sPortal
Settings.
What is Social Office?
Introduction
Social Office isateam workspace productthatcombinescollaborationandsocial networking
featuresina single package designedforenterprises.Itisanend-usersolutionwithaspecific
functionandpurpose outof the box.Ithas beenbuiltusingLiferay Portal asitsfoundation.
Use Case
 SharedWorkspacesforoffice teamstocollaborate.
 Documentsharing.
 Social networkinginanenterprise(Enterprise socialcomputing).
Installing Social Office
Here are some quickinstructionsonhow toinstall LiferaySocial Office v1.X. Thisis specificallyfor
windowsbutitwill alsorunon otheroperatingsystems.
If you wantto install Liferay2.0,please refertothe userguide:
http://www.liferay.com/documentation/social-office/2.0/user-guide
Windows
1. Downloadandsave the desiredbundle from
http://www.liferay.com/web/guest/downloads/social_office
2. Double click the icon on the desktop and install Social Office using all default values.
3. Once it is installed, click start then programs then Liferay social office and then start in order
to run social office.
Login
1. When prompted,signinusingthe defaultuseridandpassword.
. userid: admin
. password:admin
2. You will be askedtochoose a passwordreminder.There isalsoanoptiontocreate yourown.
1. You are thentakento the home page and can begincollaboratingusingall of the great
features!
This was the installationof Social Office outside the Liferayportal.
Installation of Social Office Inside Liferay
Portal
1. Go to Control Panel.
2. Clickon Store
3. Inside Store SearchSocial Office.
4. Clickon Social OFFICECE.
5. Purchase itfrom marketplace.
6. AfterpurchasingitGo to Control Panel->Purchased
7. Inside PurchasedSelectSocial Office CEandinstall it.
8. Afterthat Go to Control Panel->Social Office Configuration.
9. Here Selectthe userYou wantto assignthe Social Office toforfirsttime usersassignitfor
Joe Blogs(Admin).
10. ClickSave & Nowyou can enjoysocial office.
2nd way of Installing Social Office inside
Liferay Portal
1. Go to https://www.liferay.com
2. Go to marketplace andsearchSocial Office CE.
3. Afterfindingitpurchase it,goto purchased& itwill take toyou to the Social Office page
where youcan downloadlatestversionof Social Office.
4. A SocialOffice.lpkgwillbe downloadedtoyoursystem.
5. Nowgo to yourcontrol panel of Liferayandthengo to AppManager.
6. There youwill see install tabthere youjustuploadthe downloadedSocialOffice.lpkg.
7. Wait 1 min andthendo the step8-10 of above processes.
Installing Social Networking
What is Social Networking?
Since the first social networks rose to popularity, concepts such as Friend and later Like–
previously reserved for direct human interaction–have taken on new meaning in an always-
online, information driven culture. It could be argued that social networks have transformed
the way people interact with their friends, relatives and colleagues. Friends, connections,
followers, circles and lists have enabled people to connect and stay connected in ways
they’d never been able to before. Initially, these concepts proved to be highly successful for
casual web sites but they didn’t take to the business world as quickly. But many
organizations are now realizing the importance of leveraging social interactions for more
than just recreation. Liferay’s robust social features make it a great platform for business
web sites, casual web sites and everything in between.
Social applications have many differences when compared to Standard applications that are
vital to a social networking site. Standard applications have general and user specific data,
whereas social applications can share data within a defined network. This variation is a huge
advantage when trying to communicate important information to a large group of people.
This difference in communication settings is illustrated below:
Figure 6: The graphic above demonstrates Standard Apps vs. Social Apps.
Liferay has a constantly improving set of social features which enable you to encourage
social interactions on your own portal and to leverage the power and popularity of other
social networks. In this topic, we’ll discuss:
 General use social portlets
 Social portlets for personal pages
 Configuring personal pages for social networking
 How to connect users using Liferay social relations
 Social equity
 Integrating Liferay with other social sites
When we’re finished, you’ll be well equipped to use Liferay to power your social network.
Installing Social Networking
Same as 2nd
wayof Social Office CE.
SearchSocial NetworkingCEinsteadof Social Office CE.
Liferay Features and Functionality
Go to Control Panel youwill see 4options:
1. Users
2. Sites
3. Apps
4. Configuration
NowI will give the tourof all functionalities LiferayOffers:
1. Users
1.1 Users and Organizations
In the figure youcan see there are 3 tabsbrowse,All Organizations,All Users.
Inside the browse tabClickonAdddropdown& choose the optionyouwantto
add: Like Useror RegularOrganization
If you choose User, it will take youtothe new page:
Enter the Detailsandclicksave the userwill be addedinthe portal.
If you choose RegularOrganization, itwilltake youthe new page:
Enter the details andthe Organizationwill be added.
In the browse sectionyoucansee addedUser andOrganizationsyouhave added.
The 3rd
optionExportUsers will generate the userslistinthe excel sheet(.csv)format.
1.2 User Groups
User groupsprovide away to groupusersindependentlyof the organizationsto
whichtheybelong.Administratorscandefine ausergroupand assignthe user
groupas a memberof a site to make all of its user’smembersautomatically.
Clickon Additwill take youthe new page:
Afterenteringthe details, the usergroupwill be created.
1.3 Roles
Rolesare groupingsof usersthat share a particularfunctionwithinthe portal,
accordingto a particularscope.Administratorscanaddroleswhichcan be
grantedpermissionstovariousfunctionswithinportletapplications.
You can add a newRolesaccordingto yourneedbutthere isno needof adding
roles,predefinedrolesare sufficient.
In orderto change or editany permissionof rolesclickonActionsoption youcan
change accordingto your need.
1.4 Password Policies
Passwordpoliciesdefine enterprise level securitymeasureswhichinclude user
lockoutandpasswordexpiration.Administratorscandefine policiesordelegate
to an LDAP server.
DefaultPassword isgivenasyoucan see inthe figure.
You can add newpasswordpolicyif there isrequirement.
Or you can change existingDefaultPasswordPolicybyclickingActionsoption:
You can change the passwordpolicyaccordingtoyourneedyouwant inthe
LoginProcess.
1.5 Monitoring
Monitoringallowsyoutosee all of the live sessionsinthe portal.For
performance reasons,thissettingisgenerallyturnedoff inproduction.
2. Sites
2.1 Sites
Sitesare a set of pagesthat displaycontentandprovide accessto specific
applications.Sitescanhave members,whichare givenexclusiveaccessto
specificpagesorcontent.
Withmost products,youwouldlearnwhatthe software cando interms of
settingupyourusersand securitymodel andthenstartbuildingyoursystem.
You’ddesignyourinfrastructure andgetyourserverenvironmentupand
runningwhile yourdeveloperswritethe applicationsthatlive onyourwebsite.
WithLiferayPortal,however,youstartfartherahead.LiferayPortal ismore than
justa containerforapplicationswitharobustsecuritymodel.Italreadyincludes
manyof the applicationsyou’llneed,outof the box,readyto goand integrated
withall the usermanagementandsecurityfeaturesyou’ve alreadylearned
about.
Nearlyall Liferayusers use Liferay’sWebContentManagementsystem(WCM).
Afterall,all everywebsite hascontentthatneedstobe managed.Liferay’s
WCM empowersyoutomanage all the contentonyour site quicklyandeasily
withinyourbrowser.Beyondmanagingexistingcontent,LiferayWCMletsusers
easilycreate andmanage everythingfromasimple article containingtextand
imagestofullyfunctional websites.Webpublishingworksalongside Liferay
Portal’slargercollectionof applications,whichmeansyoucanaddshoppingcart
functionality,visitorpolls,webforms,sitecollaborationtoolsandmore.
Everythingisdone withourcollectionof easy-to-use toolswithfamiliarrich-text
editorsandan intuitive interface.
In thissectionwe’ll coversome basicaspectsof LiferayWCM,including:
Page Types
Layouts
Page andcontentpermissions
Importingandexportingcontent
Contentcreationandediting
Contentpublishing
WCM Workflow
By the time we’re done,youshouldbe able toapplyall these conceptstoyour
owncontent.To demonstrate Liferay’sContentManagementfeatures,we’ll
create and manage contenton the portal for Nose-ster,anew social network
where people are connectedbasedonwhattheirnoseslooklike.
For creatingsitesclickonAddbutton& choose whattype of site youwant to
create:
Let’stake a example of creatingaBlankSite:
Enter the relevantdetailsandclickonsave page
Creating and Managing Pages
You have a fewoptionsforaccessingthe page creationinterface.Tosimplifythis,we’ll
coverthe Dockbar’s Managemenuslightlyoutof order.There are twointerfacestobe
aware of: Site Pages andPage.You can get to these frommultipleplaces.Dependingon
whatyou’re editingandwhere youare onthe portal,you’ll use eitherthe Managemenu
or the Control Panel towork withyourpages.Fromthe Control Panel,make sure you
have the correct site selectedinthe contextmenuselectorandclickthe Site Pages link
inthe contentsection.If you’ve alreadynavigatedtothe site youwishtomanage,click
Managefromthe Dockbarand select Site Pages.Thisisthe exactsame interface yousee
inthe Control Panel.Tomanage the specificpage of the site you’ve navigatedto,click
ManageandselectPage.
For convenience,youcanalsonavigate tothe Sitespage underthe Portal sectionof the
Control Panel andclick Actions → ManagePages.Toquicklyaddasingle page while to
the site you’re browsing,click Add fromthe Dockbarandselect Page.Justentera name
for the page and it’saddedimmediately.Clickthe name of the page inthe navigation
menuto visititandstart workingon it.
Site Pages isan interface toview existingpages,create new pages,view pagesand
exportor importpagesusingLiferayArchive (LAR) files.Note thatyoucanswitch
betweenmanagingasetof pagesand managinga single page usingthe left-handside
navigationmenu.Clickon PublicPages orPrivate Pages tomanage the groupor clickon
an individualpage tomanage justthat one.Switchingviewslike thischangesthe listof
available tabstothe right.By default,liferay.com, whichwe renamedtonosester.com,
containsa single publicpage called Welcome.
Liferay’spage groupsare alwaysassociatedwithsites.Evenusers’personalpagesare
part of theirpersonal sites.All pagesbelongtoone of twotypesof page sets:public
pagesand private pages.Bydefault,publicpagesare accessible toanyone,even non-
loggedinusers(guests).Private pagesare accessible onlytouserswhoare membersof
the site whichownsthe pages.Thismeansthe private pagesof an organization’ssite
wouldonlybe viewable bysite membersandmembersof the organization.
Regardlessof whetherthe pagesare publicorprivate,Liferayusesthe same interface to
manage them.Let’slookat thisinterface more closely.
More Page Management Tools
From the Manage Site Pagesdialogbox,youcanadd a page to the site byclickingthe
Add Pagebutton.Because PublicPages isselectedonthe left,clicking Add Pagehere
adds a top level page nexttothe Welcome page.Youcan, however,nestpagesas
deeplyasyoulike.Tocreate a sub-page underthe Welcome page,selectthe Welcome
page firstand thencreate your page.If youlater decide youdon’tlike the orderof your
pages,youcan drag and drop theminthe listto put theminwhateverorderyouwant.
Let’sgo aheadand add anothertoplevel page andname it Community.We’ll use this
page for the RecentBloggersandWiki portlets.
Whenyoucreate a newpage,youcan create eitherablankpage or a page prepopulated
withportletsfroma page template.Whenyou’re enteringthe name of the page,you
can selectfroma listof page templates thatare currentlyavailable.Toview the pages
once you addthem,clickthe View Pages button.Thisishow you’dpopulate yourpages
withcontentandapplications.
If you’re usingthe Manage Pagesinterface tocreate a new page,you’ll have some
additional optionstocreate differenttypesof pages.There are PortletPages,Panel
Pages,EmbeddedPages,URL Pagesand Link to Page. By default,all pagesare created
as portletpagesbutin some situationsyoumightwanttouse one of the otheroptions.
PortletPages are the pageswe’re usuallytalkingabout.Theyhave alayoutwhichyou
can drag and drop portletsinto.Mostof the pagesyoucreate will be portletpages.
Panel Pages can have any numberof portletsonthem, asselectedbyanadministrator,
but onlyone will be displayedatatime.Usersselectwhichportlettheywanttouse
froma menuonthe leftside of the page and the selectedportlettakesupthe entire
page.
EmbeddedPages displaycontentfromanotherwebsiteinside of yourportal.An
administratorcanseta URL frominthe page managementinterface andthatpage will
appearin the contextandwithinthe navigationof yourLiferayportal.
URL Pages are justredirectstoany URL specifiedbyanadministrator.Youcanuse URL
pagesto create linkstopagesbelongingtoothersitesof yourportal or to pagesof an
external site.Use URLpagescautiouslysince blindredirectscreate apooruser
experience.
Link to Page createsa portal page whichfunctionsasan immediateredirecttoanother
page withinthe same site.Youcan selectwhichpage tolinkto froma dropdowninthe
page managementinterface.Youcoulduse a Link to Pageto place a deeplynestedpage
inthe primarynavigationmenuof yoursite,forexample.
Once you’ve created pagesandpopulatedthemwithcontent,Liferayprovidesawayfor
youto back themup to separate files.Let’sseehow thatworks.
Backing Up and Restoring Pages
Nexttothe Add Pagebuttoninthe Manage Site Pagesscreenare twobuttonslabeled
Exportand Import.The Exportbuttonexportsthe pagesyoucreate intoa single file,
calleda LAR (LiferayArchive).Youcanthenimportthisfile intoanyserverrunning
Liferaytore-create the pages.If youhave a LAR youwouldlike toimport,use the Import
button.ExportingandImportingLARsisa great wayto take contentfromone
environment(say,adevelopmentorQA environment)andmove itall inone shotto
your productionserver.Note thatyoushouldnotmake thisaregularoccurrence.If you
wantto regularlymove pagesfromone servertoanother,youshoulduse Liferay’s
stagingenvironment.
LARs are also a goodway to back up yoursite’scontent.Youcan exportthemtoa
specificlocationonyourserverwhichisbackedup,andif you everhave torestore your
site,all youneedtodo isimportthe latestLAR file.One limitationonLARfiles,however,
isthat theyare versiondependent,soyoucan’tuse an exportfroman oldversionof
Liferayandimportit intoa newerversion.
Let’sbe good administratorsandexportaLAR file forbackuppurposes.Clickonthe
Exportbuttonand thenname the file nosesterv1.lar.Use the checkboxestodetermine
whatyou’dlike toexport.Forthisinitial export,selecteverything.Notethatif youselect
the More Options link,the listexpandstoinclude datafrommanyof Liferay’s
applications,includingthe DocumentsandMediaLibrary,Message BoardsandWeb
Content.Youcan also exportthe theme you’re using.
Once you click Export,yourbrowserpromptsyouto save the file.Once youhave the file,
youcan copyit to a backup locationforsafekeepingorimportitintoanotherinstallation
of LiferayPortal.If youmustrebuildorwishtorevertback to thisversionof yoursite,
youcan importthisfile byclicking the Importbuttonfromthe Manage Site Pagesdialog
box,browsingtoitand selectingit.
Next,we’ll lookatthe optionsonthe rightside menu,startingwithLookand Feel.
Customizing the Look and Feel
Whenyouopenthe Manage Site Pagesdialogbox itdefaultstothe Lookand Feel tab.
On thistab,you’re presentedwithaninterface thatallowsyoutochoose a theme for
the current site.Themescantransformthe entire lookof the portal.Theyare createdby
developersandare easilyinstalledusing the LiferayMarketplace.Since we don’thave
any themesbeyondthe defaultone installedyet,we’ll use the defaulttheme forour
pages.
Many themesinclude more thanone colorscheme.Thisallowsyoutokeepthe existing
lookand feel while givingyour site adifferentflavor.Changethe colorscheme fromblue
to greenbyselecting Green underColorSchemes.If younow go back to the site (by
clickingBackto yoursitename.cominthe topleftcornerof the Control Panel),you’ll see
some parts of the page are now tingedina greenishhue.
If you applya color scheme toa setof publicorprivate pagesitis, bydefault,appliedto
each page inthe set.If, however,youopenthe Manage Pagesdialogbox fora particular
page,youcan select Definea specific look and feel forthis page to make the color
scheme applytothispage only.You can use thisfeature tochoose a differentcolor
scheme fora particularpage than the one definedforthe setof publicor private pages
to whichitbelongs.
There are a fewmore configurable settingsforyourtheme.Youcanswitchthe bullet
style betweendotsandarrowsand youcan choose whetherornot to show portlet
bordersbydefault.
Alsonotice themescanapplytoregularbrowsersor mobile devices.Youcouldcreate
anothersite formobile usersattachedtothe http://m.yoursitename.com addressand
serve upa page designedforthe smallerscreensonphones.
The CSS sectionallowsyoutoentercustomCSSthat will also be servedupbyyour
theme.Inthisway,youcan tweaka theme inreal time byaddingnew stylesor
overridingexistingones.
The nextoptionconfiguresthe logothatappearsforyoursite.
Using a Custom Logo
If you wantto use your ownlogofor a specificsite,use the Logotab.Addinga custom
logoiseasy:selectthe Logo tab andbrowse to the locationof your logo.Make sure your
logofitsthe space in the top leftcornerof the theme you’re usingforyourwebsite.If
youdon’t,you couldwindup witha site that’sdifficulttonavigate,asotherpage
elementsare pushedaside tomake wayforthe logo.
In the logotab, youcan also choose whetherornotto displaythe site name onthe site.
If you checkthe box labeled Show SiteName, the site name will appearinthe topright
corner of the page.This optionisenabledbydefaultandcannotbe disabledif they
Allow Site Administratorsto settheir own logo optionisdisabledin PortalSettings.Itis
alsonot available forthe default site–onlynewlycreatedsitesanduserpageshave the
optiontohave the name display.
JavaScript
If you clickon JavaScriptfromthe Site Pagesinterface forapage set(eitherPublicPages
or Private Pages),you’llfindawindow where youcanenterJavaScriptcode the will be
executedatthe bottomof everypage inthe site.If your site’stheme usesJavaScript(as
isusuallythe case),it’sbesttoadd customJavaScriptcode to the theme and notinthis
window.Thisway,all of yoursite’sJavaScript code remainsinone place.
Usingthe JavaScriptwindow of yoursite’sSite Pagesinterface maybe usefulif your
site’stheme does notuse JavaScript.Inthiscase,the JavaScriptwindow of yoursite’s
Site Pagesinterface will contain allof your site’s JavaScriptandyoucan add some
dynamicfeaturestoyoursite’spages.
Next,let’slookatanadvancedfeature of the Site Pagesinterface:mergingthe current
site’spageswiththe pagesof the defaultsite.
Advanced
If you clickon Advanced fromthe Site Pagesinterface forapublicpage set,you’ll findan
optiontomerge the publicpagesof your portal’sdefaultsite withthe publicpagesof
the current site.If youenable thisoption,the pagesof the defaultsite appearinthe
currentsite’snavigationbar,alongwiththe currentsite’spages.Also,the pagesof the
currentsite appearin the navigationbarof the defaultsite,alongwiththe defaultsite’s
pages.This“merging”of pagesonlyaffectsthe listof pagesinthe defaultsite’sandthe
currentsite’s navigation bars.Thisallowsuserstomore easilynavigatefromthe current
site to the defaultsite,andvice versa.Thisoptioncanbe enabledforthe publicpagesof
bothpersonal sitesandregularsites.
Note that this“merging”of pagesisnot a “hard merge”.For example,supposethatthe
site administratorsof twentydifferentsitesonyourportal all enabledthe Mergedefault
site’s publicpages’ option.Wouldthe pagesof all these differentsitesbe mergedinto
each site’snavigationbar?No,thatwouldmake a mess!Instead,the portal keepstrack
of the currentscopeGroupId(the IDof the currentsite) andthe previousscopeGroupId
(the ID of the previouslyvisitedsite).If the Mergedefaultsite’spublic pages optionis
enabledforeitherthe currentsite orthe previoussite,the pagesof the defaultsite are
mergedinthe pagesof the othersite.
For example,suppose thatyourportal hasthree sites:the defaultsite,site A,andsite B.
All three siteshave some publicpages.Site A hasthe Mergedefaultsite’s public pages
optionenabled,siteBdoesnot.Whena userfirstlogsin,he’sdirectedtothe default
site.The scopeGroupIdisthat of the defaultsite andthere isnopreviousscopeGroupId,
so no additional pagesappearinthe defaultsite’snavigationbar.Thensuppose the user
navigatestosite A.Site A hasthe Mergedefaultsite’spublic pages optionenabled,so
the defaultsite’spagesare addedtosite A’snavigationbar.Now if the usergoesback to
the defaultsite,site A becomesthe previoussitesosite A’spagesare addedto the
defaultsite’snavigationbar.If the usernavigatestosite B,no additional pagesappearin
site B’snavigationbarbecause site Bdoesnot have the Merge defaultsite’spublic pages
optionenabled.Andif the usernavigatesbacktothe defaultsite,siteBbecomesthe
previoussite,and,again,since site Bdoesnothave the Mergedefaultsite’s publicpages
optionenabled,noadditional pagesare addedtothe defaultsite’snavigationmenu.
Next,let’sexaminehowtoconfigure individual pages.
Changing Options for Individual Pages
Whenyouselecta single page,some differentoptionsappear.Let’slookatwhatthese
do.
Details:letsyouname the page for anylocalizationsyouneed.Youcan alsosetthe
HTML title thatappearsin the browserwindow forthe page. Plus, youcanset an easyto
remember,friendlyURLfor the page.
SEO: providesseveral meansof optimizingthe datathe page providestoanindexer
that’scrawlingthe page.You can setthe variousmetatags fordescription,keywords
and robots.There’salsoa separate Robotssectionthatletsyoutell indexingrobotshow
frequentlythe page isupdatedandhow itshouldbe prioritized.If the page islocalized,
youcan selectabox to make Liferaygenerate canonical linksbylanguage.If youwantto
setsome of these settingsforthe entire site,youcanspecifythemfromthe Sitemaps
and Robotstabs of the Manage Site Settingsdialogbox (seebelow).
Look and Feel:letsyouseta page-specifictheme.
Layout: letsyouspecifyhow portletsare arrangedona page.Choose fromthe available
installedtemplatestomodifythe layout.It’sveryeasyfordeveloperstodefinecustom
layoutsandadd themto the list.Thisiscoveredmore thoroughlyinboththe Liferay
Developer’sGuide and inLiferay in Action.
JavaScript: givesyouthe abilitytopaste customJavaScriptcode tobe executedonthis
page.
Custom fields:If customfieldshave beendefinedforpages(whichcanbe done fromthe
CustomFields page of the Control Panel),theyappearhere.These are metadataabout
the page andcan be anythingyoulike,suchasauthor or creationdate.
Advanced: containsseveral optional features.Youcanseta querystringto provide
parameterstothe page.Thiscan become useful towebcontenttemplates.Youcanset
a target forthe page so that iteitherpopsupin a particularlynamedwindow orappears
ina frameset.Andyoucanset an iconfor the page that appearsinthe navigationmenu.
Mobile Rule Groups:allowsyouto applyrulesforhow thispage shouldbe renderedfor
variousmobile devices.Youcan setthese upinthe MobileDevice Rules sectionof the
Control Panel.
CustomizationSettings:letsyoumark specificsectionsof the page youwantuserstobe
able to customize.
Note that the Manage→ PageLayout menudirectsyoutothe same Layout tab that’sin
Manage→ Page
Modifying Page Layouts
Page layoutsallowyoutoarrange yourpagesso the contentappearsthe way you want
it to.Liferaycomeswithmanylayoutsalreadydefined.Developerscancreate more and
theycan be deployedtoyourportal for youruse.
To prepare forthe portletswe’llsoonbe adding,let’schange the layoutof the
Collaborationpage.Toaccesslayouts,selectManage→ PageLayout fromthe Dockbar.
Now,selectthe 2 Columns(70/30) layoutandclick Save.Once saved,you’ll returntothe
page and it’ll seemasthoughnothinghashappened.Once we startaddingportlets,
however,you’ll notice the page isnow equallydividedintotwocolumns.Youcanstack
portletsontop of each otherinthese columns.There are,of course,more complicated
layoutsavailable andyoucanplayaroundwiththemto get the layoutyouwant.
Sometimesaparticularlayoutis almostwhatyouwant butnot quite.Inthiscase use the
NestedPortletsportlettoembedalayoutinside anotherlayout.Thisportletisa
containerforotherportlets.Itletsyouselectfromanyof the layoutsinstalledinLiferay,
justlike the layouts fora page.Thisgivesyouvirtuallyunlimitedoptionsforlayingout
your pages.
The nextoptioninthe Managemenuispage customizations.
Page Customizations
Page Customizations are anew feature inLiferay6.2.With page customizations,any
userwiththe appropriate permissionscancreate personalizedversionsof anypublic
page.Before userscancreate personalizedversionsof pages,customizationsmustfirst
be enabledbyanadministrator.Administratorscanactivate ordeactivate
customizationsforanyrowor columnon anypage.Whenuserscustomize a page,they
have the optionto use eithertheirversionorthe defaultversionof apage.Userscan’t
see alternate versionsof pagesotherthantheirown.
Whenan administratoractivatespage customizationsforapage,anyportletsthatare in
a Customizablerowor columncan be movedaroundthe page or removedfromthe
page.Users can add newportletsof theirownchoosingtothese columnsof the page
and can alsocustomize portletconfigurations. If atany time usersdetermine theydon’t
like theircustomizations,theycanclick Reset My Customizations toreverttheirpages
back to the default.
Nowthat youknowhowto enable page customizations,let’slookatthe settingsforthe
site as a whole.
Configuring Site Settings
As withSite Pages,youcanaccess Site Settingsthroughthe Control Panel ordirectly
fromthe site usingthe Dockbar(Manage→ SiteSettings).
You’ll findoptionstospecifydetailsandmetadataaboutyoursite,setupfriendlyURLs
and virtual hosts,configure searchengine optimizationsettings,turnstagingonor off
and specifyaGoogle AnalyticsID.Let’stake a closerlook.
Details:allowsanadministratortochange the descriptionandmembershiptype of a
site andalso to specifytagsandcategoriesforthe site.The membershiptype canbe set
as open,restrictedorprivate basedonthe privacyneedsof the site.Userscan joinand
leave anopensite at will.Tojoinarestrictedsite,auserhas to be addedby the site
administrator.A usercan alsorequesttobe addedthroughthe Sitessectionof the
Control Panel.A private site islike arestrictedsite butdoesn’tappearinthe Sites
sectionof the Control Panel foruserswhoaren’tmembers.
Pages: FromSite Settings,clickon Pages tomanage some basicfeaturesof the pageson
a site.If no pageshave beendefinedyet,youcansetsite templatesforthe publicor
private pages. If pagesalreadyexist,linksare providedtoview them.Youcanalso
change the site’sapplicationadapter,whichisaspecial type of hookpluginthat
customizesoutof the box functionalityforspecificsites.
Site URL: Seta friendlyURLand/or a virtual hostforyour site here.The Friendly URL
optionletsyoumanage the pathto your site inthe portal’sURL. FriendlyURLsare used
for bothpublicandprivate pages.Forpublicpages,the friendlyURLis appendedto
http://localhost:8080/web.Forprivate pages,the friendlyURLis appendedto
http://localhost:8080/group.EachfriendlyURLneedstobe a unique name,of course.
Havinga human-readable friendlyURLassistsindexingbotsandiscritical togood search
engine optimization.
For example,suppose youwere creatingaportal for a bankcalledthe BestBank. If you
setthe friendlyURLof yourportal’sdefaultsite to/best-bank,the URL of your default
site’spublichome page wouldchange to http://localhost:8080/web/best-bank/home.If
your portal’sdefaultsite hadprivate pages,the URL of the defaultprivate home page
wouldchange to http://localhost:8080/group/best-bank/home.
Note that if you’re addingafriendlyURLfor yourportal’shome page,youshouldupdate
your portal’sHome URL fieldsothatpage requeststo http://localhost:8080redirect
properly.Todo this,navigate tothe Portal Settingspage of the Control Panel andfind
the Home URL fieldinthe Navigationsection.Forourbankexample,we wouldenter
/web/best-bank/homeintothe Home URLfield.Once you’ve enteredthissetting,page
requeststolocalhost:8080 will redirecttothe friendlyURLof yourportal’snew
homepage:http://localhost:8080/web/best-bank/home.
VirtualHosts make web navigationmucheasierforyourusersbyconnectingadomain
name to a site.Thistab allowsyoutodefine adomainname (i.e.,
www.mycompany.com)foryoursite.Thiscanbe a full domainora subdomain.This
enablesyoutohosta numberof websitesasseparate sitesonone Liferayserver.
For instance,if we setthisupfor Nose-ster’sDevelopmentNetwork,usersinthatsite
coulduse developers.nosester.comtogettotheirsite,providedNose-ster’snetwork
administratorscreatedthe domainname andpointedittothe Liferayserver.
To setthis up,the DNS name developers.nosester.com shouldpointtoyourportal’sIP
addressfirst.Thenenter*http://developers.noseter.com*inthe Virtual Hosttabfor the
Developerssite.Thishelpsusersquicklyaccesstheirsite withouthavingtorecall an
extendedURL.
Site Template:If you’ve createdthe site fromasite template,thissectiondisplays
informationaboutthe linkbetweenthe site template andthe site.Specifically,youcan
see whichsite template wasusedandwhetherornot itallowsmodificationstothe
pagesinheritedfromitbysite administrators.If you’re notusingsite templatesforthis
site,youcan safelyignore thissection.
Sitemap:letsyousenda sitemaptosome searchenginessotheycancrawl yoursite.It
usesthe sitemapprotocol,whichisanindustrystandard.Youcan publishyoursite to
Yahoo or Google andtheirwebcrawlerswill use the sitemaptoindex yoursite.Liferay
Portal makesthisverysimple foradministratorsbygeneratingthe sitemapXMLforall
publicwebsites.
By selectingone of the searchengine links,the sitemapwill be senttothem.It’sonly
necessarytodo thisonce per site.The searchengine crawlerwillperiodicallycrawl the
sitemaponce you’ve made the initial request.
If you’re interestedinseeingwhatisbeingsenttothe search engines,selectthe Preview
linktosee the generatedXML.
Robots: If you’re usingvirtual hostingforthissite,youcanconfigure robots.txtrulesfor
the domain.The Robotspage givesyouthe optionto configure yourrobots.txtforboth
publicandprivate pagesona site.If youdon’thave Virtual Hostingsetup,thistab is
rather boring.
Staging: enablesyoutoedit andrevise apage behindthe scenes,thenpublishchanges
to yoursite once theyhave beencompletedandreviewed.
Analytics: allowsyoutointegrate yourpageswithGoogle Analytics.Liferayprovides
seamlessintegrationwithGoogle Analytics,allowingyoutoplace yourID inone place,
thenit will getinsertedoneverypage.Thisenablesyoutofocusyoureffortsonbuilding
the page,rather thanrememberingtoputthe code everywhere.Google Analyticsisa
free service whichletsyoudoall kindsof trafficanalysisonyoursite soyoucan see who
visits,where visitorsare fromandwhatpagestheymost oftenvisit.Thishelpsyou
tweakyoursite so youcan provide the mostrelevantcontenttoyourusers.
Nowthat youknowhowto configure sites,let’slookatpage templatesandsite
templates.
2.2 & 2.3 Site Templates & Page Templates
Site Template
Site Templatesallow youtodefine pagesandwebcontenttoinclude when
creatingsites.Administratorsmaydefine andeditsite templatesaswell astheir
permissions.
Page Template
Page Templatesallow youtoselectapage to use and portletstobe included
whencreatinga page.Administratorsmaydefine andeditpage templatesas
well astheirpermissions.
PageTemplates and Site Templates are invaluable toolsforbuildingsimilar
pageson largerportals.Asyou continue toaddpagesto sitesinyourportal,
you’ll notice repeatablepatternsinthe designsof those pages.Page templates
enable youtopreconfigure asingle page andthenapplyittoany new page you
create.Site Templatesallowyoutodo the same thingbuton the scale of a site–
if you have multiplesitesthatuse asimilarstructure of pages,youcan create a
single site template anduse ittocreate as manysitesasdesired.
Site Content
Liferay6.1 makesit easiertoaccessWeb Contentmanagementwithoutusing
the Control Panel.Youcan now click Manageandthen Site Contenttoaccess
the same Web Contentcontrolsfeaturedinthe Control Panel rightfromyour
portal page.
You can manage the followingkindsof content:
 RecentContent
 WebContent
 DocumentsandMedia
 Bookmarks
 Calendar
 Message Boards
 Blogs
 Wiki
 Polls
 Software Catalog
 Tags
 Categories
 Social Activity
 DynamicData Lists
Creating the Sites Pages
There are a lotof otherthingsyoucan do beyondplacingportletsonapage.So
let’sstartworkingonthe Nose-stersite.Youcando thisby goingupto the
Dockbar and clickingGo to → Nose-ster.
We’ll use the Community page youcreatedearlierinthe topics.Navigate tothe
Community page andselectManage→ Pagefromthe Dockbar.
Thisscreenshouldnow be familiartoyoubut let’srecap.
The Page tab allowsyouto:
 Change the name of the page
 Enter HTML code for the title
 Choose the page type
 Hide the page from the theme navigation
 Define afriendlyURLto the page
 Choose anicon to be displayed
 Choose a frame targetfor the page
 Copyan existingpage
You can alsoentercustommeta tags or JavaScripttothe page if you’re a web
developer.Additionally,if youclickthe Permissions button,youcandefine
whichusers,groups,rolesororganizationscanview oreditthe page.
The Childrentabletsyoucreate childpagesunderneaththe page you’ve
selected.Youcannestpagesas deepas youlike butforeverypage below the
top level hierarchyyoumustprovide navigationtoitviaa Navigationor
Breadcrumbportlet,atleastwithmostthemes(includingthe default).
Developerscancreate themeswhichhave cascadingmenubarswhichshow the
full hierarchy.Some examplesof thatare in Liferay’spluginrepositories.
For now,click Return to full page.You shouldbe able todefine andmanage
pagesinLiferayat thispointso let’slookatwhat you’dputon a page.
Portlets
As we discussedearlier,LiferayPortal pagesare composedof portlets.All of
your site’sfunctionality,fromblogstoshopping,iscomposedof portlets.
Addingportletstoa page issimple.Let’saddsome toour Collaborationpage.
1. In the Dockbar,select Add → More.
2. In the menuthat appears,expandthe Collaborationcategory.
3. Drag the BlogsAggregatorportletoff the AddApplicationwindow ontothe rightcolumnof
our page.
4. Next,dragthe Wiki portlettothe left column.
See howeasyit isto add applicationstoyourpages?We’ve gone one step
further:we’ve gotthe Wiki portlet,the BlogsAggregatorportletandthena
nestedportletwithadifferentlayoutandthe Alerts,SearchandDictionary
portletsinthe figure below.
Page Permissions
By default,publicpagesare justthat: public.Theycanbe viewed byanybody,
loggedinor notloggedin.Andprivate pagesare reallyonlyprivate fromnon-
membersof the site.If someone hasjoinedyoursite orisa memberof your
organization,thatpersoncansee all the private pages.Youcan, however,
modifythe permissionsonindividual pagesineitherpage groupsoonlycertain
userscan viewthem.
Let’ssay we wantedtocreate a page onlyfor administratorstosee.We cando
thiswiththe followingprocedure:
1. Go to the Dockbarand select Manage→ ControlPanel.
2. Ensure you’ve selectedthe defaultsite inthe contextselector.
3. Clickthe Site Pages link.
4. Clickthe PrivatePages tab to switchto the Private Pages.Remember,thesepagesbydefault
are viewableonlybymembersof the site.
5. Create a page called Admin Tips.
6. Clickon the page inthe tree onthe leftandthenclick Permissions.
7. Uncheck the View and Add Discussion permissionsnexttothe Site Memberrole.
8. Clickthe Savebutton.
Congratulations!You’vejustchangedthe permissionsforthispage soonlysite
administratorscanview it.Anyusersyouaddto thisrole can now see the page.
Otherusers,evenmembersof thissite,won’thave permissiontosee it.
PagesinLiferayare as flexible aspagesyou’dcreate manuallywithoutaportal.
Usinga pointandclickinterface,youcan define yoursite anywayyouwant.You
can create and remove pages,exportandimportthem, settheirlayouts,define
howtheyare indexedbysearchenginesandmore.You’ve alsobeenintroduced
to Liferay’sconceptof sites.Again, usingapointandclickinterface,youcan
create multiple websitesanddefine how userscanaccessthem, whetherthey
are linkedtoa domainname andcreate all of theirpages.
3. Apps
3.1 App Manager
AppManager managesall the installedappsfromthe marketplace orby
installingmanually.
You can Activate itor Deactivate anyappsby clickingActionButton.
In Install TabYou can manuallyuploadafile andinstall itina liferayportal.
Afteruploadingyoucanmanage itfrom AppManager.
3.2 Store
LiferayMarketplace where youcanbuyapps,themesandmany cool stuffs.
3.3 Purchased
Thisis the place whenyoupurchase anyapp fromthe store will show here you
will install it.
3.4 Plugins Configuration
PluginsConfigurationallowsadministratorsto configure whichportal roleshave
access to certainplugins.
PortletPlugins
Theme Plugins
Layout Template Plugins
3.5 License Manager
In License Managerwe can see our liferayregistereddetailsorif we hadbuy a
liferay thenwe cangenerate licensebyenteringOrderId.
3.6 OpenSocial Admin
In OpenSocial Adminwe canbuildandpublishourownGadgets.
4. Configuration
4.1 Portal Settings
Settingsiswhere mostof the global portal settingsare includingnames,
authentication,defaultuserassociations,andmail hostnames.
Most global portal settingscanbe configuredfromthe Portal Settingssectionof
the Control Panel.The Configurationheadingcontainsthe followinglinks:
General:letsyouconfigure global settings,suchasthe companyname,domain,
the virtual host,a global portal logo,andmore.
Authentication:allowsyoutoconfigure userauthenticationmethodsand
connectionstoLDAPand Single Sign-Onservers.
Users:has three tabslabeledFields,ReservedCredentialsandDefaultUser
Associations.The Fieldstabenablesordisablessome userfields,suchas
birthdayor termsof use.The ReservedCredentialstabletsyoureservescreen
namesand email addressessouserscannotregisterusingthem.Youmightuse
thisto preventusersfromregisteringonthe portal withusernamesthatcontain
profanityorthat soundofficial,suchas admin or president.The DefaultUser
Associationstabletsyouconfigure defaultmembershiptoroles,usergroups,
sitesfornewusersand providesacheckbox whichallowsyoutoretroactively
applythese toexistingusers.
Mail Host Names:letsyouadd a listof othermail hostnamesto be associated
withyourorganization.Forexample,yourmaindomainmightbe
mycompany.combutyoumightuse mycompany-marketing.comforyouremail
newsletters.Anydomainnamesassociatedwithyourorganizationcangohere.
Email Notifications:allowsyoutoconfigure Liferaytosendemail notifications
for certainevents,suchasuserregistrations,passwordchanges,etc.Youcan
customize those messageshere.
ContentSharing: containsoptionsforenablingsite administratorstodisplay
contentinone site fromothersitestheyadminister.Youcanalsoconfigure rules
for whethersubsitesshouldbe able todisplaycontentfromtheirparentsites.
Afterclickingon PortalSettings inLiferay’sControl Panel,youcanconfigure any
of the areasshowninthisfigure.
General
The General linktakesyouto a screenwiththree headings:MainConfiguration,
Navigation,andAdditional Information.Underthe MainConfigurationheading,
youcan setthe name of the companyor organizationthat’sresponsiblefor
runningthe portal.Thisname alsodefinesthe name of yourportal’sdefaultsite.
Its defaultname isliferay.comsoyouwill definitelywanttochange thisto
reflectthe name of yourcompanyor organization.Youcanalsoset the mail
domain,virtual hostandcontentdeliverynetworkaddresshere.
Under the Navigationheading,youcanseta home page for your portal here as
well asdefaultlandingandlogoutpages.Forsettingthesepages,justuse the
part of the page’saddressthatfollowsyourdomain.Forexample,if youwant
the defaultlandingpage tobe http://localhost:8080/web/guest/login,use
/web/guest/login.Youcanalso use the variables${liferay:screenName} and
${liferay:userId}aspart of the address.Thiscomesinhandy if youwant to
redirectuserstotheirpersonal pagesuponlogin.Alternatively,youcansetthe
defaultloginorlogoutpage ina portal-ext.properties file withthe properties
default.landing.page.pathanddefault.logout.page.path, respectively.Underthe
Additional Informationheading,youcanspecifyaLegal name,ID,companytype,
SIC code,tickersymbol,industryandindustrytype.
Authentication
The Authenticationpage hasseveral tabs:General,LDAP,CAS,Facebook,NTLM,
OpenID,OpenSSOandSiteMinder.Youcanuse anyof these authentication
methodstoconfigure how userswill authenticatetoLiferay. Since Liferay
supportsquite afew authenticationmethods,thereare differentsettingsfor
each.
The settingsonthe General tab of the Authenticationpage affectonlyLiferay
functionalityanddon’thave anythingtodowiththe integrationoptionsonthe
othertabs. The General taballowsyouto customize Liferay’sstandard
authenticationbehavior.Specifically,the General taballowsyoutoselectfrom
several global authenticationsettings:
 Authenticate viaemailaddress(default),screenname,oruser ID(a numerical IDauto-
generatedinthe database–notrecommended).
 Enable/Disable automaticlogin.If enabled,Liferayallowsauserto checka box whichwill
cause the site to“remember”the user’sloginbyplacinga cookie onhisor herbrowser.If
disabled,userswill alwayshave tologinmanually.
 Enable/Disable forgottenpasswordfunctionality.
 Enable/Disable requestpasswordresetlinks.
 Enable/Disable accountcreationbystrangers.If youare runningan Internetsite,youwill
probablywantto leave thisonsovisitorscan create accountson your site.
 Enable/Disable accountcreationbythose usinganemail addressinthe domainof the
companyrunningthe site (whichyoujustsetonthe General page of Portal Settings).Thisis
handyif you are usingLiferayto hostbothinternal andexternal websites.Youcanmake
sure all internal IDshave to be createdby administratorsbutexternaluserscanregisterfor
IDs themselves.
 Enable / Disable email addressverification.If youenable this,Liferaywill sendusersa
verificationemail withalinkbackto the portal to verifythe email addresstheyenteredisa
validone theycan access.
By default,all settingsexceptforthe lastare enabled.Userauthenticationby
email addressisanimportantdefaultforthe followingreasons:
1. An email addressis,bydefinition,unique tothe userwhoownsit.
2. People cangenerallyremembertheiremail addresses.If youhave userswhohaven’tlogged
intothe portal for a while,itispossible theywill forgettheirscreennames,especiallyif they
weren’tallowedtouse theirscreennamesof choice (because theywere alreadytaken).
3. If a userchangeshisor her email address,itismore likelythe userwill forgettoupdate his
or her email addressinhisorher profile,if the email addressisnotusedtoauthenticate.If
the user’semail addressisnotupdated,all notificationssentbythe portal will fail toreach
the user.So it isimportanttokeepthe email addressatthe forefrontof a user’smindwhen
he or she logsinto helpthe userkeepitupto date.
Next,we’ll examine how tointegrate existingusersfromotherenvironments,
such as LDAPservers,intoLiferay.
4.2 Custom Fields
CustomfieldsappearbeneathPortal Settingsunderthe Configurationheadingof the Control Panel.
Customfieldsare away to add attributestomanytypesof assetsand resourcesinthe portal.For
example,if you’reusingLiferayPortal tocreate a site forrating books,youmightcreate a custom
fieldcalled FavoriteBooks forUserresource.If you’re usingthe Wiki forbookreviews,youmight
add fieldscalled BookTitleand BookAuthor.
It’spossible toaddcustomfieldstofollowingkindsof portal resources:
 BlogsEntry
 BookmarksEntry
 BookmarksFolder
 CalendarBooking
 Document
 DocumentsFolder
 Message Boards Category
 Message Boards Message
 Organization
 Page
 Role
 Site
 User
 User Group
 WebContentArticle
 Wiki Page
The abilitytoadd customfieldstoanyof these resourcesaffordsflexibilitytoportal developers.For
example,suppose you’dlike todefine alimitationonthe numberof usersthatcan be assignedto
certainroles.A portal administratorcancreate a customfieldcalled max-usersforthe Role resource.
Thena portal developercancreate a hookpluginthatchecksthisfielduponuserassignmenttoroles
to make sure that there aren’ttoomany usersassignedtothe role.
To add a custom field,clickonthe CustomFields linkinthe Control Panel.Thenchoose aresource,
clickon the Edit linknexttoit and select Add CustomField.
From here youneedtoadd the customfieldkey.The keyappearsasthe label
for the fieldonthe form.Forsome portal resources(like the User),customfields
are a separate sectionof the form.For others,ascan be seenabove,custom
fieldsare integratedwiththe defaultfieldsonthe form.Additionally,developers
can access customfieldsprogramaticallythroughthe <liferay-ui:custom-
attribute /> tag.
You can create fieldsof manydifferenttypes:textfields(indexedorsecret),
integers,selectionof multiple valuesandmore.Once you’ve createdafield,you
cannot change itstype.However,youcandelete custom fieldsandcreate new
ones.Next,let’slookathow toapplyserverconfigurations.
4.3 Server Administration
ServerAdministrationsettingscontrol logs,caching,searchindexing,andother
advancedfeatures.Advancedadministratorscanmonitorsystem performance,
alterdetailedserversettings,reindexsearchesandmodifycaching.
The ServerAdministrationpage of the Control Panel letsyouperformvarious
tasksrelatedtothe portal serveritself thataren’tdirectlyrelatedtothe
resourcesinthe portal.Clickingthe linkmakesthisclear:you’re immediately
presentedwithagraphshowingthe resourcesavailable inthe JVM.
Resources
The firsttab is called Resources.Thistabcontainsthe aforementionedgraphplusseveral
serverwide actions thatan administratorcanexecute.Theseinclude the following:
Run the garbage collector: Youcan sendina requesttothe JVMto beginthe garbage
collectiontask.
Clear contentcached by this VM: You can sendina requesttothe JVMto clearcontent
storedinthe local cache. Ehcache usage issplitintotwogroups:local JVMscope and
clusterscope.Thisactiononlyclearsthe contentof the local Ehcache.
Clear contentcached across the cluster: You can sendina requesttothe JVMto clear
contentcachedacross the entire cluster.Thisactionclearsthe contentof the clustered
Ehcache.
Clear the database cache: You can sendina requesttothe JVMto clear the database
cache.LiferayusesEhcache mainly,butnotonly,at the persistence layerforcaching
objectsobtainedfromthe database.Thisactiononlyclearsthe database resultcache.
Clear the direct servletcache: You can sendina requestto the JVMto clearthe direct
servletcache.The directservletcontextisafeature that optimizesJSPserving
performance bycachingand accessingthe generatedservletsdirectlyinsteadof
accessingthemoverthe applicationserver’sdispatcherchain.Thisisonlysuitablefor
caseswhere nofilterisrequiredforthe JSPs.Forproductionmode,thiscache shouldbe
enabledtoimprove performance.Incase emergencyfixesneedtobe applied,thisaction
allowsanadministratortomanuallyclearoutthe cache to force JSPsto reload.For
developmentmode,the directservletcontextshouldbe disabledtoallow JSPservletsto
be reloadedonthe fly.See the DirectServletContextsectionof the portal.propertiesfile
for details.
Reindexall search indexes: Youcan sendina requesttoregenerate all searchindexes.If
youare not usinga Solrsearch serverthiswill impactportal performance so, tryto do
thisat non-peaktimes.
Reindexall spell checks indexes:Youcan sendina requesttoregenerate all spell check
indexes.
Resetpreviewand thumbnail filesforthe Documentsand Mediaportlet: You can send
ina requesttoresetthe preview andthumbnailfilesforeachiteminyourportal’s
DocumentsandMedialibraries.
Generate ThreadDump: If you are performance testing,youcangenerate athread
dumpwhichcan be examinedlatertodetermineif there are anydeadlocksandwhere
theymightbe.
Verifydatabase tablesof all plugins: You can checkall tablesagainsttheirindexesfor
accuracy of data retrieval.
VerifyMembershipPolicies:Youcancheck that existingsite membershippolicieshave
beencorrectlyappliedandautomaticallymake updatesif necessary.Forexample,
suppose thatsomeone manuallychangedthe Liferaydatabase orthatthe Liferay
database washacked,resultinginauserbeingassignedtoa site inviolationof asite
membershippolicy.Whenthe Verify Membership Policies buttonisclicked,the verify
methodsof all the site membershippoliciesthathave beenimplementedare triggered.
These methodscheckthatall site membershipsare inaccord withthe site membership
policies;if theyare not, the necessarychanges(suchasremovingusersfromforbidden
sites) are made.
Cleanup Permissions:Thisprocessremovesthe assignmentof some permissionsonthe
Guest,User,and PowerUser rolestosimplifythe managementof “UserCustomizable
Pages”.Notably,the “AddToPage” permissionsisremovedfromthe GuestandUser
rolesforall portlets.Likewise,the same permissionisreducedinscope forPowerUsers
fromportal wide toscopedto“User Personal Site.”
Log Levels
The Log Levelstabof the ServerAdministrationpage allowsyoutodynamicallymodify
the log levelsforanyclasshierarchyinthe portal.If youhave custom code youhave
deployedwhichisn’tinthe list,youcanuse the Add Category tabto add it.If youchange
the log level nearthe topof the classhierarchy(suchas at com.liferay),all the classes
underthat hierarchywill have theirloglevelschanged.If youare testingsomething
specific,itismuchbetterto be as specificasyoucan whenyouchange loglevels.
Modifyingthemtoohighinthe hierarchygeneratesalotmore logmessagesthanyou
need.
Properties
Liferayandthe JVMcontainmany settingswhichare definedasproperties.There are
twosubtabsof the propertiestabof the ServerAdministrationpage:one showing
systempropertiesandone showingportal properties.
The systempropertiestabshowsanexhaustivelistof systempropertiesforthe JVM,as
well asmanyLiferaysystemproperties.Thisinformationcanbe usedfordebugging
purposesorto check the configurationof the currentlyrunningportal.
The portal propertiestabshowsanexhaustivelistof the portal properties.These
propertiescanbe customized;youcanperuse the full listof customizable properties
online athttp://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html.If you
needtocheck the currentvalue of a particularproperty,itcan be viewedfromthis
screenwithouthavingtoshutdownthe portal or openany propertiesfiles.
CAPTCHA
By default,LiferayshipswithitsownsimpleCAPTCHA service whichisdesignedto
thwartbots fromregisteringforaccountsonsitespoweredbyLiferay.If youwantto
insteaduse Google’sreCAPTCHA service,youcanenable thissettingfromthe CAPTCHA
tab of the ServerAdministrationpage.
Simplycheckthe EnableReCAPTCHA box andenteryour publicandprivate keysintothe
providedfields,thenclick Save.LiferayPortal will thenuse reCAPTCHA insteadof simple
CAPTCHA.
Data Migration
If you are upgradingfroma previousrelease of LiferayPortal orif youneedtomigrate
your data fromone systemtoanother,the Data Migrationtab helpsyouto do that
withoutyourdevelopers havingtowrite customscripts.
The firstsectionletsyoucopyyour entire Liferaydatabase fromthe currentdatabase
underwhichitis runningtothe database you specifyinthissetof fields.You’ll needto
enterthe driverclassname (andthe driver will needtobe onLiferay’sclasspath),the
JDBC URL of the database to whichyou’ll be copyingyourdataand the credentialsof a
userwithaccess tothat database.Once you have all of thisinformationentered,click
Executeto copy the data.
The nextsectionhelpsyoumigrate yourdocuments.If youwanttomove off of the
JackrabbitJSR-170 repositorytothe file system, ortothe Jackrabbitrepositoryfromthe
file system,ortoany of the other repositoriessupportedbythe DocumentsandMedia
library,youcan do so veryeasily.Make sure youhave alreadysetupyour portal-
ext.propertiesfilesothe hookisproperlyconfiguredbefore runningthismigration.
Selectthe DocumentLibraryhookthat representsthe locationtowhichyouwantyour
documents tobe migrated,thenclick Execute.Your documentswill be migratedtothe
newrepository.Youcanthenshut downLiferay,make the new repositorythe defaultin
the portal-ext.propertiesfile,andthenrestart.
You can migrate imagesfromthe Image Galleryinthe same manner.(InLiferay6.0 and
previousversions,the DocumentLibraryandImage Gallerywere distinctrepositories.In
Liferay6.1 and laterversions,these have beencombinedintoasingle Documentsand
Mediarepository.)
File Uploads
Since Liferayallowsuserstouploadfilesinvariousplaces,youmaywanttolockdown
the type of filesandthe size of filesusersare allowedtoupload.The File Uploadstabof
the ServerConfigurationtabletsyousetthe overall maximumfile sizeandthenoverride
that size forspecificapplicationswithinLiferay.Youcanlimitthe allowedfile extensions
generallyorbyapplication.Youhave alot of flexibilityastohow youwant filestobe
managedwithinyourportal.
Mail
Insteadof usingyourLiferay server’sportal-ext.propertiesfiletoconfigure amail server,
youcan configure amail serverfromthe Mail tab of the ServerConfigurationsectionof
the Control Panel.If yourportal is to receive mail (see,forexample,ourcoverage of the
Message Boards portlet ),youcan connecta POP mail server.If yourportal isto send
mail,whichisuseful forsendingnotificationstousers,youcan connectto an SMTP
server.We highlyrecommendsettingupmail serversforyourportal.
Note that if youconfigure mail serversettingshere inthe Control Panel,these settings
will override anymail serversettingsinyourportal-ext.propertiesfile.
External Services
LiferayPortal enablesuserstouploadandshare contentviathe DocumentsandMedia
library,a customizable andpermissionable online repository.Userscanuploadfilesof
any type to the DocumentsandMedialibrary.LiferayshipswithPDFBox andusesitto
generate automaticpreviewsforcertaintypesof documents,bydefault.Youcan also
install three additional toolsthatofferhigherqualitypreviewsanddocumentconversion
functionality:OpenOffice orLibreOffice,ImageMagickandXuggler.WithLiferay
configuredtouse these tools,youcangenerate automaticpreviewsformanytypesof
filesincludingtextfiles,office suitefiles,PDFs,images,audiofilesandvideos.Userswill
alsobe able touse the conversionfunctionalitytodownloaddocumentsinavarietyof
formats.Please see the AutomaticPreviewsandMetadata sectionformore information.
LibreOffice isavailable here: LibreOffice,ImageMagickisavailablehere: ImageMagick,
and Xugglerisavailable here:Xuggler.Make sure tochoose the correct versionsof these
applicationsforyouroperatingsystem.We recommendthatyouinstall the lateststable
versions.LibreOffice 3.6,ImageMagick6.7.7, and Xuggler5.4 workwithLiferay6.2. You
needtoinstall LibreOffice andImageMagickmanuallybutyoucaninstall Xugglerfrom
Liferay’sServerAdministrationControlPanel interface.
Once you’ve installedthesetools,youcanuse the External Servicestab of the Control
Panel toconfigure Liferaytouse them.
Script
Liferayincludesascriptingconsole whichletsadministratorsexecute migrationor
managementcode instantly.Several scriptinglanguagesare supported,including
JavaScript,Groovy,Python,RubyandBeanshell.Thisguide containsa topicsthat
explainshowtouse Liferay’sscriptingconsoleandprovidessome examples.
Shutdown
If you everneedtoshutdownyour LiferayPortal serverwhileusersare loggedin,you
can use the Shutdowntabto informyourlogged-inusersof the impendingshutdown.
You can define the numberof minutesuntil the shutdownandacustom message that
will be displayed.
Users will see yourmessage atthe topof theirportal pagesfor the durationof time you
specified.Whenthe time expires,all portal pageswilldisplayamessage sayingthe
portal has beenshutdown.Atthispoint,the serverwill needtobe restartedtorestore
access.Next,let’sexamine how tomanage multiple portal instances.
4.4 Portal Instances
Portal Instancesallow administratorstorunmore than one portal instance ona
single server.Dataforeachportal instance are keptseparate fromeveryother
portal instance.
Portal Instances
LiferayPortal allowsyoutorun more than one portal instance ona single server.
The Portal Instancessectionof the Control Panel appearsunderthe
Configurationheading.Thissectionletsyoumanage multiple portal instances
froma single Liferayinstallation.Eachportal instance’sdataiskeptseparate
fromeveryotherportal instance’sdata.All portal data,however,iskeptinthe
same database.
Each portal instance requiresitsowndomainname.Liferaydirectsuserstothe
properportal instance basedonthisdomainname.Sobefore youconfigure an
instance,configure itsdomainname inyournetworkfirst.Whenyou’re readyto
add an instance,clickthe Add buttonhere.
You’ll be promptedforfourfieldsandacheck box:
WebID: A general conventionistouse the domainname forthis.It’sa user-
generatedIDforthe instance.
Virtual Host: Put the domainname youconfiguredinyournetworkhere.When
users are directedtoyour Liferayserverviathisdomainname, Liferaywill then
be able to sendthemto the properportal instance.
Mail Domain: Enterthe domainname forthe mail hostfor thisinstance.Liferay
will use thistosendemail notificationsfromthe portal.
Max Users:Enter the maximumnumbersof useraccountsyouwouldlike your
portal instance tosupport.
Active:Use thischeck box to choose whethertocreate an active oran inactive
portal instance.
Whenyouare finishedfillingoutthe form, click Save.Now navigate tothe portal
usingyournewdomain name.Youwill see youare broughtto what lookslike a
cleaninstall of Liferay.Thisisyournew portal instance whichcannow be
configuredanywayyoulike.
4.5 Social Office Configurations
Already told in above topics. (When we
were installing Social Office.)
SOCIAL OFFICE CE
LiferaySocial Office isasocial collaborationsolutionforthe enterprisethatstreamlines
communication,savestime,buildsgroupcohesionandraisesproductivity.
What is Social Office?
LiferaySocial Office isasocial collaborationsolutionforthe enterprisethatstreamlines
communication,savestime,buildsgroupcohesionandraisesproductivity.
It was createdinresponse towide demandforimplementingthe LiferayPortal platform
as a team collaborationsolution.To be clear,LiferaySocial Office isbuiltonLiferay
Portal,createdbypicking,integrating,andpackagingLiferayPortal'smostasked-for
featuresandcapabilitiesforsocial collaborationuse cases.
What's the difference between Liferay Portal
and Liferay Social Office?
If you wanta heavily customizable solution,take alookat LiferayPortal--ithasall the
featuresof Social Office andmore.If you're lookingforasolid,simple touse
collaborationsolutionanddon'twantto botherwithheavycustomization,LiferaySocial
Office will be abetterfitforyou.
Social Office Plugins Available for use:
CE Plugins:
 calendar-portlet
 chat-portlet
 contacts-portlet
 deploy-listener-hook
 events-display-portlet
 microblogs-portlet
 notifications-portlet
 portal-compact-hook
 private-messaging-portlet
 so-activities-hook
 so-announcements-portlet
 so-configurations-portlet
 so-hook
 so-portlet
 so-theme
 tasks-portlet
 WYSIWYG-portlet
If all the Social Office pluginshave beensuccessfullydeployed,checkthatyoucan accessthe
followingitemsinyourportal,eitherinthe Control Panel orona defaultSocial Office site:
Role:
 Social Office User
Site Templates:
 DefaultSocial Office Site
 Social Office UserHome (Dashboard)
 Social Office UserProfile
Portlets:
 Chat
 Contacts
 EventsDisplay
 Microblogs
 Private Messaging
 Social Office Configurations
 Social Office Portlet
 Tasks
 WYSIWYG
Hooks:
 DeployListener
 Portal Compact Hook
 Social Office Hook
Themes:
 Social Office theme
To actuallystart usingSocial Office afterit’sbeeninstalled,youneedtograntthe Social Office User
role to one or more users.Please refertothe Using SocialOfficesectionformore detailsaboutthe
Social Office Userrole andthe featuresprovidedbySocial Office.
Using Liferay as A Social Platform
Whetheryouplanto buildasocial networkor enable social applicationsaspart of your overall user
experience, LiferayPortal hasthe toolstomake those featuresworkforyou. Startingwitha suite of
applications–includingaprofile summary,activitiesfeeds,socialrequests,awall,andmore–and
roundingthingsoutwithanAPI to handle relationshipsbetweenusersaswell aspublishtheir
activitiestoeachother,LiferayPortal helpsyouimplementcommonfeaturesof social networks.
LiferayPortal providesfeedsof social activities.These feedscancontainentriesfromanyof Liferay’s
built-inapplicationsorapplicationsthatyouwrite.
Social relationshipsinLiferayPortal are ideallysuitedforeverythingfrompublicsocial networksto
enablingsocial featuresinyourcorporate Intranet.Userscanform relationshipswithone another,
allowingthemtosee updatesfromthose whose activitytheyneedtotrack.That’s far more powerful
than havingthemsubscribe tomultiple individualRSSfeedsorvisitmultipleprofiles,becausethe
systemkeepstrackof the updatesfromthose withwhomyouhave a relationship,automatically.
More than this,however,Liferayisagreatintegrationplatformforsocial applications.Itfully
supportsthe OpenSocial framework.Youcanpublishgadgetsyoufindonline,oryoucanuse Liferay
Portal’sbuilt-inOpenSocial gadgeteditortocreate andserve yourownOpenSocial gadgets.
LiferayPortal’sOpenSocial gadgeteditorletsyourapidlycreate social applicationsthatcanbe
servedacrossthe webto any otherOpenSocial container.
LiferayPortal alsosupportsthe creationof Facebookapplications;infact,noadditional codingis
necessarytopublishyourLiferayapplicationsonFacebook(youwould,of course,needtouse
Facebook’sAPItouse Facebook-specificfeatureslikepostingonusers’timelines).All youneedtodo
isget an APIkeyand canvaspage URL from Facebook.
AnyLiferayapplicationcanbe publishedtomultiple social networkswithafew clicks.
As youcan see,LiferayPortal isbuiltwithsocial applicationsinmind.It’shighlylikely,howeverthat
youalso have yourownapplicationyouneedtorunon your website.The LiferayPortal platformis
ideal forthe webapplicationyou’re consideringwriting.Inadditiontothis,LiferayPortal iseasily
configuredtobe usedas a sharedhostingplatformformultiplewebsites.Let’slookatthe benefits
youcan reapby usingLiferayPortal inthese ways.
How to use Social Office?
My Dashboard
Thisis the user'shomepage.The leftside of the page liststhe communitiesorsitesthe userbelongs
to as well asa buttonto add sitesif youare the admin.The rightside of the page has three view
activityoptions,Mysites,MyFriendsandMe. My siteslistsall the recentactivitiesforthe sitesthat
youbelongto.My friendsliststhe recentactivitiesforyourfriendsandMe listsall of your (the
loggedinuser's) activities.
Creating Communities
Once loggedinyouwant to start bycreatingcommunities.Theseare essentiallymini-sitesthatare
usedto collaborate on.Youcan create sitesforany groupingof people whowanttocollaborate
togetherincludingbutnotlimitedto,specificdepartmentswithinabusiness(e.g.,marketing,sales,
or pr),groups of co-workersacrossdepartments(e.g.,thosewhoare organizingthe company-wide
summerbbq),andspecificprojects(e.g.,ProductAlpha,Beta,orDelta) thatwill alsohave members
frommany departmentswithinacompanycollaboratingonit.Once a communityiscreatedyoucan
start addingcontentto thatsite.Clickonthe My Sitesbuttononthe top rightto navigate to the sites
youbelongto.Once you've navigatedtoa site you are presentedwithasetof pre-definedpagesfor
that site.The advantage tothisis nothavingto spendtime populatingyoursite withpagesand
collaborationportletsorworryingaboutlayout.Youcan justset itup and go,literallythe abilityto
start workingassoon as yousignon. Once there isno more needfora particularsite,(e.g.,The
summerbbqisover) the admincan just delete the site andcreate anew one for the next
collaborative need.Youcansee fromthisscreenshotthat three communitiesorsiteswere created,
one for marketing,one foreventsandone fora projectnamedAlpha.
Descriptions of the pre-defined pages
Dashboard
Thisis the home page of the marketingcommunitywe created.Itishere thatyoucan see all of the
latestactivitiesof userswithinthiscommunity.If youneedtoknow whatpeople are doingthisis
where youwouldgoto see an aggregatedlistof all theiractivities.
Calendar
The Calendarpage allowsyouto see all of the events,appointments,meetings,andsuchthatare
associatedwiththatparticularcommunity.Asadminyoucanautomaticallyaddandediteventsin
the calendar.
My Documents
The Documentspage is where the documentlibraryislocated.
Forums
The Forums page iswhere youcan findthat site'smessage board.A listof quicklinksisdisplayedon
the leftside of the page.Thisallowsyouto quicklynavigate righttothe contentyouwantto see.As
withthe documents,blog,andwiki pages,asectionwithrelatedcontentisonthe rightside of the
page.Thisautomaticallybringsupall contentthatistaggedwiththe same tag as the contentyouare
currentlyviewing.
Blog
Once on the Blog page,youcan navigate throughall the blogscreatedbyuserswithinthissite.For
easyaccess,a listof recententriesisonthe left-handsideof the page.
Wiki
The Wiki page isthe perfectplace tocreate documentationorpostinformationforyourcommunity.
It too hasa listof quicklinksonthe lefthandside andrelatedcontentonthe right.
Contacts Center
The Contacts Centerpage listsall the membersof thatparticularcommunityonthe left.Youcan
clicka specificpersontosee more informationonhimorher.
Chat
The numberof online friendsshowsupinthe bottomrightcornerof the screen.Clickittopull up a
listof those friendsandclickona specificpersontoopenachat box withthat friend.
Messages
You can sendmessagestopersonswhichare incontact withu.
Working Smart with Liferay Social Office
LiferaySocial Office isLiferay’ssocial collaborationproductforthe enterprise.Previouslyreleasedas
a separate productthat was basedonLiferayPortal,it’snow available asanapplicationthatcan be
installedonLiferay.We are excitedtobringbothSocial Office andthisguide toyou,inthe hope that
you’ll be able touse eachto enable yourteamsto worktogethermore efficiently.Thisguideisfor
those whoare settingupandadministeringaninstance of LiferayPortal usingSocial Office.From
installingSocial Officetointroducingyoutoitsentire feature set,we’ll discussall of the thingsyou
can do withSocial Office tohelpyourteam.We hope you’ll use itasa tool to getSocial Office up,
running,andintegratedintoyourenterprise. Youcanfindmuchmore informationaboutinstallation
and administrationinthe LiferayUserGuide.
“Help!”
Thishas beenthe cry of informationworkers everywherewhohave triedtomanage complex
projectsthroughemail andsharedfolders.You’veprobablyhadasimilarexperience:you’re
collaboratingona documentwithateamof people andare emailingitbackandforth.PersonA
createsthe initial documentandPersonBreplieswithsome edits.PersonCreplieswithadditional
editsat the same time PersonA replieswiththe correctionsfromPersonB.PersonDtakesthisand
rewritesawhole sectionof the documentwhile PersonBandC respondtoPersonA’supdate.Pretty
soon,it becomesverydifficulttodeterminewhichdocumentisthe latestdocument.The same
scenarioplaysitself outwhenworkinginsharedfolders,exceptthere’snotrail of email messagesto
figure outwhodidwhat andwhen.
The Social Office pluginforLiferayPortal isdesignedtoanswerthiscall forhelp.Social Office isa
dynamicteamcollaborationsolutionforthe enterprise that’sdesignedtostreamline
communication,save time,andraise productivity.Organizationsandgroups can use Social Office to
share resources,collaborate onprojects,andraise the visibilityof importantactivity.We createdthe
productto provide a simple,outof the box solutionforteamcollaboration.Social Office provides
youwitha fantasticarray of featuresthatyoudon’tneedto spendalot of time configuring.It’s
readyto use rightout of the box.Once installed,aquicksetupwizardwill helpyousetupateam
collaborationsite soyoucanbeginworkingimmediately.Infact,youcan have a full production
environmentsetupinlesstime thanittakesto brew a potof coffee.
If you needanyassistance beyondwhat’scoveredinthisbook,Liferay,Inc.offerstraining,
consulting,andsupportservicestofill anyneedthatyoumighthave.Pleasesee
http://www.liferay.com/services forfurtherinformationaboutthe serviceswe canprovide.As
always,we welcome anyfeedback.If there isanywayyouthinkwe couldmake thisbookbetter,
please feel free tomentionitonourforums.Youcan alsouse any of the email addressesonour
Contact Us page http://www.liferay.com/contact_us.We are here toserve you,ourusersand
customers,andto helpmake yourexperience usingSocial Office the bestitcanbe.
Upgrading Your Liferay Social Office
version
There are a fewstepsandproceduresthatyouneedto follow if you’re upgradingtoa newerversion
of Social Office.The sectionsbelowdescribe how toupgrade fromSocial Office 2.x to3.x,and from
Social Office 3.0.0 to 3.0.1.
Upgrading from Social Office 2.X to 3.X
Social Office 3.x onlyrunson LiferayPortal 6.2.x.If you’dlike toupgrade fromSocial Office 2.x to 3.x,
youfirstneedto upgrade your portal from Liferay6.1 to Liferay6.2. For informationonupgrading
Liferay,please referto UpgradingLiferay.RemembertoundeployyourSocial Office 2.x plugins
before upgradingyourportal to6.2. If you have a LiferayPortal EE subscription,make sure toapply
any available fixpacksbefore deployingyourSocial Office 3.x plugins.
Once your 6.2 portal isready,deployyourSocial Office 3.x plugins. Whenyoufirstlogintoyour
portal as an administratorafterinstallingSocial Office 3,you’ll see the Social Officeconfigurations
portlet.Youcan use thisportletto grant the Social Office Userrole tousers.The Social Office User
providesaccesstothe Dashboardhome page,the publicProfile page,andall of theirapplications.
You’re nowreadyto use Social Office!
Upgrading from Social Office 3.0.0 to 3.0.1
Before upgradingfromSocial Office 3.0.0to 3.0.1, make sure to sethot.undeploy.on.redeploy=true
inyour portal-ext.propertiesfile.ThispropertymakesLiferaycompletelyundeployapluginbefore
deployinganewversionof the plugin.If youdon’tsethot.undeploy.on.redeploy=true before
upgrading,the upgrade mightnotcorrectlyhandle activities.Settinghot.undeploy.on.redeploy=true
ensuresthatactivitiesare handledcorrectly.
Afterinstallingthe newversionof Social Office,you’re all set!
SOME OUT OF THE BOX FEATURES
Accessing Liferay Services
In manycases,you’ll wanttointeractwithone of Liferay’smanyservices.Thisispossible fromall of
the scriptinglanguagessupported,butthe syntax isa little differentforeachlanguage.
To illustrate the correctsyntax forinteractingwithLiferayservices,let’slookata simple example
that usesthe UserLocalService toretrievealistof usersand thenprintstheirnamestothe log file.
We’ll initiallyimplementthe exampleinJavapseudo-code.
Let’ssee firsthowthiswouldworkinBeanshell,whichisverysimilartoJava.
Beanshell
Beanshell isaJavascriptinglanguage that’sdesignedtorunJava code withlittle ornochanges.In
thisexample,we onlyhave one smallchange tomake because Beanshell doesn’tsupportthe use of
Java Generics.
Groovy
Groovyis alsobasedon Javaand isperhapsa little easierthanBeanshell because literallyanycode
writteninJavaalsoruns inGroovy. Thismeanswe can execute the exactsame code fromourJava
example withoutanychanges.
Of course,we couldmake thissomewhatGroovierbysimplifyingthe programasfollows:
The script engine supportsmore thanjustJava-like languages.Despitethe name,youshouldbe
aware that JavaScriptbearslittle resemblancetoJava,butyou can still use itinLiferay’sscript
engine.
JavaScript
Liferayusesthe Rhino JavaScriptEngine toprovide JavaScriptsupportinthe scriptengine.The
followingcode providesa JavaScriptversionof ouroriginal Javaprogram.
You can see the Javascriptexample iscompact.Rubyisevenmore compact.
Ruby
Rubyis supported throughthe use of JRubyandour previousexample couldbe implementedin
Rubyas follows:
Python
Lastly,LiferayprovidesPythonsupportbasedonJythonandthe previousexamplecouldbe
implementedwiththe followingcode.
As youcan see,Liferay’sservicescanbe accessedfromanyof these languages.
Authoring The Basic Content
Let’stake an example:
You’ve beenassignedthe tasktobuildawebsite foran innovative new social networkingsitecalled
Nose-ster.You’vedecidedtotake advantage of LiferayPortal anditsrapiddeploymentfeaturesas
well asitsabilitytogeta fullyfunctional,content-richwebsite withintegratedsocial featuresup
and runninginlittle time.Together,we cangetyoustarted.
We’ll walkthroughthe creationof Nose-ster’swebsite,startingbycreatingandpublishingsome
simple contentusingLiferay’sbuilt-inWYSIWYGeditor.We’ll thentake advantage of Liferay’srobust
structure editor.We’ll use templatestodisplaythe contentandthenexploresome of the advanced
publishingfeaturessuchasthe built-inworkflow andAssetPublisher.
Creating Content The Simple Way
As we’ve statedabove,contentisthe reasonwebsitesexist.LiferayPortal has made iteasierthan
everto getcontentpublishedtoyoursite.Because LiferayPortal issoflexible,youcanuse basic
authoringtoolsrightawayor take advantage of the more advancedfeatures.It’sadaptable toyour
needs.
We’ll beginbycreatingsimplecontentusingLiferay’sWYSIWYGEditorandthenwe’ll publishitto
the home page of Nose-ster’swebsite.Thisisafastand straightforwardprocessthatdemonstrates
howeasyit isto create and publishcontentonyourLiferayPortal instance.Let’slearnaboutthe
WebContentsectionof the control panel sowe can create and publishourfirstpiecesof content.
Choosing a Site in the Content Section
Whenyoumanage webcontentfromthe Control Panel youcanselectthe locationwhere the
contentresides.Forinstance,youcanaddcontentthat’s available toaspecificsite orgloballyacross
the portal.The Contentsectionof the Control Panel displaysasitsheadingthe name of the site
you’re currentlyworkingon.Thisheadingiscalledthe contextmenu selector:youcan change the
scope of where you’dlike toview,editorcreate contentbyusingthe drop-downselectorattached
to the heading.
Rich, WYSIWYG Editing
Once you have the Nose-stersite selected,clickonthe Web Contentlinkinthe Control Panel.Next,
clickthe Add buttonunderthe Web Contenttab.This isa highlycustomizableformthatbydefault
has twofields:atitle anda powerful WYSIWYGeditor.We couldcustomize thisformtocontain
whateverfieldsourcontent needsbutlet’skeepthingssimplefornow.
For now,type the words Welcome to Nose-sterinthe Namefield.Notice thatcontentcanbe
localizedinwhateverlanguage youwant.If youclickonthe localize checkbox,twoselectboxes
appearwhichallowyou to pickthe language you’re workinginandthe defaultlanguage.Youcan
entertranslationsof yourcontentforany language inthe list.The screenshotbelow showsthis
interface butfornow,we won’tbe usingit,so youcan leave itunchecked.Inthe contentfield,adda
short sentence announcingthe website isupandrunning.
The Web ContentEditorprovidesmanyoptionsforcustomization.
Gettinga newwebsite upand runningisan excitingstepforanyone,whetheritisa large
corporationor a small non-profitcharity.Tocelebrate thismomentousachievementatNose-ster,
let’sgive ourannouncementsome of the pompandcircumstance we thinkitdeserves!
Usingthe editor,selectall the textandthenchange the style to Heading 1 and the color to Dark
Green.
You couldinsertanimage here or evenmore textwithadifferentstyle,asdemonstratedinthe
screenshotbelow.Youcan alsoadd bullets,numbering,linkstoanothersite orcustomimages.You
can evenaddan emoticon.Let’sadda smileyface at the endof our announcement.
: Viewyourcontentchangesdirectlyinthe editor.
The WYSIWYG editorisa flexible tool thatgivesyouthe abilitytoaddtext,images,tables,linksand
more.Additionally,youcanmodifythe displaytomatchthe purpose of the content. Plus, it’s
integratedwiththe restof LiferayPortal:forexample,whenyouuploadanimage tobe addedto a
page,that image can be viewedandmanipulatedinthe DocumentsandMediaportlet.
If you’re HTML savvy,LiferayWCMdoesn’tleave yououtinthe cold.You can clickthe Source button
and write yourownHTML if youwish.
On the rightof the NewWebContentformare optionsthatallow youtocustomize yourweb
content.
Newwebcontentcanbe customizedinvariouswaysusingthe menuonthe right.
Abstract: letsyouto create a brief summaryof the webcontent.You can alsopair the textwitha
small image.
Categorization:specifiesthe contenttype fromalistof options.Theyare Announcements,Blogs,
General, News,PressRelease,and Test. You can alsocreate tags to make the contenteasiertofind
ina search.Note thatthese categoriesare definedbyapropertyinthe propertiesfile.
Schedule:customizesthe date andtime yourcontentpublishesand/orexpires.
Display Page:letsyou determinewhere the webcontentsare displayedwhenlinkedfromother
pages.The conceptof the Canonical URL is new toLiferay6.1. The Canonical URL is unique for
articlesthatredirectthe visitortothe article’sdefaultdisplaypage.
Imagine youhave a newspaperwithasportssectionanda technologysection.Youadda Sports
page and a Tech page to your site,eachone witha specificbannerandlookandfeel.Youwantthe
articlestoappear inthe appropriate pages,butyouknow inLiferayarticlesare notrelatedto pages.
You can add an article as oftenasyou like indifferentwebcontentdisplayportletsorinconfigured
AssetPublishers.Butif youhave a Viewin contextlink,where willyoushow yourarticle?Thisis
where you’duse adefaultdisplaypage.Articlesthathave adefaultdisplaypage definedare shown
withotherrelatedarticlesinthe same displaypage.
Imagine youhave 100 sportsarticlesand100 tech articles.Inpreviousversionsof Liferayyou’dneed
to create a page foreach article to show it.Now withonlyone sportspage and one techpage,you
can showall articlesinone place ina consistentfashion.
Creating A Display Page
There are twowaysof creatinga displaypage.Youcan use a ContentDisplay Pagetemplate,which
automaticallycreateseverythingyouneed,oryoucancreate one manually.The ContentDisplay
Page template isfoundunder PageTemplates inthe Portal sectionof the Control Panel.
To create a displaypage manually,addanAssetPublishertoa page.Thenmake it the DefaultAsset
Publisherforthe page.ThisdefinesthisAssetPublisherasthe one that displaysthe contentif
several AssetPublishersare onthe same page.Setthisup by clicking Configuration onyourAsset
Publisher.Underthe Setup tab,navigate to Display Settings andcheck the checkbox labeled Setas
the DefaultAssetPublisherfor This Page.
Once you’ve givenanarticle itsdefaultdisplaypage,linkstothe article redirectthe usertoits
defaultdisplaypage.Tosee howthisworks,addanAssetPublishertoanotherpage,like the Home
page of the newspaper,andconfigure itto View in a Specific Portlet.Thissettingisfoundinthe
AssetLink BehaviormenuunderDisplaySettings.If youclickonthe link,you’llbe redirectedtothe
DefaultDisplayPage of the article.
You nowsee that the linklookssomethinglikethis:
www.nosester.com/nose-article
Thisis an example of acanonical URL, and it’sa nice enhancementforSearchEngine Optimization
(SEO) because the article’sURLbecomesthe page URL. To a searchengine that’scrawlingyoursite,
thismeansthat the locationof yourarticle neverchanges.Andif youdecide touse the contenton
anotherpage inthe future,the article isstill availableatthisURL. This feature isusedinsearch
results,inrelatedassetsandinAssetPublishers.
RelatedAssets:enablesyoutoconnectany numberof assetswithinasite or across the portal,even
if theydon’tshare any tags and aren’tinthe same category.You can connectyourcontentto a Blogs
Entry, Message BoardsMessage,WebContent,CalendarEvent,BookmarksEntry,Documentsand
MediaDocument,anda Wiki Page.
Thisblogentryhas linkstothree RelatedAssets:one webcontentdisplayandtwoblogentries.
Permissions:customize whohasaccessto the content.Bydefault,contentisviewable byAnyone
(GuestRole).Youcan limitviewablepermissionsbyselectinganyRole fromthe drop-downorinthe
list.Additionally,LiferayPortal providesthe abilitytocustomize permissionsinmore detail.Select
the More Options linknexttothe dropdownbuttonand you’ll findthe differentactivitiesyoucan
grant or denyto yourwebcontent.
PermissionsforWebContentallowyoutofine-tune how yourcontentisaccessed.
Custom fields:customize metadataaboutthe webcontent.The fieldscanrepresentanythingyou
like,suchasthe webcontent’sauthororcreationdate.If customfieldshave beendefinedforweb
content(whichcanbe done fromthe CustomFields page of the Control Panel),theyappearhere.
For thispiece of webcontent,we don’tneedtochange anything.Afteryou’re finishedwith
permissions,click SaveasDraft.Thissavesthe contentindraftform.Once you’re satisfiedwithyour
changes,selectPublish.Thismakesthe contentavailable fordisplay,butwe still have someworkto
do to enable userstosee it.InLiferayWCM, all contentresidesinacontainer,whichisone of two
portlets:WebContentDisplayorWebContentList.Byfar the most frequentlyusedisthe Web
ContentDisplay portlet.
Configuring Additional Portlet Settings
Go back to the Control Panel,andclickon PortalSettings underthe Configuration heading.We’ve
alreadylookedatthe optionsavailablefromthe Generaland Authentication links.Now let’sexamine
the otherportal settingsoptions.
USERS
If you clickon Usersfromthe Portal Settingsscreen,you’ll findthree tabs:Fields,Reserved
CredentialsandDefaultUserAssociations.
The Fieldstaballowsyouto enable/disable the followingfields:
 Enable/disablerequiringthe Termsof Use
 Enable/disableuserscreennames autogeneration
 Enable/disablerequiringthe lastnames
 Enable/disablethe birthdayfield
 Enable/disablethe genderfield
The nexttab isReservedCredentials.Youcanenterscreennamesandemail addresseshere thatyou
don’twant otherstouse.Liferaywill thenpreventusersfromregisteringwiththese screennames
and email addresses.Youmightuse thisfeature topreventusersfromcreatingIDsthatlooklike
administrativeIDsorthat have reservedwordsintheirnames.
The DefaultUser Associationstabhasthree fieldsallowingyoutolist(one perline) sites,roles,and
usergroupsyou wantnewusersto become membersof automatically.By default,Liferayassigns
newusersto boththe Users role and the PowerUsersrole.
If you have definedotherusergroups,sitesorrolesyouwantnewlycreateduserstobe membersof
by default,enterthemhere.Forexample,youmayhave definedsite templatesincertainuser
groupsto pre-populate endusers’private pages.If there isaparticularconfigurationyouwant
everyone tohave,youmaywantto enterthose usergroupshere.
Mail Host Names
Mail HostNamesappearsafterAuthenticationandUserson the Portal Settingsscreenof the Control
Panel.Youcan enterothermail hostnames(one perline) besidesthe one youconfiguredonthe
General tab.Thisletsthe portal knowwhichmail hostnamesare ownedbyyourorganization.
E-Mail Notifications
There are five tabsunderthe Email Notificationspage of Portal Settings.The Sendertaballowsyou
to setthe portal’sadministrativename andemail address.Bydefault,theseare Joe Bloggsand
test@liferay.com.Youcanchange themto whateveryouwant. Thisname andemail addresswill
appearin the fromfieldinall email messagessentbythe portal.
You can customize the email template forthe email messagessenttouserswhohave justcreated
theiraccounts.
The other fourtabs are Account Created Notification,Email VerificationNotification,Password
ChangedNotificationandPasswordResetNotification.These tabsallow youtocustomize the email
messagesthatare sentto userseach time anyof those foureventsoccur.
You can referto thislist of variablesthat’savailable foruse inemail templates.
A listof tokens,entitled“Definitionof Terms,”isprovidedsoyoucan insertcertainvalues(suchas
the portal URL or the userID) whenyouare settingupthe custom email messages.
Content Sharing
The ContentSharingsectionof the Portal Settingsareaof the Control Panel allowsyoutochoose
whetherornot site administratorscandisplaycontentinsitesfromothersitestheyadminister.For
example,suppose thatacertainuseris a site administratorof twosites: Engineering andMarketing.
The checkbox inthe ContentSharingsectionof Portal Settingsdetermineswhetherornot the site
administratorcandisplaycontentfromthe Marketingsite inthe Engineeringsite andvice versa.
The ContentSharingsectionof Portal Settingsalsoallowsyoutochoose abehaviorforwhetheror
not subsitescandisplaycontentfromparentsitesandforconfiguringthe defaults.There are three
options:
Enabledby Default: Thismeansthat subsitescandisplaycontentfromparentsitesbydefaultbut
thiscan be disabledbyasite administrator.
Disabledby Default:This meansthatsubsitescannotdisplaycontentfromparentsitesbydefault
but thiscan be enabledbya site administrator.
Disabled:Thismeans that subsitescannotdisplaycontentfromparentsitesandthisbehavior
cannot be changedby a site administrator.
Identification
The identificationsectionhasseveral linksforaddresses,phone numbersandotherinformationyou
can configure inyourportal.Thisallowsyouto setup contact informationforthe organizationthat
ownsthe portal.Developerscanqueryforthisinformationintheirapplications.
Miscellaneous: Display Settings
LiferayDocumentation-Shikhar
Thissectionallowsyoutosetthe defaultportal language andthe time zone.Youcanalsoset upa
portal-wide logowhichappearsinthe topleftcornersof portal pages.
You can specifyvariousdisplaysettingsforyourportal includingoptionsforthe defaultlanguage,
otheravailable language,time zone,portal logo,anddefaultthemesforthe portal andControl
Panel.
Liferay’sdefaulttheme isconfiguredtodisplaythe portal logo.Forcustomthemes,youcanchoose
whetherornot to displaythe logo.Be careful tochoose animage file thatfitsthe space.If you pick
somethingtoobig,itmightoverlapwiththe navigation.
Configuring Liferay for High Availability
LiferayPortal isa robust,enterprise-readyportal solution.Assuch,itisfullyreadytosupport
mission-critical,enterpriseapplicationsinanenvironmentconfiguredformultipleredundanciesand
24/7 uptimes.The product,however,like otherproducts of itskind,doesn’tcome configuredthis
wayout of the box,so there are some stepsthatneedto be takento tune itfor your needs.
Thistopic coversthese topicsindetail.Liferayrunsonso manydifferentJavaEE applicationservers
that we can’t coverall the differencesbetweenthem.Forthisreason,we’lldiscussLiferay
configurationsonly.Forexample,we’ll lookathow toconfigure Liferaytoworkina clustered
environment,butnothowto create the clusterinyour applicationserver.The documentationfor
your particularapplicationserverisalwaysamuchbetterplace to learnthose kindsof things.
Thistopic explainshowtoconfigure Liferayforanumberof advancedscenarios,suchas
 Managing LiferaywithLiferayConnectedServices
 Clustering
 DistributedCaching
 DeployingCustomizedversionsof Liferay
 Performance TestingandTuning
Duringthisdiscussion,we’ll mentionanumberof otheropensource productsuponwhichLiferay
reliesformuchof thisfunctionality.These productsall have theirowndocumentationwhichshould
be consultedfora fullerview of whatthese productscando.For example,LiferayusesEhcache for
itscaching mechanism.We’llcoverhowtoconfigure Ehcache toenable cachesinLiferay,butwill
referyouto that product’sdocumentationforfurtherinformationaboutthatproduct.
SometimesLiferaysupportsmultiple productswhichperformthe same function.There are,for
example,several singlesign-onimplementationsyoucanuse withLiferay.We’ll leave ituptoyou to
selectwhichproductbestfitsthe needsof yourprojectwithoutrecommendingone productover
another.
Integrating Existing Users into Liferay
Liferayprovidesanumberof userauthenticationoptions.Youcanconfigure Liferaytoconnectto
LDAP or NTLMserverssousersfrom those environmentscanloginto yourLiferayserver.Youcan
alsoconfigure Liferaytoallowuserstologinvia Facebookor OpenIDaccounts.Liferay’sControl
Panel providesinterfacesforsettingupuserauthenticationusingthe followingservices:
 LDAP
 SSO
 CAS
 Facebook
 NTLM
 OpenID
 Crowd
 OpenSSO
 SiteMinder
 Shibboleth
 SAML
Let’sstart by learninghowtoconnectLiferaytoan LDAP server.
LDAP
You can use the LDAP tab of the Authenticationpage toconnectLiferaytoan LDAP directory.There
are twoplacesfor youto configure the LDAPsettings:here inthe Control Panel orinyourLiferay
server’sportal-ext.propertiesfile.Youcan browse anHTML versionof Liferay’sportal.propertiesfile
online athttp://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html.We recommend
youuse the Control Panel toconfigure LDAPserverconnectionsettingssince yoursettingswillbe
storedinthe database.Note that if youuse both,the settingsinthe database will be mergedwith
the settingsinportal-ext.properties.If there’saconflictoroverlappingdata,the LDAPserver
settingsinthe database take precedence overthe serverssetinthe portal-ext.propertiesfile.
Configuringthe LDAPsettingsfromthe Control Panel iseasieranddoesnotrequire arestartof
Liferay.The onlycompellingreasontouse the portal-ext.propertiesfileisif youhave manyLiferay
nodeswhichneedbe configuredtorunagainstthe same LDAPdirectory.Inthat case,for yourinitial
deployment,itmaybe easiertocopythe portal-ext.propertiesfile toall of the nodessothe first
time theystart up,the settingsare correct.Regardlessof whichmethodyouuse,the available
settingsare the same.
You configure the global valuesfromthe LDAPtab of the Authenticationpage.
Enabled:Checkthisbox to enable LDAPAuthentication.
Required:Checkthisbox if LDAP authenticationisrequired.Liferaywill thennotallow ausertolog
inunlesshe or she can successfullybindtothe LDAPdirectoryfirst.Uncheckthisbox if you wantto
allowuserswithLiferayaccountsbutnoLDAP accounts to loginto the portal.
LDAP Servers: LiferaysupportsconnectionstomultipleLDAPservers.Youcanuse the Add button
beneaththisheadingtoaddLDAPservers.We explainhow toconfigure new LDAPserversbelow.
Import/Export: Youcan importandexportuserdata fromLDAP directoriesusingthe following
options:
 ImportEnabled:Checkthisbox to cause Liferaytodo a massimportfromyour LDAP
directories.If youwantLiferaytoonlysynchronize userswhentheylogin,leavethisbox
unchecked.Definitelyleavethisuncheckedif youare workingina clusteredenvironment.
Otherwise,all of yournodeswouldtrytodoa massimportwheneachof themstartsup.
 Importon Startup Enabled: Checkthisbox to have Liferayrunthe importwhenitstarts up.
Note:Thisbox onlyappearsif youcheck the ImportEnabled box above.
 ExportEnabled:Checkthisbox to enable Liferaytoexportuseraccountsfromthe database
to LDAP.Liferayusesa listenertotrackany changesmade to the User objectandwill push
these changesoutto the LDAP serverwheneverthe Userobjectisupdated.Note that by
defaultoneverylogin,fieldssuchasLastLoginDate are updated.Whenexportisenabled,
thishas the effectof causinga userexporteverytime the userlogsin.Youcan disable this
by settingthe followingpropertyinyourportal-ext.propertiesfile:
 users.update.last.login=false
Use LDAP Password Policy:Liferayusesitsownpasswordpolicybydefault.Thiscanbe configured
on the PasswordPoliciespage of the Control Panel.Checkthe UseLDAPPassword Policy box if you
wantto use the passwordpoliciesdefinedbyyourLDAPdirectory.Once thisisenabled,the
PasswordPoliciestabwill displayamessage statingyouare notusinga local passwordpolicy.You
will nowhave touse your LDAPdirectory’smechanismforsettingpasswordpolicies.Liferay does
thisby parsingthe messagesinthe LDAPcontrolsreturnedbyyourLDAP server.Bydefault,the
messagesinthe LDAPcontrolsthat Liferayislookingforare the messagesreturnedbythe Fedora
DirectoryServer.If youare usinga differentLDAPserver,youwill needtocustomize the messagesin
Liferay’sportal-ext.propertiesfile,asthere isnotyeta GUI for settingthis.See below forinstructions
describinghowtodothis.
Once you’ve finishedconfiguringLDAP,clickthe Savebutton.Next,let’s lookathow to addLDAP
servers.
Adding LDAP Servers
The Add buttonbeneaththe LDAPserversheadingallowsyou toaddLDAP servers.If youhave more
than one,youcan arrange the serversbyorderof preferenceusingthe up/downarrows.Whenyou
add an LDAPServer,youwill needtoprovide several piecesof datasoLiferaycan bindto that LDAP
serverandsearch it for userrecords.Regardlessof how manyLDAPserversyouadd,each serverhas
the same configurationoptions.
ServerName: Enter a name for yourLDAP server.
DefaultValues:Several leadingdirectoryserversare listedhere.If youare usingone of these, select
it andclickthe Reset Values button.The restof the formwill be populatedwiththe properdefault
valuesforthat directory.
Connection:These settingscoverthe basicconnectiontoLDAP.
 Base ProviderURL:This tellsthe portal where the LDAPserverislocated.Make sure the
machine onwhichLiferayisinstalledcancommunicate withthe LDAPserver.If there isa
firewall betweenthe twosystems,checktomake sure the appropriate portsare opened.
 Base DN:This isthe Base DistinguishedName foryourLDAPdirectory.Itis usuallymodeled
afteryour organization.Foracommercial organization,itmaylooksimilartothis:
dc=companynamehere,dc=com.
 Principal: By default,the administratorIDispopulatedhere.If youhave removedthe default
LDAP administrator,youwillneedtouse the fullyqualifiedname of the administrative
credential youuse instead.Youneedanadministrativecredentialbecause Liferaywill be
usingthisID to synchronize useraccounts toand fromLDAP.
 Credentials:Thisis the passwordforthe administrative user.
Thisis all youneedto make a regularconnectiontoan LDAPdirectory.The restof the configuration
isoptional.Generally,the defaultattributemappingsprovide enoughdatatosynchronize backto
the Liferaydatabase whenauserattemptsto login.To testthe connectiontoyour LDAPserver,
clickthe Test LDAP Connection button.
If you are runningyourLDAPdirectoryinSSL mode to preventcredential informationfrompassing
throughthe networkunencrypted,youwill have toperformextrastepstoshare the encryptionkey
and certificate betweenthe twosystems.
For example,assumingyourLDAPdirectoryhappenstobe MicrosoftActive DirectoryonWindows
Server2003, you wouldtake the followingstepstoshare the certificate:
ClickStart→ AdministrativeTools → Certificate Authority.Highlightthe machine thatisthe
certificate authority,right-clickonit,andclick Properties.From the General menu,click View
Certificate.Selectthe Detailsview,andclick Copy To File. Use the resultingwizardtosave the
certificate asa file.Aswiththe CASinstall (seethe below sectionentitled SingleSign-On),youwill
needtoimportthe certificate intothe cacertskeystore.The importishandledbya commandlike
the following:
keytool -import-trustcacerts-keystore /some/path/jdk1.5.0_11/jre/lib/security/cacerts -storepass
changeit-noprompt-aliasMyRootCA -file/some/path/MyRootCA.cer
The keytoolutilityshipsaspart of the JavaSDK.
Once thisis done,goback to the LDAP page in the Control Panel.Modifythe LDAPURL inthe Base
DN fieldtothe secure versionbychangingthe protocol tohttpsand the port to 636 like the
following:
ldaps://myLdapServerHostname:636
Save the changes.Your LiferayPortal will now use LDAPinsecure mode forauthentication.
Users:This sectioncontainssettingsforfindingusersinyourLDAPdirectory.
 Authentication Search Filter: The searchfilterbox can be usedto determinethe search
criteriaforuser logins.Bydefault,Liferayusesusers’email addressesfortheirloginnames.
If you have changedthissetting,youwill needtomodifythe searchfilterhere,whichhas
beenconfiguredtouse the email addressattributefromLDAPasa search criterion.For
example,if youchangedLiferay’sauthenticationmethodtouse screennamesinsteadof the
email addresses,youwouldmodifythe searchfiltersoitcan match the enteredloginname:
 (cn=@screen_name@)
 ImportSearch Filter: Dependingonthe LDAP server,there are differentwaystoidentifythe
user.The defaultsettingisusuallyfine:
 (objectClass=inetOrgPerson)
If you wantto search foronlya subsetof usersor usersthathave differentLDAPobjectclasses,you
can change this.
 UserMapping:The nextseriesof fieldsallowsyoutodefine mappingsfromLDAPattributes
to Liferayfields.ThoughyourLDAPuserattributesmaybe differentfromLDAPserverto
LDAP server,there are five fieldsLiferayrequirestobe mappedforthe userto be
recognized.Youmustdefine amappingtothe correspondingattributesinLDAPforthe
followingLiferayfields:
o Screen Name(e.g., uid)
o Password (e.g., userPassword)
o Email Address (e.g., mailor email)
o First Name(e.g., nameorgivenName)
o Last Name(e.g.,sn)
If you’dlike toimportLDAP groupsas Liferayusergroups,make sure to define amappingforthe
Liferaygroupfieldsothatmembershipinformationispreserved:
o Group (e.g., member)
The other LDAPusermappingfieldsare optional.
The Control Panel providesdefaultmappingsforcommonlyusedLDAPattributes.Youcanalsoadd
your ownmappingsif youwish.
 Test LDAP Users:Once youhave your attribute mappingssetup(see above),clickthe Test
LDAP Users buttonand Liferaywill attempttopull LDAP usersandmatch themwiththeir
mappingsasa preview.
Figure x:TestingLDAPUsers
Groups:This sectioncontainssettingsformappingLDAPgroupstoLiferayusergroups.
 ImportSearch Filter: This isthe filterforfindingthe LDAPgroupsthatyou want to map to
Liferayusergroups.E.g.,
 (objectClass=groupOfNames)
Enter the LDAPgroup attributesyouwantretrievedforthismapping.The followingattributescanbe
mapped.The Group Nameand Userfieldsare required,the Description isoptional.
o Group Name(e.g., cn or o)
o Description (e.g., description)
o User(e.g., member)
 Test LDAP Groups:Clickthe Test LDAPGroups buttonto displayalistof the groupsreturned
by yoursearch filter.
Export: This sectioncontainssettingsforexportinguserdatafrom LDAP.
 UsersDN: Enterthe locationinyourLDAP tree where the userswill be stored.WhenLiferay
doesan export,itwill exportthe userstothislocation.
 UserDefault ObjectClasses: Whena useris exported,the useriscreatedwiththe listed
defaultobjectclasses.Tofindoutwhatyourdefaultobjectclassesare,use anLDAPbrowser
tool such as JXplorertolocate a userand view the ObjectClassattributesstoredinLDAPfor
that user.
 GroupsDN: Enterthe locationinyour LDAPtree where the groups will be stored.When
Liferaydoesanexport,itwill exportthe groupstothislocation.
 Group DefaultObjectClasses: Whena groupis exported,the groupiscreatedwiththe listed
defaultobjectclasses.Tofindoutwhatyourdefaultobjectclassesare, use anLDAPbrowser
tool such as Jxplorerto locate a groupand view the ObjectClassattributesstoredinLDAP
for that group.
Figure x:MappingLDAP Groups
Once you’ve setall youroptionsandtestedyourconnection,click Save.Fromhere,youcanadd
anotherLDAPserveror setjust a fewmore optionsthatapplyto all of your LDAPserverconnections.
LDAP Options Not Available in the GUI
Althoughmostof the LDAP configurationcanbe done from the Control Panel,there are several
configurationparametersthatare onlyavailable byaddingtoyourLiferayserver’sportal-
ext.propertiesfile.These optionsmaybe available inthe GUIin future versionsof LiferayPortal but
for nowtheycan onlybe configuredbyeditingthe propertiesfile.
If you needtochange any of these options,copythe LDAPsectionfromLiferay’sportal.properties
file intoyourportal-ext.propertiesfile.Note thatsince youhave alreadyconfiguredLDAPfromthe
GUI, any settingsfromthe propertiesfile thatmatchsettingsalreadyconfiguredinthe GUI will be
ignored.The GUI, whichstoresthe settingsinthe database,alwaystakesprecedenceoverthe
propertiesfile.
ldap.auth.method=bind
#ldap.auth.method=password-compare
Seteitherbindorpassword-compare forthe LDAPauthenticationmethod.Bindispreferredbymost
vendorssoyoudon’t have toworry aboutencryptionstrategies.Passwordcompare doesexactly
whatit soundslike:itreadsthe user’spasswordoutof LDAP, decryptsit andcomparesit withthe
user’spasswordinLiferay,syncingthe two.
ldap.auth.password.encryption.algorithm=
ldap.auth.password.encryption.algorithm.types=MD5,SHA
Setthe passwordencryptiontousedtocompare passwordsif the propertyldap.auth.methodisset
to password-compare.
ldap.import.method=[user,group]
If you setthisto user,Liferaywill importall usersfromthe specifiedportionof the LDAPtree.If you
setthisto group,Liferaywill searchall the groupsand importthe usersin each group.If you have
userswhodo not belongtoanygroups,theywill notbe imported.
ldap.error.password.age=age
ldap.error.password.expired=expired
ldap.error.password.history=history
ldap.error.password.not.changeable=notallowedtochange
ldap.error.password.syntax=syntax
ldap.error.password.trivial=trivial
ldap.error.user.lockout=retrylimit
These propertiesare alistof phrasesfromerror messageswhichcanpossiblybe returnedbythe
LDAP server.Whenauserbindsto LDAP,the servercan return controls withits response of success
or failure.These controlscontainamessage describingthe errororthe informationthatiscoming
back withthe response.Thoughthe controlsare the same across LDAPservers,the messagescanbe
different.The propertiesdescribedherecontainsnippetsof wordsfromthose messagesandwill
workwithRedHat’s FedoraDirectoryServer.If youare notusingthat server,the wordsnippetsmay
not workwithyourLDAP server.If theydon’t,youcan replace the valuesof these propertieswith
phrasesfromyour server’serrormessages.Thiswill enable Liferaytorecognize them.Next,let’s
lookat the Single Sign-OnsolutionsLiferaysupports.
SSO
Single Sign-Onsolutionsallowyoutoprovide asingle logincredentialformultiple systems.This
allowsyoutohave people authenticatetothe Single Sign-Onproductandtheywill be automatically
loggedinto Liferayandto otherproductsas well.
Liferaysupportsseveral single sign-onsolutions.Of course,if yourproductisnotyetsupported,you
may choose toimplementsupportforityourself byuse of the extensionenvironment.Alternatively,
your organizationcanchoose tosponsorsupportfor it.Please contactsales@liferay.comformore
informationaboutthis.
Authentication: Central Authentication Service (CAS)
CASis an authenticationsystemoriginallycreatedatYale University.Itisawidely-usedopensource
single sign-onsolutionandwasthe firstSSOproduct to be supportedbyLiferay.
Your firststepwill be tocopy the CASclient.jarfile toLiferay’slibraryfolder.OnTomcat,thisisin
[Tomcat Home]/webapps/ROOT/WEB-INF/lib.Once you’vedone this,the CASclientwillbe available
to Liferaythe nexttime youstartit.
The CAS ServerapplicationrequiresaproperlyconfiguredSecure SocketLayercertificate onyour
servertowork. If youwishto generate one yourself,youwillneedtouse the keytool utilitythat
comeswith the JDK.Your firststepis to generate the key.Next,youexportthe keyintoafile.Finally,
youimportthe keyintoyourlocal Java keystore.Forpublic,Internet-basedproduction
environments,youwillneedtoeitherpurchase asignedkeyfromarecognizedcertificateauthority
(suchas Thawte or Verisign) orhave yourkeysignedbya recognizedcertificate authority.For
Intranets,youshouldhave yourITdepartmentpre-configure users’browserstoacceptthe
certificate sotheydon’tgetwarningmessagesaboutthe certificate.
To generate akey,use the followingcommand:
keytool -genkey -aliastomcat-keypasschangeit-keyalgRSA
Insteadof the passwordinthe example (changeit),use apasswordyouwill remember.If youare not
usingTomcat,you may wantto use a differentaliasaswell.ForFirstandLast names,enterlocalhost
or the host name of your server.Itcannot be an IP address.
To exportthe keyto a file,use the followingcommand:
keytool -export-aliastomcat-keypasschangeit-fileserver.cert
Finally,toimportthe keyintoyourJavakeystore,use the followingcommand:
keytool -import-aliastomcat-file %FILE_NAME% -keypasschangeit-keystore
$JAVA_HOME/jre/lib/security/cacerts
If you are ona Windowssystem,replace $JAVA_HOMEabove with%JAVA_HOME%.Of course,all of
thisneedstobe done on the systemonwhichCAS will be running.
Once your CASserverisup and running,youcanconfigure Liferaytouse it.Thisis a simple matterof
navigatingtothe Settings→ Authentication → CAS tabinthe Control Panel.Enable CAS
authenticationandthenmodifythe URLpropertiestopointtoyourCAS server.
Enabled:Checkthisbox to enable CASsinglesign-on.
Import from LDAP: A usermaybe authenticatedfromCASandnotyetexistinthe portal.Selectthis
to automaticallyimportusersfromLDAPif theydonot existinthe portal.
The rest of the settingsare variousURLs,withdefaultsincluded.Change localhostinthe default
valuestopointto yourCAS server.Whenyouare finished,click Save.Afterthis,whenusersclickthe
Sign In link,theywill be directedtothe CASservertosignin to Liferay.
Authentication: Facebook
LiferayPortal alsoenablesuserstologinusingtheirFacebookaccounts.Toenable thisfeature,you
simplyneedtoselectthe Enablebox andenterthe Application IDandApplicationSecretwhich
shouldhave beenprovidedtoyoubyFacebook.FacebookSSOworksbytakingthe primary
Facebookemail addressandsearchingforthe same email addressinLiferay’sUser_table.If a match
isfound,the useris automatically signedon(providedthe userclicked allow fromthe Facebook
dialog).If there isn’tamatch,the userispromptedinLiferaytoadd a user fromFacebook.Once
selected,anewuseriscreatedbyretrievingfourfieldsfromFacebook(firstname,lastname, email
addressandgender).
Authentication: NTLM
NTLM isa Microsoft protocol thatcan be usedforauthenticationthroughMicrosoftInternet
Explorer.ThoughMicrosofthasadoptedKerberosinmodernversionsof Windowsserver,NTLMis
still usedwhenauthenticatingtoa workgroup.LiferayPortal now supportsNTLMv2 authentication.
NTLM v2 ismore secure andhas a stronger authenticationprocessthanNTLMv1.
Enabled:Checkthisbox to enable NTLMauthentication.
Domain Controller:Enter the IPaddressof yourdomaincontroller.Thisisthe serverthatcontains
the useraccounts youwant to use withLiferay.
Domain: Enter the domain/ workgroupname.
Service Account: You needtocreate a service accountforNTLM. Thisaccount will be acomputer
account,not a useraccount.
Service Password: Enterthe passwordforthe service account.
Authentication: OpenID
OpenIDisa newsingle sign-onstandardwhichisimplementedbymultiplevendors.The ideais
multiple vendorscanimplementthe standardandthenuserscan registerforan ID withthe vendor
theytrust.The credential issuedbythatvendorcanbe usedbyall the websitesthat support
OpenID.Some highprofileOpenIDvendorsare AOL, LiveDoor,andLiveJournal.Please seethe
OpenIDsite fora more complete list.
A mainbenefitof OpenIDforthe userishe or she no longerhasto registerfora new account on
everysite inwhichhe or she wantsto participate.Userscanregisteron one site (the OpenID
provider’ssite)andthenuse those credentialstoauthenticate tomanywebsiteswhichsupport
OpenID.Manywebsite ownersoftenstruggle tobuildcommunitiesbecauseendusersare reluctant
to registerforsomany differentaccounts.SupportingOpenIDmakesiteasierforsite ownersto
buildtheircommunitiesbecause the barrierstoparticipating(i.e.,the effortittakestoregisterfor
and keeptrackof manyaccounts) are removed.All of the accountinformationiskeptwiththe
OpenIDprovider,makingitmucheasiertomanage thisinformationandkeepituptodate.
LiferayPortal can act as an OpenIDconsumer,allowinguserstoautomaticallyregisterandsignin
withtheirOpenIDaccounts.Internally,the productuses OpenID4Javatoimplementthe feature.
OpenIDisenabledbydefaultinLiferaybutcanbe disabledhere.
Authentication: OpenSSO
OpenSSOisanopensource single sign-onsolutionthatcomesfromthe code base of Sun’sSystem
AccessManager product.LiferayintegrateswithOpenSSO,allowingyoutouse OpenSSOtointegrate
Liferayintoan infrastructure thatcontainsamultitude of differentauthenticationschemesagainst
differentrepositoriesof identities.
You can setup OpenSSOonthe same serveras Liferayora differentbox.Follow the instructionsat
the OpenSSOsite toinstall OpenSSO.Once youhave itinstalled,create the Liferayadministrative
userin it.Users are mappedback andforth byscreennames.By default,the Liferayadministrative
userhas a screenname of test,so inOpenSSO,youwouldregisterthe userwiththe IDof test andan
email addressof test@liferay.com.Once youhave the usersetup,login to OpenSSOusingthisuser.
In the same browserwindow,gotothe URL for yourserverrunningLiferayandloginas the same
user,usingthe email address test@liferay.com.Gotothe Control Panel andclick Settings→
Authentication → OpenSSO.Modifythe three URLfields(LoginURL,LogoutURL, and Service URL) so
theypointto yourOpenSSOserver(i.e.,onlymodifythe hostname portionof the URLs),clickthe
Enabled checkbox,and thenclick Save.LiferaythenredirectsuserstoOpenSSOwhentheyclickthe
Sign In link.
Using Scripting for Advanced Flexibility
Liferayprovidesarobustscriptengine thatcan be usedto interpretscriptsinBeanshell,Javascript,
Groovy,PythonandRuby. The scriptengine came outof Liferay’sinvolvementwiththe Romulus
project(http://www.ict-romulus.eu).ItwasoriginallydevelopedtosupportnonJava-basedportlets,
but hasnow beenextendedtohandle alotmore.Forexample,whenLiferay’sworkflow framework
was introduced,the scriptenginewasleveragedtosupportthe executionof scriptsfromwithina
workflowmodule.A scriptconsole isnow includedinthe ServerAdministrationportletinthe control
panel.Itallows systemadministratorsaneasywayto execute scriptstoperformrepetitive user
maintenance operations,bulkmanipulationsusingthe LiferayAPItoensure consistency,oreven
systemlevel operations.
Thistopic helpsyoutounderstandLiferay’sscriptengine andcoversthe followingtopics:
 AccessingLiferay’sservice layerfromascript
 Runningscriptsfromthe scriptconsole
 Usingthe scriptengine withworkflow
 LeveragingcustomJavatoolsinthe script engine
The most commonthingyou’ll wanttodo isaccess Liferay’sservices.If youhave anyfamiliaritywith
Liferay’sdevelopertoolsandAPI,thiswill be asnapforyou.
Using Liferay Portal as a collaborative
platform
Many siteshave grownorganically.You mayhave grownyour communitybyusingseparate tools:
firsta forumsapplication,andthenawiki forcollaborative documentation,andmaybe evenachat
application.Itcanbe hard (anderror-prone) tointegrate all theseapplicationssoyouruserscan use
themseamlessly.Thankfully,Liferayincludesasuite of collaborative applications,andthey’reall
integratedtogether.
LiferayPortal offerseverystandardcollaborative applicationthat’savailable.Theseapplications
range from personal productivityapplicationslikeacalendarandemail,tocommunity-building
applicationslikemessageboards,polls,andwikis.
LiferayPortal’smessage boardsare asfullyfeaturedasanystandalone forumapplication,withthe
addedbenefitthatthey’re integratedwiththe restof the system.
Thisis a suite of integratedapplicationswithall the featuresof similar,standalone applications.For
example,LiferayPortal’smessage boardsinclude categoriesandsubcategories,messagethreads,
captcha, RSS feeds,email notification,postingviaemail,andmuchmore.Butmore thanthis,the
applicationsare integratedwiththe restof LiferayPortal’sframework.Userslogin,andtheirprofiles
are usedautomaticallybythe message boardsandall the othercollaborativeapplications.Andas
we’ll see later,functionalityfromthe builtinapplicationscanbe addedtoyour ownto provide
featureslike commentsinyourownsoftware,andyoudon’thave towrite any code to do it.
LiferayPortal’swiki isanotherexampleof afull-featuredcollaborativeapplication.Ithassupportfor
authoringpagesina WYSWYG editor,ormore advanceduserscan use the easy-to-learnstandard
Wiki Creole syntax.Userscancommentonwiki articles,anditkeepsafull historyof everychange
that’sbeenmade,allowinguserstorevertbackto any change.It alsosupportsRSSfeeds(justabout
everyLiferayapplicationdoes)soyoucan subscribe tosee new articlesastheyare posted.Each site
can have one or more wikis,andeachwiki canhave one or more top-level nodes.
One importantfeature of all the collaborativeapplications–aswell aswebcontentanddocuments–
isthe Recycle Bin.If usersdelete contentthatneedstobe restoredlater,youdon’thave tofinditin
your backups:it’sin the Recycle Bin.
The Recycle Bincan holdany kindof content.
We couldgo throughall of LiferayPortal’scollaborativeapplications,butlet’ssave thatforthe body
of the book.LiferayPortal’ssuite of collaborativeapplicationsincludesablog (completewithblog
aggregationfeaturessoyoucan publishmultiple users’blogentriesinone place),achatapplication
for userswhoare online atthe same time,message boards,awiki,aknowledgebase thatyoucan
use to publishalibraryof technical articles,apollingsystemyoucanuse tohave usersvote on
certainquestions,andpersonal productivityapplicationslikeacalendarandemail.
LiferayPortal includeseveryapplicationyou’llneedtoenable userstocollaborate.
Manual Configuration for Sending Mail
You don’thave to use the setupwizardto configure Liferay.The setupwizardbehindthe scenes
createsa configurationfilethatyoucan create manually.Create atextfile calledportal-
ext.propertiesinyourLiferayHome folder.Thisfile overridesdefaultpropertiesthatcome with
Liferay.The firstsettingyou’ll override isthe defaultconfigurationthatpointsLiferaytothe
embeddedHSQLdatabase.
As statedabove,there are twowaysto setup the connection:
 Use the built-inconnectionpool.
 Use yourapplicationserver’sconnectionpool.
Use the setupwizardif you’re usingthe built-inconnectionpool.If youwanttouse your application
server’spool,continuewiththisprocedure.
If you wantto use your applicationserver’s connectionpool,youwill have tocreate one inyour
applicationserverthatpointstoyourdatabase.Itshouldbe calledjdbc/LiferayPool.Tocause Liferay
to use thisconnectionpool,addthe followingdirectivetoyourportal-ext.propertiesfile:
Next,install Liferayaccordingtothe instructionsforyourapplicationserver.Once it’sinstalled,you
can set upthe mail configuration.
For mail,youcan use Liferay’scontrol panel tocreate the configurationandthisisthe
recommendedway.Goto ControlPanel → Server Administration → Mailand enteryoursettingsfor
your mail sessionsettings.If,however,you’resettingupa lotof Liferaymachinesandthey’re all
goingto have similarmail configurations,it’seasiertodothe configurationonce and thencopythe
configurationfiletomultiple machines.Inthiscase,you’ll wanttouse the portal-ext.propertiesfile.
To use the built-inmail session,use the followingpropertiesandcustomizetheirvaluesforyour
environment:
To use your applicationserver’smail session,create itfirst.Thenspecifyitinthe portal-
ext.propertiesfile:
Whenyou’ve finished,save the file. Restartthe Server.
Running Scripts from the Control Panel
To see a verysimple example of the scriptconsole inaction, logintothe portal asan administrator
and navigate tothe control panel → ServerAdministration→ Script.Change the scripttype to
Groovyand modifythe currentcode to looklike the following:
Clickthe execute buttonandcheckthe console orthe log foryour output.
Let’simplementamore realisticexample.We’ll retrieve some userinformationfromthe database,
make some changesand thenupdate the database withourchanges.Ourcompanyhas updatedthe
termsof use andrequiresthateveryone be presentedwiththe updatedtermsof use onthe nextlog
in.Whenusersagree to the termsof use,a Boolean attribute calledagreedToTermsOfUse issetin
theiruserrecords.Aslongas the Boolean istrue,Liferaywill notpresentthe userwiththe termsof
use.However,if we setthisflagtofalse foreveryone,all userswill have toagree toitagainto use
the site.
We’ll againuse Groovy,soensure the scripttype is setto Groovyand execute the followingcode to
checkthe statusof the agreedToTermsOfUse attribute:
Nowwe’ll actuallyupdate eachuserinthe systemtosethisor her agreedToTermsOfUse attribute to
false.We’ll be sure toskipthe defaultuserasthe defaultuserisnotrequiredtoagree to the Terms
of Use.We’ll alsoskipthe adminuserthat’scurrentlyloggedinandrunningthe script.If you’re
loggedinas someone otherthantest@liferay.com,be sure toupdate the followingscriptbefore
runningit.
To verifythe scripthasupdatedthe records,run the firstscriptagain and youshouldsee all users
(exceptthe defaultuserandyourID) have beenupdated.
That’s all that’sneededtorunscriptsand to accessthe Liferayservice layer.There are,however,
some thingstokeepinmindwhenworkingwiththe scriptconsole:
 There isno undo
 There isno preview
 WhenusingLocal Services,nopermissionscheckingisenforced
 Scriptsare executedsynchronously,sobe careful withscriptsthatmighttake a longtime to
execute.
For these reasons,youwanttouse the scriptconsole withcare,andtest runyour scriptson non-
productionsystemsbeforeyourunthemonproduction.
Of course,the scriptengine hasusesbeyondthe scriptconsole.One of the mainusesof itisin
designingworkflows.
Extending and customizing Liferay for your
own needs
BeyondusingLiferayasa developmentplatformfornew applications,LiferayPortal hasalsobeen
designedtobe extendedandmodified.Asanopensource project,itssource code isavailable,but
LiferayPortal’sdevelopershave designedthe producttomake iteasyto buildwhateveryouwant
out of it.
The first(and easiest) wayof customizingpartsof LiferayPortal iswithApplicationDisplay
templates.These letyouchange the waybuilt-inapplicationslook.Forexample,if youdon’tlike the
DocumentsandMediaLibrary’sfile managerview withlarge icons,youcancreate an Application
Displaytemplate thatshowsdocumentsinalistview.If youdon’tlike the layoutof the Blogsportlet,
youcan change itso that it has the lookyouwant.
LiferayPortal goesfarbeyondthis,though.Special software componentscalled hook andextplugins
enable developerstochange anyaspectof Liferay’sinterface andbehavior–withouthavingto
modifyanyof LiferayPortal’ssource code.Thisprovidesyouall the benefitsof buildingyoursite
fromscratch, but withoutall the efforttoactuallybuildfromscratch.If you wantto make a change
to the userregistrationscreens,addsupportfora proprietarysingle sign-onmechanismthatyou’ve
written,adda feature tothe message boardsapplication,oranythingelse,youcanmake those
customizations.Andif you’re adeveloper,we’resure youknow thatit’sa whole loteasierto
customize somethingthatalmostdoesthingsexactlythe wayyouwantthanitis to write that
feature fromscratch.With LiferayPortal,you can have yourcake and eatit too.
FOR MORE REFERENCES VISIT:
https://www.liferay.com/resources
https://dev.liferay.com/develop
https://web.liferay.com/community/forums
https://web.liferay.com/community/wiki
https://web.liferay.com/community/blogs/highlighted
Thank You!!!
For any help contact:
Shikhar Saran Srivastava
shikhar.447@rediffmail.com
8339041831
http://shikhar.honor.es

More Related Content

PDF
Citrix virtual desktop handbook (5 x)
PDF
Refresh the road ahead first 4 chapters
PDF
Ws 2012 white paper hyper v
PDF
Citrix virtual desktop handbook (7x)
PDF
Good sql server interview_questions
PDF
Codendi 4.0 User Guide
PDF
Red hat enterprise_linux-7-system_administrators_guide-en-us
PDF
Information extraction systems aspects and characteristics
Citrix virtual desktop handbook (5 x)
Refresh the road ahead first 4 chapters
Ws 2012 white paper hyper v
Citrix virtual desktop handbook (7x)
Good sql server interview_questions
Codendi 4.0 User Guide
Red hat enterprise_linux-7-system_administrators_guide-en-us
Information extraction systems aspects and characteristics

What's hot (17)

PDF
Sony Xperia XZ2 Premium Manual/User Guide
PDF
Mongo db security guide
PDF
Sugar Crm Manuale25
PDF
Lay out2help
PDF
Creating andrCreating-Android-Applicationsoid-applications
PDF
TEST UPLOAD
PDF
Java web programming
PDF
SafeDNS Content Filtering Service Guide
PDF
Enterprise portal development cookbook
PDF
Drools expert-docs
DOCX
CallQ scope and user specification summary
PDF
Sg246399
PDF
Plesk 8.1 for Windows
PDF
Specification of the Linked Media Layer
PDF
Hacking.pdf
PDF
Castor Reference Guide 1 3 1
Sony Xperia XZ2 Premium Manual/User Guide
Mongo db security guide
Sugar Crm Manuale25
Lay out2help
Creating andrCreating-Android-Applicationsoid-applications
TEST UPLOAD
Java web programming
SafeDNS Content Filtering Service Guide
Enterprise portal development cookbook
Drools expert-docs
CallQ scope and user specification summary
Sg246399
Plesk 8.1 for Windows
Specification of the Linked Media Layer
Hacking.pdf
Castor Reference Guide 1 3 1
Ad

Viewers also liked (17)

PDF
CLAVES PARA DESPLEGAR UNA INTRANET SOCIAL
PPTX
Leveraging social media for admins
PPTX
Mapa conceptual 26 de julio milena villamizar power point
PPTX
Presentación Iriana Colina Seguridad industrial 2 semestre
PDF
How FreeeUp Works
PDF
Artificial Intelligence 06.2 More on Causality Bayesian Networks
PPTX
Digimon leonardo zec & ivan đopar 7.d
DOCX
Peter LaBrash resume
PDF
Getting Started With INBOUND Marketing
PDF
PDF
testimonial
PPT
Cake Phpで簡単問い合わせフォームの作り方
PPT
Introducción a la computacón
PPS
Evolucion De La Ead
PDF
How to prepare for class 12 board exams
PPSX
áGuia azul gracilene pinto
PPSX
A mulher tarcísio costa
CLAVES PARA DESPLEGAR UNA INTRANET SOCIAL
Leveraging social media for admins
Mapa conceptual 26 de julio milena villamizar power point
Presentación Iriana Colina Seguridad industrial 2 semestre
How FreeeUp Works
Artificial Intelligence 06.2 More on Causality Bayesian Networks
Digimon leonardo zec & ivan đopar 7.d
Peter LaBrash resume
Getting Started With INBOUND Marketing
testimonial
Cake Phpで簡単問い合わせフォームの作り方
Introducción a la computacón
Evolucion De La Ead
How to prepare for class 12 board exams
áGuia azul gracilene pinto
A mulher tarcísio costa
Ad

Similar to LiferayDocumentation-Shikhar (20)

PPTX
Liferay portal advantages
PPT
Liferay overview
PDF
2014 Liferay Roadshow Ambientia Finland
PDF
Liferay Road Show Helsinki, What’s New and Upcoming, 2012-09-13
PDF
Liferay administration-guide
PPTX
Liferay Platform Overview
ODP
Liferay with xebia
PDF
Enhancing Digital Experiences with Liferay A Comprehensive Guide to Modern Po...
PDF
Liferay plugin customization to change the behavior in portal
PPTX
Liferay, Search & Customization
PPTX
Life ray training
PDF
Making a decision between Liferay and Drupal
PPTX
Liferay DXP Training
PPTX
Liferay
PDF
Liferay & cloud tools
PPTX
Liferay portal – moving beyond content management
DOC
Balraj Singh
PPTX
Liferay control pannel
PPTX
Presentation-Shikhar
Liferay portal advantages
Liferay overview
2014 Liferay Roadshow Ambientia Finland
Liferay Road Show Helsinki, What’s New and Upcoming, 2012-09-13
Liferay administration-guide
Liferay Platform Overview
Liferay with xebia
Enhancing Digital Experiences with Liferay A Comprehensive Guide to Modern Po...
Liferay plugin customization to change the behavior in portal
Liferay, Search & Customization
Life ray training
Making a decision between Liferay and Drupal
Liferay DXP Training
Liferay
Liferay & cloud tools
Liferay portal – moving beyond content management
Balraj Singh
Liferay control pannel
Presentation-Shikhar

LiferayDocumentation-Shikhar

  • 1. In thisdocumentationyouwill understand all the features and functionalities of Liferay, Social Office and Social Networking so that it will help in collaboratingusersand organization in an efficient and easy way. Liferay With Social Office & Social Networking Shikhar Saran Srivastava shikhar.447@rediffmail.com 8339041831 http://shikhar.honor.es
  • 2. Table of Contents 1. Purpose…………………………………………………………………………………………………………………….5 2. Liferay Portal…………………………………………………………………………………………………………….5 3. What is LiferayPortal CE?.…………………………………………………………………………………………5 4. Installationand Setup…………………………………………………………………………………………….5-6 5. After Downloading/Obtainingwhat to do?.................................................................6 6. UsingLiferay SetupWizard………………………………………………………………………………….…6-7 7. Usingthe Control Panel……………………………………………………………………………………….…7-8 8. What is Social Office?..................................................................................................8 9. InstallingSocial Office………………………………………………………………………………………….…8-9 10. Login into Social Office………………………………………………………………………………………….9-11 11. Installationof Social Office inside LIferayPortal…………………………………………………….…11 12. 2nd Way ofInstallation ofSocial Office inside LiferayPortal………………………...….…...11-12 13. InstallingSocial Networking……………………………………...………………………………………...12-13 14. Liferay Featuresand Functionalities…………………………………………………………….…...….….13 14.1 Users………………………………………………………………………………………………...………………14 14.1.1 Usersand Organizations……………………………………………………...…………….14-15 14.1.2 UserGroups……………………………………………………………………………….……...15-16 14.1.3 Roles……………………………………………………………………………….……………………...16 14.1.4 Password Policies……………………………………………………………………………...……17 14.1.5 Monitoring………………………………………………………………………………………...…...18 14.2 Sites…………………………………………………………………………………………………….…………...18 14.2.1 Sites………………………………….……………………………………………………….…….18-29 14.2.2 Site Template……………………………………………………………………………...…………30 14.2.3 Page Template…………………………………………………………………………...………….30 14.2.4 Site Content……………………………………………………………………………………...30-31 14.2.5 Creatingthe Site Pages……………………………….…………………………….…………...31 14.2.6 Portlets…………………………………………………………………………………………….31-32 14.2.7 Page Permission……………………………………………………………………….……...32-33 14.3 Apps………………………………………………………………………………………………………………...33 14.3.1 App Manager………………………………………………………………………...…………33-34 14.3.2 Store………………………………………………………………………….…………………………34 14.3.3 Purchased……………………………………………………………………….……………………34 14.3.4 PluginsConfiguration………………………………………………………...…………….35-36 14.3.5 License Manager………………………………………………………………………...………...36 14.3.6 OpenSocial Admin…………………………………………………………….…………….36-37 14.4 Configuration………………………………………………………………………………….………………37 14.4.1 Portal Settings………………………………………………………………...………………37-40 14.4.2 Custom Fields……………………………………………………………...………………….40-42 14.4.3 ServerAdministration…………………………………………………………………….42-46 14.4.4 Portal Instances………………………………………………………………….………….46-47 14.4.5 Social Office Configuration………………………………………………………………….47 15. Social Office CE………………………………………………………………………………………….………….47 15.1 What is Social Office?......................................................................................47 15.2 What’sthe difference betweenLiferayPortal and LiferaySocial Office…….47-48 15.3 Social Office PluginsAvailable……………………………………………………………...….48-49
  • 3. 15.4 UsingLiferay as a Social Platform………………………………………………………...….49-51 15.5 How to Use Social Office?..............................................................................51 15.5.1 My Dashboard……………………………………………………………………….……...51-52 15.5.2 CreatingCommunities……………………………………………………….…….……52-53 15.5.3 Descriptionof pre-definedpages…………………………………….…………………53 15.5.3.1 Dashboard………………………………………………………...…………….53 15.5.3.2 Calendar………………………………………………………………...……….54 15.5.3.3 My Documents…………………………………………………………….54-55 15.5.3.4 Forums……………………………………………………………….………...….55 15.5.3.5 Blog………………………………………………………….………………...55-56 15.5.3.6 Wiki………………………………………………………….………...…………...56 15.5.3.7 Contacts Center……………………………………….………….……...56-57 15.5.3.8 Chat……………………………………………………….……….…….………...57 15.5.3.9 Messages………………………………………………….…...…….……57-58 16. WokingSmart with LiferaySocial Office………………………………………………………….58-59 17. Upgradingyour LiferaySocial Office Version………………………………………………...……...59 17.1 Upgradingfrom Social Office version2.x to 3.x……………………………….…………...59 17.2 Upgradingfrom Social Office 3.0.0. to 3.0.1…………………………………………………60 18. Some Out of the Box Features…………………………………………………………………………….60 18.1 AccessingLiferay Services………………………………………………...……………….……….60 18.2 Beanshell…………………………………………………………………………………….………….60-61 18.3 Groovy………………………………………………………………………………………………………...61 18.4 JavaScript……………………………………………………………………………………………….61-62 18.5 Ruby…………………………………………………………………………………………….……………...62 18.6 Python………………………………………………………………………………………………….…….62 19. Authoring the basic content……………………………………………………………………...………...62 19.1 CreatingContent the simple way………………………………………………………………...63 19.2 RICH, WYSIWYG Editing…………………………………………………………….…………...63-66 19.3 Creatinga displaypage……………………………………………………………….…………66-68 20. ConfiguringAdditional PortletSettings………………………………………………………………68 20.1 USERS……………………………………………………………………………………………………68-69 20.2 Mail host names………………………………………………………………………………………...69 20.3 E-Mail Notifications……………………………………………………………………….……...69-71 20.4 ContentSharing……………………………………………………………………………….………...71 20.5 Identification………………………………………………………………………………………….….71 20.6 Miscellaneous:DisplaySettings………………………………………………...………….71-73 21. ConfiguringLiferayfor high availability…………………………………………………….……….73 22. Integrating ExistingUsersinto Liferay………………………………………………………….……73 22.1 LDAP…………………………………………………………………………………………………....74-80 22.2 OpenSSO…………………………………………………………………………………………………...80 22.3 Authentication:Central AuthenticationService (CAS)…………………….…….80-81 22.4 Authentication:Facebook…………………………………………………………………….……81 22.5 Authentication:NTLM……………………………………………………………………………81-82 22.6 Authentication:OpenID………………………………………………………….……………….82 22.7 Authentication:OpenSSO…………………………………………………………………….82-83 23. UsingScripting for AdvancedFlexibility……………………………………………….…………….83 24. UsingLiferay Portal as A Collaborative Platform…………………………………….………84-85 25. Manual Configurationfor SendingMails…………………………………………………….….85-86
  • 4. 26. Running Scripts from the control panel………………………………………………………….86-88 27. Extendingand CustomizingLiferayfor your own needs………………………………………88
  • 5. Purpose The purpose of thisdocumentisto equipthe readerwiththe basicsetuprequiredbefore youstart the basic setuprequiredbefore youstartthe developmentforthe Aakari3 InternshipProgram.As far as possible there are linksandimagesshowninthe document,however due toversionupdates there mightbe some differenceswhichwillhave tobe managedbythe reader.If there is anykindof difficultyfacedpleasepostittoi3-internship-discuss@aakaronline.com . Liferay Portal LiferayPortal isan enterprise webplatformforbuildingbusinesssolutionsthatdeliverimmediate resultsandlong-termvalue. What is Liferay Portal CE? LiferayPortal CE isthe opensource versionof Liferay'senterprise webplatformforbuildingbusiness solutionsthatdeliverimmediate resultsandlong-termvalue.Itstartedoutasa personal developmentprojectin2000 and wasopensourcedin2001. Since then,LiferayPortal CE'spopularityhasskyrocketed,boastingover4milliondownloadsinits lifetimeandwide acclaimfromindustryexpertstodeveloperstobusinessusers. The projectis still thrivingwithavibrantcommunityof over45,000 thatcontributestothe growth and developmentof the platform. Installation and Setup LiferayPortal isone of the mostflexible applicationsonthe markettodaywithregardto application serverenvironments.Youcan install LiferayPortal oneverythingfromasharedTomcat installation to a multi-node clusterrunningacommercial applicationserverandoneverythinginbetween.In fact, Liferayisusedsuccessfullyinall of these scenarioseveryday. You’ll findthatbecause Liferayisextremelyflexible initsdeploymentoptions,itiseasytoinstall as well.If youalreadyhave anapplicationserver,youcanuse the toolsfordeploymentthatcame with your applicationserver.If youdon’thave anapplicationserver,Liferayprovidesseveral application serverbundlesfromwhichtochoose.These are veryeasytoinstall andwitha small amountof configurationcanbe made intoproduction-readysystems. The CE versionof Liferayisfreelydownloadable fromourwebsite at http://www.liferay.com.Click the Downloads linkatthe topof the page andyou are presentedwithmultipleoptionsforgettinga copy of Liferay,includingourconvenientbundlesora.war package for installationonyour applicationserverof choice. The EE versionof Liferayisprovidedtoyouasa resultof yoursupportsubscription.Everythingyou needisprovidedinthe CustomerPortal,includingdownloadlinksthatallow youtoobtaina copy of a Liferaybundle ora .war package for installationonyourapplicationserverof choice.
  • 6. So whatis a bundle anyway?A bundle isanopensource applicationserverwithLiferaypreinstalled. Thisis the mostconvenientwaytoinstall Liferay.Liferayisbundledwithanumberof opensource applicationservers;all youneedtodois choose the one that bestfitsyourneeds.If youdon’t currentlyhave anapplicationserver,youmaywantto start withthe Tomcat bundle,asTomcatis one of the smallestandmoststraightforwardbundlestoconfigure.If youhave anopensource applicationserverpreference,choose the serveryoupreferfromthe available LiferayPortal bundles.All of the bundlesshipwithaJavaRuntime EnvironmentforWindows;if youare usinga differentoperatingsystem,youwill needtohave a JDK(Java DevelopmentKit) installedpriorto launchingLiferay. Please note thatLiferayisnotable to provide applicationserverbundlesforproprietaryapplication serverssuchas WebLogicor WebSphere,becausethe licensesforthese serversdon’tallow for redistribution.LiferayPortal,however,runsjustaswell onthese applicationserversasitdoeson opensource applicationservers.A .warfile anddependency.jarsare providedforproprietary applicationserversand you’llneedtofollow aprocedure toinstall Liferayonthem. After Obtaining/Downloading what to do? 1. Extract it to a particularlocation. 2. There are 2 ways to runthe tomcat server,checkoutboth: 3. Before runningityouhave to setupjavaenvironmentinyoursystem. 4. For that downloadjavafromthe java.com. 5. NowRightclickon the This PCicon onthe DesktopandGo to Properties->AdvancedSystem Settings->EnvironmentVariables… 6. Clickon New…->Give name JAVA_HOME->Thengive the directorypathof java. Example:C:ProgramFilesJavajdk1.7.0_25 7. Clickon New…Again->Give name CATALINA_HOME->Thengive the directorypathof Liferay Tomcat directory(where youhadextractthe Liferay). Example:D:liferay-portal-6.2-ce-ga5tomcat-7.0.62 8. Nowthere are 2 waysto run Liferay: 9. Go to cmd (CommandPrompt) &type commands:%CATALINA_HOME%binstartup.batrun 10. Go to extractedLiferaydirectory:liferay-portal-6.2-ce-ga5->tomcat-7.0.62->bin->startup.bat 11. It will take about5minto start the serverafterthat go to yourbrowserand type: localhost:8080 NowYour Liferayisreadyto use. Using Liferay Setup Wizard To make it easyto configure Liferayoptimallyforyouruse,the firstthingyousee whenbrowsingto your newlyinstalledLiferaybundleisasetupwizard.Thisgivesyoua convenientwaytoconfigure Liferayforyour purposes.
  • 7. There are three sectionsof the wizard:the portal,the administratorandthe database.Forthe portal,youneedto supplythe followinginformation: Portal Name: the name of the website you’re poweringwithLiferay.Inthisbook,we’llbuildasocial networkforyournose.This site iscalledNosestersowe’ve suppliedNosesterinthe screenshot below. DefaultLanguage: choose the defaultlocale where yoursite resides. For the administrator,youneedtosupplythe followinginformation: First Name:the firstname of the user that hasthe administratoraccount. Last Name:the lastname of the userthat has the administratoraccount. Email: the email addressof the userthat has the administratoraccount. LiferayisReadyto use Now.(Don’t change the username:test@liferay.com& Password: test) Using The Control Panel Reach the control panel byclickAdmindropdown:Admin->Control Panel. The Control Panel is organizedinfourmainareas:Users, Sites,Apps,andConfiguration.The optionsinthe Configuration sectionof the Control Panel categoryinclude configurationoptionswhichcontrol how the portal operatesandintegrateswithothersystemsyoumayhave.Inthistopic,we’ll coverthe following topics:
  • 8.  Portal settings,suchasuser authenticationoptions,mail hostnames,emailnotifications, identificationsettings,anddisplaysettings  Customfields  Serveradministrationoptions,includingoptionsforresources,loglevels,properties, CAPTCHA,datamigration,file uploads,mail,external services,scripts,andshutdown settings  Portal instances Afteryouhave createdusers,usergroups,organizations,roles,sites,andteamsyourportal will be readyto host contentandapplications.Youcanconfigure Liferay’sportal settingstofityour environmentandyourparticularportal project.It’seasyto adjustconfigurationsettingsusingthe portlet-drivenuserinterface of Liferay’Control Panel.Let’sstartbyexaminingLiferay’sPortal Settings. What is Social Office? Introduction Social Office isateam workspace productthatcombinescollaborationandsocial networking featuresina single package designedforenterprises.Itisanend-usersolutionwithaspecific functionandpurpose outof the box.Ithas beenbuiltusingLiferay Portal asitsfoundation. Use Case  SharedWorkspacesforoffice teamstocollaborate.  Documentsharing.  Social networkinginanenterprise(Enterprise socialcomputing). Installing Social Office Here are some quickinstructionsonhow toinstall LiferaySocial Office v1.X. Thisis specificallyfor windowsbutitwill alsorunon otheroperatingsystems. If you wantto install Liferay2.0,please refertothe userguide: http://www.liferay.com/documentation/social-office/2.0/user-guide Windows 1. Downloadandsave the desiredbundle from http://www.liferay.com/web/guest/downloads/social_office 2. Double click the icon on the desktop and install Social Office using all default values.
  • 9. 3. Once it is installed, click start then programs then Liferay social office and then start in order to run social office. Login 1. When prompted,signinusingthe defaultuseridandpassword. . userid: admin . password:admin
  • 10. 2. You will be askedtochoose a passwordreminder.There isalsoanoptiontocreate yourown. 1. You are thentakento the home page and can begincollaboratingusingall of the great features!
  • 11. This was the installationof Social Office outside the Liferayportal. Installation of Social Office Inside Liferay Portal 1. Go to Control Panel. 2. Clickon Store 3. Inside Store SearchSocial Office. 4. Clickon Social OFFICECE. 5. Purchase itfrom marketplace. 6. AfterpurchasingitGo to Control Panel->Purchased 7. Inside PurchasedSelectSocial Office CEandinstall it. 8. Afterthat Go to Control Panel->Social Office Configuration. 9. Here Selectthe userYou wantto assignthe Social Office toforfirsttime usersassignitfor Joe Blogs(Admin). 10. ClickSave & Nowyou can enjoysocial office. 2nd way of Installing Social Office inside Liferay Portal 1. Go to https://www.liferay.com 2. Go to marketplace andsearchSocial Office CE. 3. Afterfindingitpurchase it,goto purchased& itwill take toyou to the Social Office page where youcan downloadlatestversionof Social Office. 4. A SocialOffice.lpkgwillbe downloadedtoyoursystem. 5. Nowgo to yourcontrol panel of Liferayandthengo to AppManager.
  • 12. 6. There youwill see install tabthere youjustuploadthe downloadedSocialOffice.lpkg. 7. Wait 1 min andthendo the step8-10 of above processes. Installing Social Networking What is Social Networking? Since the first social networks rose to popularity, concepts such as Friend and later Like– previously reserved for direct human interaction–have taken on new meaning in an always- online, information driven culture. It could be argued that social networks have transformed the way people interact with their friends, relatives and colleagues. Friends, connections, followers, circles and lists have enabled people to connect and stay connected in ways they’d never been able to before. Initially, these concepts proved to be highly successful for casual web sites but they didn’t take to the business world as quickly. But many organizations are now realizing the importance of leveraging social interactions for more than just recreation. Liferay’s robust social features make it a great platform for business web sites, casual web sites and everything in between. Social applications have many differences when compared to Standard applications that are vital to a social networking site. Standard applications have general and user specific data, whereas social applications can share data within a defined network. This variation is a huge advantage when trying to communicate important information to a large group of people. This difference in communication settings is illustrated below: Figure 6: The graphic above demonstrates Standard Apps vs. Social Apps. Liferay has a constantly improving set of social features which enable you to encourage social interactions on your own portal and to leverage the power and popularity of other social networks. In this topic, we’ll discuss:
  • 13.  General use social portlets  Social portlets for personal pages  Configuring personal pages for social networking  How to connect users using Liferay social relations  Social equity  Integrating Liferay with other social sites When we’re finished, you’ll be well equipped to use Liferay to power your social network. Installing Social Networking Same as 2nd wayof Social Office CE. SearchSocial NetworkingCEinsteadof Social Office CE. Liferay Features and Functionality Go to Control Panel youwill see 4options: 1. Users 2. Sites 3. Apps 4. Configuration NowI will give the tourof all functionalities LiferayOffers:
  • 14. 1. Users 1.1 Users and Organizations In the figure youcan see there are 3 tabsbrowse,All Organizations,All Users. Inside the browse tabClickonAdddropdown& choose the optionyouwantto add: Like Useror RegularOrganization If you choose User, it will take youtothe new page:
  • 15. Enter the Detailsandclicksave the userwill be addedinthe portal. If you choose RegularOrganization, itwilltake youthe new page: Enter the details andthe Organizationwill be added. In the browse sectionyoucansee addedUser andOrganizationsyouhave added. The 3rd optionExportUsers will generate the userslistinthe excel sheet(.csv)format. 1.2 User Groups User groupsprovide away to groupusersindependentlyof the organizationsto whichtheybelong.Administratorscandefine ausergroupand assignthe user groupas a memberof a site to make all of its user’smembersautomatically. Clickon Additwill take youthe new page:
  • 16. Afterenteringthe details, the usergroupwill be created. 1.3 Roles Rolesare groupingsof usersthat share a particularfunctionwithinthe portal, accordingto a particularscope.Administratorscanaddroleswhichcan be grantedpermissionstovariousfunctionswithinportletapplications. You can add a newRolesaccordingto yourneedbutthere isno needof adding roles,predefinedrolesare sufficient. In orderto change or editany permissionof rolesclickonActionsoption youcan change accordingto your need.
  • 17. 1.4 Password Policies Passwordpoliciesdefine enterprise level securitymeasureswhichinclude user lockoutandpasswordexpiration.Administratorscandefine policiesordelegate to an LDAP server. DefaultPassword isgivenasyoucan see inthe figure. You can add newpasswordpolicyif there isrequirement. Or you can change existingDefaultPasswordPolicybyclickingActionsoption: You can change the passwordpolicyaccordingtoyourneedyouwant inthe LoginProcess.
  • 18. 1.5 Monitoring Monitoringallowsyoutosee all of the live sessionsinthe portal.For performance reasons,thissettingisgenerallyturnedoff inproduction. 2. Sites 2.1 Sites Sitesare a set of pagesthat displaycontentandprovide accessto specific applications.Sitescanhave members,whichare givenexclusiveaccessto specificpagesorcontent. Withmost products,youwouldlearnwhatthe software cando interms of settingupyourusersand securitymodel andthenstartbuildingyoursystem. You’ddesignyourinfrastructure andgetyourserverenvironmentupand runningwhile yourdeveloperswritethe applicationsthatlive onyourwebsite. WithLiferayPortal,however,youstartfartherahead.LiferayPortal ismore than justa containerforapplicationswitharobustsecuritymodel.Italreadyincludes manyof the applicationsyou’llneed,outof the box,readyto goand integrated withall the usermanagementandsecurityfeaturesyou’ve alreadylearned about. Nearlyall Liferayusers use Liferay’sWebContentManagementsystem(WCM). Afterall,all everywebsite hascontentthatneedstobe managed.Liferay’s WCM empowersyoutomanage all the contentonyour site quicklyandeasily withinyourbrowser.Beyondmanagingexistingcontent,LiferayWCMletsusers easilycreate andmanage everythingfromasimple article containingtextand imagestofullyfunctional websites.Webpublishingworksalongside Liferay Portal’slargercollectionof applications,whichmeansyoucanaddshoppingcart functionality,visitorpolls,webforms,sitecollaborationtoolsandmore. Everythingisdone withourcollectionof easy-to-use toolswithfamiliarrich-text editorsandan intuitive interface. In thissectionwe’ll coversome basicaspectsof LiferayWCM,including: Page Types Layouts Page andcontentpermissions Importingandexportingcontent Contentcreationandediting Contentpublishing WCM Workflow By the time we’re done,youshouldbe able toapplyall these conceptstoyour owncontent.To demonstrate Liferay’sContentManagementfeatures,we’ll create and manage contenton the portal for Nose-ster,anew social network where people are connectedbasedonwhattheirnoseslooklike.
  • 19. For creatingsitesclickonAddbutton& choose whattype of site youwant to create: Let’stake a example of creatingaBlankSite: Enter the relevantdetailsandclickonsave page Creating and Managing Pages
  • 20. You have a fewoptionsforaccessingthe page creationinterface.Tosimplifythis,we’ll coverthe Dockbar’s Managemenuslightlyoutof order.There are twointerfacestobe aware of: Site Pages andPage.You can get to these frommultipleplaces.Dependingon whatyou’re editingandwhere youare onthe portal,you’ll use eitherthe Managemenu or the Control Panel towork withyourpages.Fromthe Control Panel,make sure you have the correct site selectedinthe contextmenuselectorandclickthe Site Pages link inthe contentsection.If you’ve alreadynavigatedtothe site youwishtomanage,click Managefromthe Dockbarand select Site Pages.Thisisthe exactsame interface yousee inthe Control Panel.Tomanage the specificpage of the site you’ve navigatedto,click ManageandselectPage. For convenience,youcanalsonavigate tothe Sitespage underthe Portal sectionof the Control Panel andclick Actions → ManagePages.Toquicklyaddasingle page while to the site you’re browsing,click Add fromthe Dockbarandselect Page.Justentera name for the page and it’saddedimmediately.Clickthe name of the page inthe navigation menuto visititandstart workingon it.
  • 21. Site Pages isan interface toview existingpages,create new pages,view pagesand exportor importpagesusingLiferayArchive (LAR) files.Note thatyoucanswitch betweenmanagingasetof pagesand managinga single page usingthe left-handside navigationmenu.Clickon PublicPages orPrivate Pages tomanage the groupor clickon an individualpage tomanage justthat one.Switchingviewslike thischangesthe listof available tabstothe right.By default,liferay.com, whichwe renamedtonosester.com, containsa single publicpage called Welcome. Liferay’spage groupsare alwaysassociatedwithsites.Evenusers’personalpagesare part of theirpersonal sites.All pagesbelongtoone of twotypesof page sets:public pagesand private pages.Bydefault,publicpagesare accessible toanyone,even non- loggedinusers(guests).Private pagesare accessible onlytouserswhoare membersof the site whichownsthe pages.Thismeansthe private pagesof an organization’ssite wouldonlybe viewable bysite membersandmembersof the organization. Regardlessof whetherthe pagesare publicorprivate,Liferayusesthe same interface to manage them.Let’slookat thisinterface more closely. More Page Management Tools From the Manage Site Pagesdialogbox,youcanadd a page to the site byclickingthe Add Pagebutton.Because PublicPages isselectedonthe left,clicking Add Pagehere adds a top level page nexttothe Welcome page.Youcan, however,nestpagesas deeplyasyoulike.Tocreate a sub-page underthe Welcome page,selectthe Welcome page firstand thencreate your page.If youlater decide youdon’tlike the orderof your pages,youcan drag and drop theminthe listto put theminwhateverorderyouwant. Let’sgo aheadand add anothertoplevel page andname it Community.We’ll use this page for the RecentBloggersandWiki portlets. Whenyoucreate a newpage,youcan create eitherablankpage or a page prepopulated withportletsfroma page template.Whenyou’re enteringthe name of the page,you can selectfroma listof page templates thatare currentlyavailable.Toview the pages
  • 22. once you addthem,clickthe View Pages button.Thisishow you’dpopulate yourpages withcontentandapplications. If you’re usingthe Manage Pagesinterface tocreate a new page,you’ll have some additional optionstocreate differenttypesof pages.There are PortletPages,Panel Pages,EmbeddedPages,URL Pagesand Link to Page. By default,all pagesare created as portletpagesbutin some situationsyoumightwanttouse one of the otheroptions. PortletPages are the pageswe’re usuallytalkingabout.Theyhave alayoutwhichyou can drag and drop portletsinto.Mostof the pagesyoucreate will be portletpages. Panel Pages can have any numberof portletsonthem, asselectedbyanadministrator, but onlyone will be displayedatatime.Usersselectwhichportlettheywanttouse froma menuonthe leftside of the page and the selectedportlettakesupthe entire page. EmbeddedPages displaycontentfromanotherwebsiteinside of yourportal.An administratorcanseta URL frominthe page managementinterface andthatpage will appearin the contextandwithinthe navigationof yourLiferayportal. URL Pages are justredirectstoany URL specifiedbyanadministrator.Youcanuse URL pagesto create linkstopagesbelongingtoothersitesof yourportal or to pagesof an external site.Use URLpagescautiouslysince blindredirectscreate apooruser experience. Link to Page createsa portal page whichfunctionsasan immediateredirecttoanother page withinthe same site.Youcan selectwhichpage tolinkto froma dropdowninthe page managementinterface.Youcoulduse a Link to Pageto place a deeplynestedpage inthe primarynavigationmenuof yoursite,forexample. Once you’ve created pagesandpopulatedthemwithcontent,Liferayprovidesawayfor youto back themup to separate files.Let’sseehow thatworks. Backing Up and Restoring Pages Nexttothe Add Pagebuttoninthe Manage Site Pagesscreenare twobuttonslabeled Exportand Import.The Exportbuttonexportsthe pagesyoucreate intoa single file, calleda LAR (LiferayArchive).Youcanthenimportthisfile intoanyserverrunning Liferaytore-create the pages.If youhave a LAR youwouldlike toimport,use the Import button.ExportingandImportingLARsisa great wayto take contentfromone environment(say,adevelopmentorQA environment)andmove itall inone shotto your productionserver.Note thatyoushouldnotmake thisaregularoccurrence.If you
  • 23. wantto regularlymove pagesfromone servertoanother,youshoulduse Liferay’s stagingenvironment. LARs are also a goodway to back up yoursite’scontent.Youcan exportthemtoa specificlocationonyourserverwhichisbackedup,andif you everhave torestore your site,all youneedtodo isimportthe latestLAR file.One limitationonLARfiles,however, isthat theyare versiondependent,soyoucan’tuse an exportfroman oldversionof Liferayandimportit intoa newerversion. Let’sbe good administratorsandexportaLAR file forbackuppurposes.Clickonthe Exportbuttonand thenname the file nosesterv1.lar.Use the checkboxestodetermine whatyou’dlike toexport.Forthisinitial export,selecteverything.Notethatif youselect the More Options link,the listexpandstoinclude datafrommanyof Liferay’s applications,includingthe DocumentsandMediaLibrary,Message BoardsandWeb Content.Youcan also exportthe theme you’re using. Once you click Export,yourbrowserpromptsyouto save the file.Once youhave the file, youcan copyit to a backup locationforsafekeepingorimportitintoanotherinstallation of LiferayPortal.If youmustrebuildorwishtorevertback to thisversionof yoursite, youcan importthisfile byclicking the Importbuttonfromthe Manage Site Pagesdialog box,browsingtoitand selectingit. Next,we’ll lookatthe optionsonthe rightside menu,startingwithLookand Feel. Customizing the Look and Feel Whenyouopenthe Manage Site Pagesdialogbox itdefaultstothe Lookand Feel tab. On thistab,you’re presentedwithaninterface thatallowsyoutochoose a theme for the current site.Themescantransformthe entire lookof the portal.Theyare createdby developersandare easilyinstalledusing the LiferayMarketplace.Since we don’thave any themesbeyondthe defaultone installedyet,we’ll use the defaulttheme forour pages.
  • 24. Many themesinclude more thanone colorscheme.Thisallowsyoutokeepthe existing lookand feel while givingyour site adifferentflavor.Changethe colorscheme fromblue to greenbyselecting Green underColorSchemes.If younow go back to the site (by clickingBackto yoursitename.cominthe topleftcornerof the Control Panel),you’ll see some parts of the page are now tingedina greenishhue. If you applya color scheme toa setof publicorprivate pagesitis, bydefault,appliedto each page inthe set.If, however,youopenthe Manage Pagesdialogbox fora particular page,youcan select Definea specific look and feel forthis page to make the color scheme applytothispage only.You can use thisfeature tochoose a differentcolor scheme fora particularpage than the one definedforthe setof publicor private pages to whichitbelongs. There are a fewmore configurable settingsforyourtheme.Youcanswitchthe bullet style betweendotsandarrowsand youcan choose whetherornot to show portlet bordersbydefault. Alsonotice themescanapplytoregularbrowsersor mobile devices.Youcouldcreate anothersite formobile usersattachedtothe http://m.yoursitename.com addressand serve upa page designedforthe smallerscreensonphones. The CSS sectionallowsyoutoentercustomCSSthat will also be servedupbyyour theme.Inthisway,youcan tweaka theme inreal time byaddingnew stylesor overridingexistingones. The nextoptionconfiguresthe logothatappearsforyoursite. Using a Custom Logo If you wantto use your ownlogofor a specificsite,use the Logotab.Addinga custom logoiseasy:selectthe Logo tab andbrowse to the locationof your logo.Make sure your logofitsthe space in the top leftcornerof the theme you’re usingforyourwebsite.If youdon’t,you couldwindup witha site that’sdifficulttonavigate,asotherpage elementsare pushedaside tomake wayforthe logo. In the logotab, youcan also choose whetherornotto displaythe site name onthe site. If you checkthe box labeled Show SiteName, the site name will appearinthe topright corner of the page.This optionisenabledbydefaultandcannotbe disabledif they Allow Site Administratorsto settheir own logo optionisdisabledin PortalSettings.Itis alsonot available forthe default site–onlynewlycreatedsitesanduserpageshave the optiontohave the name display. JavaScript If you clickon JavaScriptfromthe Site Pagesinterface forapage set(eitherPublicPages or Private Pages),you’llfindawindow where youcanenterJavaScriptcode the will be executedatthe bottomof everypage inthe site.If your site’stheme usesJavaScript(as isusuallythe case),it’sbesttoadd customJavaScriptcode to the theme and notinthis window.Thisway,all of yoursite’sJavaScript code remainsinone place. Usingthe JavaScriptwindow of yoursite’sSite Pagesinterface maybe usefulif your site’stheme does notuse JavaScript.Inthiscase,the JavaScriptwindow of yoursite’s Site Pagesinterface will contain allof your site’s JavaScriptandyoucan add some dynamicfeaturestoyoursite’spages.
  • 25. Next,let’slookatanadvancedfeature of the Site Pagesinterface:mergingthe current site’spageswiththe pagesof the defaultsite. Advanced If you clickon Advanced fromthe Site Pagesinterface forapublicpage set,you’ll findan optiontomerge the publicpagesof your portal’sdefaultsite withthe publicpagesof the current site.If youenable thisoption,the pagesof the defaultsite appearinthe currentsite’snavigationbar,alongwiththe currentsite’spages.Also,the pagesof the currentsite appearin the navigationbarof the defaultsite,alongwiththe defaultsite’s pages.This“merging”of pagesonlyaffectsthe listof pagesinthe defaultsite’sandthe currentsite’s navigation bars.Thisallowsuserstomore easilynavigatefromthe current site to the defaultsite,andvice versa.Thisoptioncanbe enabledforthe publicpagesof bothpersonal sitesandregularsites. Note that this“merging”of pagesisnot a “hard merge”.For example,supposethatthe site administratorsof twentydifferentsitesonyourportal all enabledthe Mergedefault site’s publicpages’ option.Wouldthe pagesof all these differentsitesbe mergedinto each site’snavigationbar?No,thatwouldmake a mess!Instead,the portal keepstrack of the currentscopeGroupId(the IDof the currentsite) andthe previousscopeGroupId (the ID of the previouslyvisitedsite).If the Mergedefaultsite’spublic pages optionis enabledforeitherthe currentsite orthe previoussite,the pagesof the defaultsite are mergedinthe pagesof the othersite. For example,suppose thatyourportal hasthree sites:the defaultsite,site A,andsite B. All three siteshave some publicpages.Site A hasthe Mergedefaultsite’s public pages optionenabled,siteBdoesnot.Whena userfirstlogsin,he’sdirectedtothe default site.The scopeGroupIdisthat of the defaultsite andthere isnopreviousscopeGroupId, so no additional pagesappearinthe defaultsite’snavigationbar.Thensuppose the user navigatestosite A.Site A hasthe Mergedefaultsite’spublic pages optionenabled,so the defaultsite’spagesare addedtosite A’snavigationbar.Now if the usergoesback to the defaultsite,site A becomesthe previoussitesosite A’spagesare addedto the defaultsite’snavigationbar.If the usernavigatestosite B,no additional pagesappearin site B’snavigationbarbecause site Bdoesnot have the Merge defaultsite’spublic pages optionenabled.Andif the usernavigatesbacktothe defaultsite,siteBbecomesthe previoussite,and,again,since site Bdoesnothave the Mergedefaultsite’s publicpages optionenabled,noadditional pagesare addedtothe defaultsite’snavigationmenu. Next,let’sexaminehowtoconfigure individual pages. Changing Options for Individual Pages Whenyouselecta single page,some differentoptionsappear.Let’slookatwhatthese do. Details:letsyouname the page for anylocalizationsyouneed.Youcan alsosetthe HTML title thatappearsin the browserwindow forthe page. Plus, youcanset an easyto remember,friendlyURLfor the page. SEO: providesseveral meansof optimizingthe datathe page providestoanindexer that’scrawlingthe page.You can setthe variousmetatags fordescription,keywords and robots.There’salsoa separate Robotssectionthatletsyoutell indexingrobotshow frequentlythe page isupdatedandhow itshouldbe prioritized.If the page islocalized,
  • 26. youcan selectabox to make Liferaygenerate canonical linksbylanguage.If youwantto setsome of these settingsforthe entire site,youcanspecifythemfromthe Sitemaps and Robotstabs of the Manage Site Settingsdialogbox (seebelow). Look and Feel:letsyouseta page-specifictheme. Layout: letsyouspecifyhow portletsare arrangedona page.Choose fromthe available installedtemplatestomodifythe layout.It’sveryeasyfordeveloperstodefinecustom layoutsandadd themto the list.Thisiscoveredmore thoroughlyinboththe Liferay Developer’sGuide and inLiferay in Action. JavaScript: givesyouthe abilitytopaste customJavaScriptcode tobe executedonthis page. Custom fields:If customfieldshave beendefinedforpages(whichcanbe done fromthe CustomFields page of the Control Panel),theyappearhere.These are metadataabout the page andcan be anythingyoulike,suchasauthor or creationdate. Advanced: containsseveral optional features.Youcanseta querystringto provide parameterstothe page.Thiscan become useful towebcontenttemplates.Youcanset a target forthe page so that iteitherpopsupin a particularlynamedwindow orappears ina frameset.Andyoucanset an iconfor the page that appearsinthe navigationmenu. Mobile Rule Groups:allowsyouto applyrulesforhow thispage shouldbe renderedfor variousmobile devices.Youcan setthese upinthe MobileDevice Rules sectionof the Control Panel. CustomizationSettings:letsyoumark specificsectionsof the page youwantuserstobe able to customize. Note that the Manage→ PageLayout menudirectsyoutothe same Layout tab that’sin Manage→ Page Modifying Page Layouts Page layoutsallowyoutoarrange yourpagesso the contentappearsthe way you want it to.Liferaycomeswithmanylayoutsalreadydefined.Developerscancreate more and theycan be deployedtoyourportal for youruse. To prepare forthe portletswe’llsoonbe adding,let’schange the layoutof the Collaborationpage.Toaccesslayouts,selectManage→ PageLayout fromthe Dockbar. Now,selectthe 2 Columns(70/30) layoutandclick Save.Once saved,you’ll returntothe page and it’ll seemasthoughnothinghashappened.Once we startaddingportlets, however,you’ll notice the page isnow equallydividedintotwocolumns.Youcanstack portletsontop of each otherinthese columns.There are,of course,more complicated layoutsavailable andyoucanplayaroundwiththemto get the layoutyouwant. Sometimesaparticularlayoutis almostwhatyouwant butnot quite.Inthiscase use the NestedPortletsportlettoembedalayoutinside anotherlayout.Thisportletisa
  • 27. containerforotherportlets.Itletsyouselectfromanyof the layoutsinstalledinLiferay, justlike the layouts fora page.Thisgivesyouvirtuallyunlimitedoptionsforlayingout your pages. The nextoptioninthe Managemenuispage customizations. Page Customizations Page Customizations are anew feature inLiferay6.2.With page customizations,any userwiththe appropriate permissionscancreate personalizedversionsof anypublic page.Before userscancreate personalizedversionsof pages,customizationsmustfirst be enabledbyanadministrator.Administratorscanactivate ordeactivate customizationsforanyrowor columnon anypage.Whenuserscustomize a page,they have the optionto use eithertheirversionorthe defaultversionof apage.Userscan’t see alternate versionsof pagesotherthantheirown. Whenan administratoractivatespage customizationsforapage,anyportletsthatare in a Customizablerowor columncan be movedaroundthe page or removedfromthe page.Users can add newportletsof theirownchoosingtothese columnsof the page and can alsocustomize portletconfigurations. If atany time usersdetermine theydon’t like theircustomizations,theycanclick Reset My Customizations toreverttheirpages back to the default. Nowthat youknowhowto enable page customizations,let’slookatthe settingsforthe site as a whole. Configuring Site Settings As withSite Pages,youcanaccess Site Settingsthroughthe Control Panel ordirectly fromthe site usingthe Dockbar(Manage→ SiteSettings).
  • 28. You’ll findoptionstospecifydetailsandmetadataaboutyoursite,setupfriendlyURLs and virtual hosts,configure searchengine optimizationsettings,turnstagingonor off and specifyaGoogle AnalyticsID.Let’stake a closerlook. Details:allowsanadministratortochange the descriptionandmembershiptype of a site andalso to specifytagsandcategoriesforthe site.The membershiptype canbe set as open,restrictedorprivate basedonthe privacyneedsof the site.Userscan joinand leave anopensite at will.Tojoinarestrictedsite,auserhas to be addedby the site administrator.A usercan alsorequesttobe addedthroughthe Sitessectionof the Control Panel.A private site islike arestrictedsite butdoesn’tappearinthe Sites sectionof the Control Panel foruserswhoaren’tmembers. Pages: FromSite Settings,clickon Pages tomanage some basicfeaturesof the pageson a site.If no pageshave beendefinedyet,youcansetsite templatesforthe publicor private pages. If pagesalreadyexist,linksare providedtoview them.Youcanalso change the site’sapplicationadapter,whichisaspecial type of hookpluginthat customizesoutof the box functionalityforspecificsites. Site URL: Seta friendlyURLand/or a virtual hostforyour site here.The Friendly URL optionletsyoumanage the pathto your site inthe portal’sURL. FriendlyURLsare used for bothpublicandprivate pages.Forpublicpages,the friendlyURLis appendedto http://localhost:8080/web.Forprivate pages,the friendlyURLis appendedto http://localhost:8080/group.EachfriendlyURLneedstobe a unique name,of course. Havinga human-readable friendlyURLassistsindexingbotsandiscritical togood search engine optimization. For example,suppose youwere creatingaportal for a bankcalledthe BestBank. If you setthe friendlyURLof yourportal’sdefaultsite to/best-bank,the URL of your default site’spublichome page wouldchange to http://localhost:8080/web/best-bank/home.If your portal’sdefaultsite hadprivate pages,the URL of the defaultprivate home page wouldchange to http://localhost:8080/group/best-bank/home. Note that if you’re addingafriendlyURLfor yourportal’shome page,youshouldupdate your portal’sHome URL fieldsothatpage requeststo http://localhost:8080redirect properly.Todo this,navigate tothe Portal Settingspage of the Control Panel andfind
  • 29. the Home URL fieldinthe Navigationsection.Forourbankexample,we wouldenter /web/best-bank/homeintothe Home URLfield.Once you’ve enteredthissetting,page requeststolocalhost:8080 will redirecttothe friendlyURLof yourportal’snew homepage:http://localhost:8080/web/best-bank/home. VirtualHosts make web navigationmucheasierforyourusersbyconnectingadomain name to a site.Thistab allowsyoutodefine adomainname (i.e., www.mycompany.com)foryoursite.Thiscanbe a full domainora subdomain.This enablesyoutohosta numberof websitesasseparate sitesonone Liferayserver. For instance,if we setthisupfor Nose-ster’sDevelopmentNetwork,usersinthatsite coulduse developers.nosester.comtogettotheirsite,providedNose-ster’snetwork administratorscreatedthe domainname andpointedittothe Liferayserver. To setthis up,the DNS name developers.nosester.com shouldpointtoyourportal’sIP addressfirst.Thenenter*http://developers.noseter.com*inthe Virtual Hosttabfor the Developerssite.Thishelpsusersquicklyaccesstheirsite withouthavingtorecall an extendedURL. Site Template:If you’ve createdthe site fromasite template,thissectiondisplays informationaboutthe linkbetweenthe site template andthe site.Specifically,youcan see whichsite template wasusedandwhetherornot itallowsmodificationstothe pagesinheritedfromitbysite administrators.If you’re notusingsite templatesforthis site,youcan safelyignore thissection. Sitemap:letsyousenda sitemaptosome searchenginessotheycancrawl yoursite.It usesthe sitemapprotocol,whichisanindustrystandard.Youcan publishyoursite to Yahoo or Google andtheirwebcrawlerswill use the sitemaptoindex yoursite.Liferay Portal makesthisverysimple foradministratorsbygeneratingthe sitemapXMLforall publicwebsites. By selectingone of the searchengine links,the sitemapwill be senttothem.It’sonly necessarytodo thisonce per site.The searchengine crawlerwillperiodicallycrawl the sitemaponce you’ve made the initial request. If you’re interestedinseeingwhatisbeingsenttothe search engines,selectthe Preview linktosee the generatedXML. Robots: If you’re usingvirtual hostingforthissite,youcanconfigure robots.txtrulesfor the domain.The Robotspage givesyouthe optionto configure yourrobots.txtforboth publicandprivate pagesona site.If youdon’thave Virtual Hostingsetup,thistab is rather boring. Staging: enablesyoutoedit andrevise apage behindthe scenes,thenpublishchanges to yoursite once theyhave beencompletedandreviewed. Analytics: allowsyoutointegrate yourpageswithGoogle Analytics.Liferayprovides seamlessintegrationwithGoogle Analytics,allowingyoutoplace yourID inone place, thenit will getinsertedoneverypage.Thisenablesyoutofocusyoureffortsonbuilding the page,rather thanrememberingtoputthe code everywhere.Google Analyticsisa free service whichletsyoudoall kindsof trafficanalysisonyoursite soyoucan see who visits,where visitorsare fromandwhatpagestheymost oftenvisit.Thishelpsyou tweakyoursite so youcan provide the mostrelevantcontenttoyourusers. Nowthat youknowhowto configure sites,let’slookatpage templatesandsite templates. 2.2 & 2.3 Site Templates & Page Templates
  • 30. Site Template Site Templatesallow youtodefine pagesandwebcontenttoinclude when creatingsites.Administratorsmaydefine andeditsite templatesaswell astheir permissions. Page Template Page Templatesallow youtoselectapage to use and portletstobe included whencreatinga page.Administratorsmaydefine andeditpage templatesas well astheirpermissions. PageTemplates and Site Templates are invaluable toolsforbuildingsimilar pageson largerportals.Asyou continue toaddpagesto sitesinyourportal, you’ll notice repeatablepatternsinthe designsof those pages.Page templates enable youtopreconfigure asingle page andthenapplyittoany new page you create.Site Templatesallowyoutodo the same thingbuton the scale of a site– if you have multiplesitesthatuse asimilarstructure of pages,youcan create a single site template anduse ittocreate as manysitesasdesired. Site Content Liferay6.1 makesit easiertoaccessWeb Contentmanagementwithoutusing the Control Panel.Youcan now click Manageandthen Site Contenttoaccess the same Web Contentcontrolsfeaturedinthe Control Panel rightfromyour portal page. You can manage the followingkindsof content:  RecentContent  WebContent  DocumentsandMedia  Bookmarks
  • 31.  Calendar  Message Boards  Blogs  Wiki  Polls  Software Catalog  Tags  Categories  Social Activity  DynamicData Lists Creating the Sites Pages There are a lotof otherthingsyoucan do beyondplacingportletsonapage.So let’sstartworkingonthe Nose-stersite.Youcando thisby goingupto the Dockbar and clickingGo to → Nose-ster. We’ll use the Community page youcreatedearlierinthe topics.Navigate tothe Community page andselectManage→ Pagefromthe Dockbar. Thisscreenshouldnow be familiartoyoubut let’srecap. The Page tab allowsyouto:  Change the name of the page  Enter HTML code for the title  Choose the page type  Hide the page from the theme navigation  Define afriendlyURLto the page  Choose anicon to be displayed  Choose a frame targetfor the page  Copyan existingpage You can alsoentercustommeta tags or JavaScripttothe page if you’re a web developer.Additionally,if youclickthe Permissions button,youcandefine whichusers,groups,rolesororganizationscanview oreditthe page. The Childrentabletsyoucreate childpagesunderneaththe page you’ve selected.Youcannestpagesas deepas youlike butforeverypage below the top level hierarchyyoumustprovide navigationtoitviaa Navigationor Breadcrumbportlet,atleastwithmostthemes(includingthe default). Developerscancreate themeswhichhave cascadingmenubarswhichshow the full hierarchy.Some examplesof thatare in Liferay’spluginrepositories. For now,click Return to full page.You shouldbe able todefine andmanage pagesinLiferayat thispointso let’slookatwhat you’dputon a page. Portlets As we discussedearlier,LiferayPortal pagesare composedof portlets.All of your site’sfunctionality,fromblogstoshopping,iscomposedof portlets. Addingportletstoa page issimple.Let’saddsome toour Collaborationpage. 1. In the Dockbar,select Add → More.
  • 32. 2. In the menuthat appears,expandthe Collaborationcategory. 3. Drag the BlogsAggregatorportletoff the AddApplicationwindow ontothe rightcolumnof our page. 4. Next,dragthe Wiki portlettothe left column. See howeasyit isto add applicationstoyourpages?We’ve gone one step further:we’ve gotthe Wiki portlet,the BlogsAggregatorportletandthena nestedportletwithadifferentlayoutandthe Alerts,SearchandDictionary portletsinthe figure below. Page Permissions By default,publicpagesare justthat: public.Theycanbe viewed byanybody, loggedinor notloggedin.Andprivate pagesare reallyonlyprivate fromnon- membersof the site.If someone hasjoinedyoursite orisa memberof your organization,thatpersoncansee all the private pages.Youcan, however, modifythe permissionsonindividual pagesineitherpage groupsoonlycertain userscan viewthem. Let’ssay we wantedtocreate a page onlyfor administratorstosee.We cando thiswiththe followingprocedure: 1. Go to the Dockbarand select Manage→ ControlPanel. 2. Ensure you’ve selectedthe defaultsite inthe contextselector. 3. Clickthe Site Pages link. 4. Clickthe PrivatePages tab to switchto the Private Pages.Remember,thesepagesbydefault are viewableonlybymembersof the site. 5. Create a page called Admin Tips. 6. Clickon the page inthe tree onthe leftandthenclick Permissions. 7. Uncheck the View and Add Discussion permissionsnexttothe Site Memberrole. 8. Clickthe Savebutton.
  • 33. Congratulations!You’vejustchangedthe permissionsforthispage soonlysite administratorscanview it.Anyusersyouaddto thisrole can now see the page. Otherusers,evenmembersof thissite,won’thave permissiontosee it. PagesinLiferayare as flexible aspagesyou’dcreate manuallywithoutaportal. Usinga pointandclickinterface,youcan define yoursite anywayyouwant.You can create and remove pages,exportandimportthem, settheirlayouts,define howtheyare indexedbysearchenginesandmore.You’ve alsobeenintroduced to Liferay’sconceptof sites.Again, usingapointandclickinterface,youcan create multiple websitesanddefine how userscanaccessthem, whetherthey are linkedtoa domainname andcreate all of theirpages. 3. Apps 3.1 App Manager AppManager managesall the installedappsfromthe marketplace orby installingmanually.
  • 34. You can Activate itor Deactivate anyappsby clickingActionButton. In Install TabYou can manuallyuploadafile andinstall itina liferayportal. Afteruploadingyoucanmanage itfrom AppManager. 3.2 Store LiferayMarketplace where youcanbuyapps,themesandmany cool stuffs. 3.3 Purchased Thisis the place whenyoupurchase anyapp fromthe store will show here you will install it.
  • 35. 3.4 Plugins Configuration PluginsConfigurationallowsadministratorsto configure whichportal roleshave access to certainplugins. PortletPlugins Theme Plugins Layout Template Plugins
  • 36. 3.5 License Manager In License Managerwe can see our liferayregistereddetailsorif we hadbuy a liferay thenwe cangenerate licensebyenteringOrderId. 3.6 OpenSocial Admin In OpenSocial Adminwe canbuildandpublishourownGadgets.
  • 37. 4. Configuration 4.1 Portal Settings Settingsiswhere mostof the global portal settingsare includingnames, authentication,defaultuserassociations,andmail hostnames. Most global portal settingscanbe configuredfromthe Portal Settingssectionof the Control Panel.The Configurationheadingcontainsthe followinglinks: General:letsyouconfigure global settings,suchasthe companyname,domain, the virtual host,a global portal logo,andmore. Authentication:allowsyoutoconfigure userauthenticationmethodsand connectionstoLDAPand Single Sign-Onservers. Users:has three tabslabeledFields,ReservedCredentialsandDefaultUser Associations.The Fieldstabenablesordisablessome userfields,suchas birthdayor termsof use.The ReservedCredentialstabletsyoureservescreen namesand email addressessouserscannotregisterusingthem.Youmightuse thisto preventusersfromregisteringonthe portal withusernamesthatcontain profanityorthat soundofficial,suchas admin or president.The DefaultUser Associationstabletsyouconfigure defaultmembershiptoroles,usergroups, sitesfornewusersand providesacheckbox whichallowsyoutoretroactively applythese toexistingusers. Mail Host Names:letsyouadd a listof othermail hostnamesto be associated withyourorganization.Forexample,yourmaindomainmightbe mycompany.combutyoumightuse mycompany-marketing.comforyouremail newsletters.Anydomainnamesassociatedwithyourorganizationcangohere. Email Notifications:allowsyoutoconfigure Liferaytosendemail notifications for certainevents,suchasuserregistrations,passwordchanges,etc.Youcan customize those messageshere.
  • 38. ContentSharing: containsoptionsforenablingsite administratorstodisplay contentinone site fromothersitestheyadminister.Youcanalsoconfigure rules for whethersubsitesshouldbe able todisplaycontentfromtheirparentsites. Afterclickingon PortalSettings inLiferay’sControl Panel,youcanconfigure any of the areasshowninthisfigure.
  • 39. General The General linktakesyouto a screenwiththree headings:MainConfiguration, Navigation,andAdditional Information.Underthe MainConfigurationheading, youcan setthe name of the companyor organizationthat’sresponsiblefor runningthe portal.Thisname alsodefinesthe name of yourportal’sdefaultsite. Its defaultname isliferay.comsoyouwill definitelywanttochange thisto reflectthe name of yourcompanyor organization.Youcanalsoset the mail domain,virtual hostandcontentdeliverynetworkaddresshere. Under the Navigationheading,youcanseta home page for your portal here as well asdefaultlandingandlogoutpages.Forsettingthesepages,justuse the part of the page’saddressthatfollowsyourdomain.Forexample,if youwant the defaultlandingpage tobe http://localhost:8080/web/guest/login,use /web/guest/login.Youcanalso use the variables${liferay:screenName} and ${liferay:userId}aspart of the address.Thiscomesinhandy if youwant to redirectuserstotheirpersonal pagesuponlogin.Alternatively,youcansetthe defaultloginorlogoutpage ina portal-ext.properties file withthe properties default.landing.page.pathanddefault.logout.page.path, respectively.Underthe Additional Informationheading,youcanspecifyaLegal name,ID,companytype, SIC code,tickersymbol,industryandindustrytype. Authentication The Authenticationpage hasseveral tabs:General,LDAP,CAS,Facebook,NTLM, OpenID,OpenSSOandSiteMinder.Youcanuse anyof these authentication methodstoconfigure how userswill authenticatetoLiferay. Since Liferay supportsquite afew authenticationmethods,thereare differentsettingsfor each. The settingsonthe General tab of the Authenticationpage affectonlyLiferay functionalityanddon’thave anythingtodowiththe integrationoptionsonthe othertabs. The General taballowsyouto customize Liferay’sstandard authenticationbehavior.Specifically,the General taballowsyoutoselectfrom several global authenticationsettings:  Authenticate viaemailaddress(default),screenname,oruser ID(a numerical IDauto- generatedinthe database–notrecommended).  Enable/Disable automaticlogin.If enabled,Liferayallowsauserto checka box whichwill cause the site to“remember”the user’sloginbyplacinga cookie onhisor herbrowser.If disabled,userswill alwayshave tologinmanually.  Enable/Disable forgottenpasswordfunctionality.  Enable/Disable requestpasswordresetlinks.  Enable/Disable accountcreationbystrangers.If youare runningan Internetsite,youwill probablywantto leave thisonsovisitorscan create accountson your site.  Enable/Disable accountcreationbythose usinganemail addressinthe domainof the companyrunningthe site (whichyoujustsetonthe General page of Portal Settings).Thisis handyif you are usingLiferayto hostbothinternal andexternal websites.Youcanmake sure all internal IDshave to be createdby administratorsbutexternaluserscanregisterfor IDs themselves.
  • 40.  Enable / Disable email addressverification.If youenable this,Liferaywill sendusersa verificationemail withalinkbackto the portal to verifythe email addresstheyenteredisa validone theycan access. By default,all settingsexceptforthe lastare enabled.Userauthenticationby email addressisanimportantdefaultforthe followingreasons: 1. An email addressis,bydefinition,unique tothe userwhoownsit. 2. People cangenerallyremembertheiremail addresses.If youhave userswhohaven’tlogged intothe portal for a while,itispossible theywill forgettheirscreennames,especiallyif they weren’tallowedtouse theirscreennamesof choice (because theywere alreadytaken). 3. If a userchangeshisor her email address,itismore likelythe userwill forgettoupdate his or her email addressinhisorher profile,if the email addressisnotusedtoauthenticate.If the user’semail addressisnotupdated,all notificationssentbythe portal will fail toreach the user.So it isimportanttokeepthe email addressatthe forefrontof a user’smindwhen he or she logsinto helpthe userkeepitupto date. Next,we’ll examine how tointegrate existingusersfromotherenvironments, such as LDAPservers,intoLiferay. 4.2 Custom Fields CustomfieldsappearbeneathPortal Settingsunderthe Configurationheadingof the Control Panel. Customfieldsare away to add attributestomanytypesof assetsand resourcesinthe portal.For example,if you’reusingLiferayPortal tocreate a site forrating books,youmightcreate a custom fieldcalled FavoriteBooks forUserresource.If you’re usingthe Wiki forbookreviews,youmight add fieldscalled BookTitleand BookAuthor. It’spossible toaddcustomfieldstofollowingkindsof portal resources:  BlogsEntry  BookmarksEntry  BookmarksFolder  CalendarBooking  Document  DocumentsFolder  Message Boards Category  Message Boards Message  Organization  Page  Role  Site  User  User Group  WebContentArticle  Wiki Page The abilitytoadd customfieldstoanyof these resourcesaffordsflexibilitytoportal developers.For example,suppose you’dlike todefine alimitationonthe numberof usersthatcan be assignedto certainroles.A portal administratorcancreate a customfieldcalled max-usersforthe Role resource. Thena portal developercancreate a hookpluginthatchecksthisfielduponuserassignmenttoroles to make sure that there aren’ttoomany usersassignedtothe role.
  • 41. To add a custom field,clickonthe CustomFields linkinthe Control Panel.Thenchoose aresource, clickon the Edit linknexttoit and select Add CustomField. From here youneedtoadd the customfieldkey.The keyappearsasthe label for the fieldonthe form.Forsome portal resources(like the User),customfields are a separate sectionof the form.For others,ascan be seenabove,custom fieldsare integratedwiththe defaultfieldsonthe form.Additionally,developers can access customfieldsprogramaticallythroughthe <liferay-ui:custom- attribute /> tag.
  • 42. You can create fieldsof manydifferenttypes:textfields(indexedorsecret), integers,selectionof multiple valuesandmore.Once you’ve createdafield,you cannot change itstype.However,youcandelete custom fieldsandcreate new ones.Next,let’slookathow toapplyserverconfigurations. 4.3 Server Administration ServerAdministrationsettingscontrol logs,caching,searchindexing,andother advancedfeatures.Advancedadministratorscanmonitorsystem performance, alterdetailedserversettings,reindexsearchesandmodifycaching. The ServerAdministrationpage of the Control Panel letsyouperformvarious tasksrelatedtothe portal serveritself thataren’tdirectlyrelatedtothe resourcesinthe portal.Clickingthe linkmakesthisclear:you’re immediately presentedwithagraphshowingthe resourcesavailable inthe JVM.
  • 43. Resources The firsttab is called Resources.Thistabcontainsthe aforementionedgraphplusseveral serverwide actions thatan administratorcanexecute.Theseinclude the following: Run the garbage collector: Youcan sendina requesttothe JVMto beginthe garbage collectiontask. Clear contentcached by this VM: You can sendina requesttothe JVMto clearcontent storedinthe local cache. Ehcache usage issplitintotwogroups:local JVMscope and clusterscope.Thisactiononlyclearsthe contentof the local Ehcache. Clear contentcached across the cluster: You can sendina requesttothe JVMto clear contentcachedacross the entire cluster.Thisactionclearsthe contentof the clustered Ehcache. Clear the database cache: You can sendina requesttothe JVMto clear the database cache.LiferayusesEhcache mainly,butnotonly,at the persistence layerforcaching objectsobtainedfromthe database.Thisactiononlyclearsthe database resultcache. Clear the direct servletcache: You can sendina requestto the JVMto clearthe direct servletcache.The directservletcontextisafeature that optimizesJSPserving performance bycachingand accessingthe generatedservletsdirectlyinsteadof accessingthemoverthe applicationserver’sdispatcherchain.Thisisonlysuitablefor caseswhere nofilterisrequiredforthe JSPs.Forproductionmode,thiscache shouldbe enabledtoimprove performance.Incase emergencyfixesneedtobe applied,thisaction allowsanadministratortomanuallyclearoutthe cache to force JSPsto reload.For developmentmode,the directservletcontextshouldbe disabledtoallow JSPservletsto be reloadedonthe fly.See the DirectServletContextsectionof the portal.propertiesfile for details. Reindexall search indexes: Youcan sendina requesttoregenerate all searchindexes.If youare not usinga Solrsearch serverthiswill impactportal performance so, tryto do thisat non-peaktimes. Reindexall spell checks indexes:Youcan sendina requesttoregenerate all spell check indexes. Resetpreviewand thumbnail filesforthe Documentsand Mediaportlet: You can send ina requesttoresetthe preview andthumbnailfilesforeachiteminyourportal’s DocumentsandMedialibraries. Generate ThreadDump: If you are performance testing,youcangenerate athread dumpwhichcan be examinedlatertodetermineif there are anydeadlocksandwhere theymightbe. Verifydatabase tablesof all plugins: You can checkall tablesagainsttheirindexesfor accuracy of data retrieval. VerifyMembershipPolicies:Youcancheck that existingsite membershippolicieshave beencorrectlyappliedandautomaticallymake updatesif necessary.Forexample, suppose thatsomeone manuallychangedthe Liferaydatabase orthatthe Liferay database washacked,resultinginauserbeingassignedtoa site inviolationof asite membershippolicy.Whenthe Verify Membership Policies buttonisclicked,the verify methodsof all the site membershippoliciesthathave beenimplementedare triggered. These methodscheckthatall site membershipsare inaccord withthe site membership policies;if theyare not, the necessarychanges(suchasremovingusersfromforbidden sites) are made.
  • 44. Cleanup Permissions:Thisprocessremovesthe assignmentof some permissionsonthe Guest,User,and PowerUser rolestosimplifythe managementof “UserCustomizable Pages”.Notably,the “AddToPage” permissionsisremovedfromthe GuestandUser rolesforall portlets.Likewise,the same permissionisreducedinscope forPowerUsers fromportal wide toscopedto“User Personal Site.” Log Levels The Log Levelstabof the ServerAdministrationpage allowsyoutodynamicallymodify the log levelsforanyclasshierarchyinthe portal.If youhave custom code youhave deployedwhichisn’tinthe list,youcanuse the Add Category tabto add it.If youchange the log level nearthe topof the classhierarchy(suchas at com.liferay),all the classes underthat hierarchywill have theirloglevelschanged.If youare testingsomething specific,itismuchbetterto be as specificasyoucan whenyouchange loglevels. Modifyingthemtoohighinthe hierarchygeneratesalotmore logmessagesthanyou need. Properties Liferayandthe JVMcontainmany settingswhichare definedasproperties.There are twosubtabsof the propertiestabof the ServerAdministrationpage:one showing systempropertiesandone showingportal properties. The systempropertiestabshowsanexhaustivelistof systempropertiesforthe JVM,as well asmanyLiferaysystemproperties.Thisinformationcanbe usedfordebugging purposesorto check the configurationof the currentlyrunningportal. The portal propertiestabshowsanexhaustivelistof the portal properties.These propertiescanbe customized;youcanperuse the full listof customizable properties online athttp://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html.If you needtocheck the currentvalue of a particularproperty,itcan be viewedfromthis screenwithouthavingtoshutdownthe portal or openany propertiesfiles. CAPTCHA By default,LiferayshipswithitsownsimpleCAPTCHA service whichisdesignedto thwartbots fromregisteringforaccountsonsitespoweredbyLiferay.If youwantto insteaduse Google’sreCAPTCHA service,youcanenable thissettingfromthe CAPTCHA tab of the ServerAdministrationpage. Simplycheckthe EnableReCAPTCHA box andenteryour publicandprivate keysintothe providedfields,thenclick Save.LiferayPortal will thenuse reCAPTCHA insteadof simple CAPTCHA. Data Migration If you are upgradingfroma previousrelease of LiferayPortal orif youneedtomigrate your data fromone systemtoanother,the Data Migrationtab helpsyouto do that withoutyourdevelopers havingtowrite customscripts. The firstsectionletsyoucopyyour entire Liferaydatabase fromthe currentdatabase underwhichitis runningtothe database you specifyinthissetof fields.You’ll needto
  • 45. enterthe driverclassname (andthe driver will needtobe onLiferay’sclasspath),the JDBC URL of the database to whichyou’ll be copyingyourdataand the credentialsof a userwithaccess tothat database.Once you have all of thisinformationentered,click Executeto copy the data. The nextsectionhelpsyoumigrate yourdocuments.If youwanttomove off of the JackrabbitJSR-170 repositorytothe file system, ortothe Jackrabbitrepositoryfromthe file system,ortoany of the other repositoriessupportedbythe DocumentsandMedia library,youcan do so veryeasily.Make sure youhave alreadysetupyour portal- ext.propertiesfilesothe hookisproperlyconfiguredbefore runningthismigration. Selectthe DocumentLibraryhookthat representsthe locationtowhichyouwantyour documents tobe migrated,thenclick Execute.Your documentswill be migratedtothe newrepository.Youcanthenshut downLiferay,make the new repositorythe defaultin the portal-ext.propertiesfile,andthenrestart. You can migrate imagesfromthe Image Galleryinthe same manner.(InLiferay6.0 and previousversions,the DocumentLibraryandImage Gallerywere distinctrepositories.In Liferay6.1 and laterversions,these have beencombinedintoasingle Documentsand Mediarepository.) File Uploads Since Liferayallowsuserstouploadfilesinvariousplaces,youmaywanttolockdown the type of filesandthe size of filesusersare allowedtoupload.The File Uploadstabof the ServerConfigurationtabletsyousetthe overall maximumfile sizeandthenoverride that size forspecificapplicationswithinLiferay.Youcanlimitthe allowedfile extensions generallyorbyapplication.Youhave alot of flexibilityastohow youwant filestobe managedwithinyourportal. Mail Insteadof usingyourLiferay server’sportal-ext.propertiesfiletoconfigure amail server, youcan configure amail serverfromthe Mail tab of the ServerConfigurationsectionof the Control Panel.If yourportal is to receive mail (see,forexample,ourcoverage of the Message Boards portlet ),youcan connecta POP mail server.If yourportal isto send mail,whichisuseful forsendingnotificationstousers,youcan connectto an SMTP server.We highlyrecommendsettingupmail serversforyourportal. Note that if youconfigure mail serversettingshere inthe Control Panel,these settings will override anymail serversettingsinyourportal-ext.propertiesfile. External Services LiferayPortal enablesuserstouploadandshare contentviathe DocumentsandMedia library,a customizable andpermissionable online repository.Userscanuploadfilesof any type to the DocumentsandMedialibrary.LiferayshipswithPDFBox andusesitto generate automaticpreviewsforcertaintypesof documents,bydefault.Youcan also install three additional toolsthatofferhigherqualitypreviewsanddocumentconversion functionality:OpenOffice orLibreOffice,ImageMagickandXuggler.WithLiferay configuredtouse these tools,youcangenerate automaticpreviewsformanytypesof filesincludingtextfiles,office suitefiles,PDFs,images,audiofilesandvideos.Userswill
  • 46. alsobe able touse the conversionfunctionalitytodownloaddocumentsinavarietyof formats.Please see the AutomaticPreviewsandMetadata sectionformore information. LibreOffice isavailable here: LibreOffice,ImageMagickisavailablehere: ImageMagick, and Xugglerisavailable here:Xuggler.Make sure tochoose the correct versionsof these applicationsforyouroperatingsystem.We recommendthatyouinstall the lateststable versions.LibreOffice 3.6,ImageMagick6.7.7, and Xuggler5.4 workwithLiferay6.2. You needtoinstall LibreOffice andImageMagickmanuallybutyoucaninstall Xugglerfrom Liferay’sServerAdministrationControlPanel interface. Once you’ve installedthesetools,youcanuse the External Servicestab of the Control Panel toconfigure Liferaytouse them. Script Liferayincludesascriptingconsole whichletsadministratorsexecute migrationor managementcode instantly.Several scriptinglanguagesare supported,including JavaScript,Groovy,Python,RubyandBeanshell.Thisguide containsa topicsthat explainshowtouse Liferay’sscriptingconsoleandprovidessome examples. Shutdown If you everneedtoshutdownyour LiferayPortal serverwhileusersare loggedin,you can use the Shutdowntabto informyourlogged-inusersof the impendingshutdown. You can define the numberof minutesuntil the shutdownandacustom message that will be displayed. Users will see yourmessage atthe topof theirportal pagesfor the durationof time you specified.Whenthe time expires,all portal pageswilldisplayamessage sayingthe portal has beenshutdown.Atthispoint,the serverwill needtobe restartedtorestore access.Next,let’sexamine how tomanage multiple portal instances. 4.4 Portal Instances Portal Instancesallow administratorstorunmore than one portal instance ona single server.Dataforeachportal instance are keptseparate fromeveryother portal instance. Portal Instances LiferayPortal allowsyoutorun more than one portal instance ona single server. The Portal Instancessectionof the Control Panel appearsunderthe Configurationheading.Thissectionletsyoumanage multiple portal instances froma single Liferayinstallation.Eachportal instance’sdataiskeptseparate fromeveryotherportal instance’sdata.All portal data,however,iskeptinthe same database. Each portal instance requiresitsowndomainname.Liferaydirectsuserstothe properportal instance basedonthisdomainname.Sobefore youconfigure an
  • 47. instance,configure itsdomainname inyournetworkfirst.Whenyou’re readyto add an instance,clickthe Add buttonhere. You’ll be promptedforfourfieldsandacheck box: WebID: A general conventionistouse the domainname forthis.It’sa user- generatedIDforthe instance. Virtual Host: Put the domainname youconfiguredinyournetworkhere.When users are directedtoyour Liferayserverviathisdomainname, Liferaywill then be able to sendthemto the properportal instance. Mail Domain: Enterthe domainname forthe mail hostfor thisinstance.Liferay will use thistosendemail notificationsfromthe portal. Max Users:Enter the maximumnumbersof useraccountsyouwouldlike your portal instance tosupport. Active:Use thischeck box to choose whethertocreate an active oran inactive portal instance. Whenyouare finishedfillingoutthe form, click Save.Now navigate tothe portal usingyournewdomain name.Youwill see youare broughtto what lookslike a cleaninstall of Liferay.Thisisyournew portal instance whichcannow be configuredanywayyoulike. 4.5 Social Office Configurations Already told in above topics. (When we were installing Social Office.) SOCIAL OFFICE CE LiferaySocial Office isasocial collaborationsolutionforthe enterprisethatstreamlines communication,savestime,buildsgroupcohesionandraisesproductivity. What is Social Office? LiferaySocial Office isasocial collaborationsolutionforthe enterprisethatstreamlines communication,savestime,buildsgroupcohesionandraisesproductivity. It was createdinresponse towide demandforimplementingthe LiferayPortal platform as a team collaborationsolution.To be clear,LiferaySocial Office isbuiltonLiferay Portal,createdbypicking,integrating,andpackagingLiferayPortal'smostasked-for featuresandcapabilitiesforsocial collaborationuse cases. What's the difference between Liferay Portal and Liferay Social Office? If you wanta heavily customizable solution,take alookat LiferayPortal--ithasall the featuresof Social Office andmore.If you're lookingforasolid,simple touse
  • 48. collaborationsolutionanddon'twantto botherwithheavycustomization,LiferaySocial Office will be abetterfitforyou. Social Office Plugins Available for use: CE Plugins:  calendar-portlet  chat-portlet  contacts-portlet  deploy-listener-hook  events-display-portlet  microblogs-portlet  notifications-portlet  portal-compact-hook  private-messaging-portlet  so-activities-hook  so-announcements-portlet  so-configurations-portlet  so-hook  so-portlet  so-theme  tasks-portlet  WYSIWYG-portlet If all the Social Office pluginshave beensuccessfullydeployed,checkthatyoucan accessthe followingitemsinyourportal,eitherinthe Control Panel orona defaultSocial Office site: Role:  Social Office User Site Templates:  DefaultSocial Office Site  Social Office UserHome (Dashboard)  Social Office UserProfile Portlets:
  • 49.  Chat  Contacts  EventsDisplay  Microblogs  Private Messaging  Social Office Configurations  Social Office Portlet  Tasks  WYSIWYG Hooks:  DeployListener  Portal Compact Hook  Social Office Hook Themes:  Social Office theme To actuallystart usingSocial Office afterit’sbeeninstalled,youneedtograntthe Social Office User role to one or more users.Please refertothe Using SocialOfficesectionformore detailsaboutthe Social Office Userrole andthe featuresprovidedbySocial Office. Using Liferay as A Social Platform Whetheryouplanto buildasocial networkor enable social applicationsaspart of your overall user experience, LiferayPortal hasthe toolstomake those featuresworkforyou. Startingwitha suite of applications–includingaprofile summary,activitiesfeeds,socialrequests,awall,andmore–and roundingthingsoutwithanAPI to handle relationshipsbetweenusersaswell aspublishtheir activitiestoeachother,LiferayPortal helpsyouimplementcommonfeaturesof social networks.
  • 50. LiferayPortal providesfeedsof social activities.These feedscancontainentriesfromanyof Liferay’s built-inapplicationsorapplicationsthatyouwrite. Social relationshipsinLiferayPortal are ideallysuitedforeverythingfrompublicsocial networksto enablingsocial featuresinyourcorporate Intranet.Userscanform relationshipswithone another, allowingthemtosee updatesfromthose whose activitytheyneedtotrack.That’s far more powerful than havingthemsubscribe tomultiple individualRSSfeedsorvisitmultipleprofiles,becausethe systemkeepstrackof the updatesfromthose withwhomyouhave a relationship,automatically. More than this,however,Liferayisagreatintegrationplatformforsocial applications.Itfully supportsthe OpenSocial framework.Youcanpublishgadgetsyoufindonline,oryoucanuse Liferay Portal’sbuilt-inOpenSocial gadgeteditortocreate andserve yourownOpenSocial gadgets. LiferayPortal’sOpenSocial gadgeteditorletsyourapidlycreate social applicationsthatcanbe servedacrossthe webto any otherOpenSocial container. LiferayPortal alsosupportsthe creationof Facebookapplications;infact,noadditional codingis necessarytopublishyourLiferayapplicationsonFacebook(youwould,of course,needtouse Facebook’sAPItouse Facebook-specificfeatureslikepostingonusers’timelines).All youneedtodo isget an APIkeyand canvaspage URL from Facebook.
  • 51. AnyLiferayapplicationcanbe publishedtomultiple social networkswithafew clicks. As youcan see,LiferayPortal isbuiltwithsocial applicationsinmind.It’shighlylikely,howeverthat youalso have yourownapplicationyouneedtorunon your website.The LiferayPortal platformis ideal forthe webapplicationyou’re consideringwriting.Inadditiontothis,LiferayPortal iseasily configuredtobe usedas a sharedhostingplatformformultiplewebsites.Let’slookatthe benefits youcan reapby usingLiferayPortal inthese ways. How to use Social Office? My Dashboard Thisis the user'shomepage.The leftside of the page liststhe communitiesorsitesthe userbelongs to as well asa buttonto add sitesif youare the admin.The rightside of the page has three view activityoptions,Mysites,MyFriendsandMe. My siteslistsall the recentactivitiesforthe sitesthat youbelongto.My friendsliststhe recentactivitiesforyourfriendsandMe listsall of your (the loggedinuser's) activities.
  • 52. Creating Communities Once loggedinyouwant to start bycreatingcommunities.Theseare essentiallymini-sitesthatare usedto collaborate on.Youcan create sitesforany groupingof people whowanttocollaborate togetherincludingbutnotlimitedto,specificdepartmentswithinabusiness(e.g.,marketing,sales, or pr),groups of co-workersacrossdepartments(e.g.,thosewhoare organizingthe company-wide summerbbq),andspecificprojects(e.g.,ProductAlpha,Beta,orDelta) thatwill alsohave members frommany departmentswithinacompanycollaboratingonit.Once a communityiscreatedyoucan start addingcontentto thatsite.Clickonthe My Sitesbuttononthe top rightto navigate to the sites youbelongto.Once you've navigatedtoa site you are presentedwithasetof pre-definedpagesfor that site.The advantage tothisis nothavingto spendtime populatingyoursite withpagesand collaborationportletsorworryingaboutlayout.Youcan justset itup and go,literallythe abilityto start workingassoon as yousignon. Once there isno more needfora particularsite,(e.g.,The summerbbqisover) the admincan just delete the site andcreate anew one for the next collaborative need.Youcansee fromthisscreenshotthat three communitiesorsiteswere created, one for marketing,one foreventsandone fora projectnamedAlpha.
  • 53. Descriptions of the pre-defined pages Dashboard Thisis the home page of the marketingcommunitywe created.Itishere thatyoucan see all of the latestactivitiesof userswithinthiscommunity.If youneedtoknow whatpeople are doingthisis where youwouldgoto see an aggregatedlistof all theiractivities.
  • 54. Calendar The Calendarpage allowsyouto see all of the events,appointments,meetings,andsuchthatare associatedwiththatparticularcommunity.Asadminyoucanautomaticallyaddandediteventsin the calendar. My Documents The Documentspage is where the documentlibraryislocated.
  • 55. Forums The Forums page iswhere youcan findthat site'smessage board.A listof quicklinksisdisplayedon the leftside of the page.Thisallowsyouto quicklynavigate righttothe contentyouwantto see.As withthe documents,blog,andwiki pages,asectionwithrelatedcontentisonthe rightside of the page.Thisautomaticallybringsupall contentthatistaggedwiththe same tag as the contentyouare currentlyviewing. Blog Once on the Blog page,youcan navigate throughall the blogscreatedbyuserswithinthissite.For easyaccess,a listof recententriesisonthe left-handsideof the page.
  • 56. Wiki The Wiki page isthe perfectplace tocreate documentationorpostinformationforyourcommunity. It too hasa listof quicklinksonthe lefthandside andrelatedcontentonthe right. Contacts Center The Contacts Centerpage listsall the membersof thatparticularcommunityonthe left.Youcan clicka specificpersontosee more informationonhimorher.
  • 57. Chat The numberof online friendsshowsupinthe bottomrightcornerof the screen.Clickittopull up a listof those friendsandclickona specificpersontoopenachat box withthat friend. Messages You can sendmessagestopersonswhichare incontact withu.
  • 58. Working Smart with Liferay Social Office LiferaySocial Office isLiferay’ssocial collaborationproductforthe enterprise.Previouslyreleasedas a separate productthat was basedonLiferayPortal,it’snow available asanapplicationthatcan be installedonLiferay.We are excitedtobringbothSocial Office andthisguide toyou,inthe hope that you’ll be able touse eachto enable yourteamsto worktogethermore efficiently.Thisguideisfor those whoare settingupandadministeringaninstance of LiferayPortal usingSocial Office.From installingSocial Officetointroducingyoutoitsentire feature set,we’ll discussall of the thingsyou can do withSocial Office tohelpyourteam.We hope you’ll use itasa tool to getSocial Office up, running,andintegratedintoyourenterprise. Youcanfindmuchmore informationaboutinstallation and administrationinthe LiferayUserGuide. “Help!” Thishas beenthe cry of informationworkers everywherewhohave triedtomanage complex projectsthroughemail andsharedfolders.You’veprobablyhadasimilarexperience:you’re collaboratingona documentwithateamof people andare emailingitbackandforth.PersonA createsthe initial documentandPersonBreplieswithsome edits.PersonCreplieswithadditional editsat the same time PersonA replieswiththe correctionsfromPersonB.PersonDtakesthisand rewritesawhole sectionof the documentwhile PersonBandC respondtoPersonA’supdate.Pretty soon,it becomesverydifficulttodeterminewhichdocumentisthe latestdocument.The same scenarioplaysitself outwhenworkinginsharedfolders,exceptthere’snotrail of email messagesto figure outwhodidwhat andwhen. The Social Office pluginforLiferayPortal isdesignedtoanswerthiscall forhelp.Social Office isa dynamicteamcollaborationsolutionforthe enterprise that’sdesignedtostreamline communication,save time,andraise productivity.Organizationsandgroups can use Social Office to share resources,collaborate onprojects,andraise the visibilityof importantactivity.We createdthe
  • 59. productto provide a simple,outof the box solutionforteamcollaboration.Social Office provides youwitha fantasticarray of featuresthatyoudon’tneedto spendalot of time configuring.It’s readyto use rightout of the box.Once installed,aquicksetupwizardwill helpyousetupateam collaborationsite soyoucanbeginworkingimmediately.Infact,youcan have a full production environmentsetupinlesstime thanittakesto brew a potof coffee. If you needanyassistance beyondwhat’scoveredinthisbook,Liferay,Inc.offerstraining, consulting,andsupportservicestofill anyneedthatyoumighthave.Pleasesee http://www.liferay.com/services forfurtherinformationaboutthe serviceswe canprovide.As always,we welcome anyfeedback.If there isanywayyouthinkwe couldmake thisbookbetter, please feel free tomentionitonourforums.Youcan alsouse any of the email addressesonour Contact Us page http://www.liferay.com/contact_us.We are here toserve you,ourusersand customers,andto helpmake yourexperience usingSocial Office the bestitcanbe. Upgrading Your Liferay Social Office version There are a fewstepsandproceduresthatyouneedto follow if you’re upgradingtoa newerversion of Social Office.The sectionsbelowdescribe how toupgrade fromSocial Office 2.x to3.x,and from Social Office 3.0.0 to 3.0.1. Upgrading from Social Office 2.X to 3.X Social Office 3.x onlyrunson LiferayPortal 6.2.x.If you’dlike toupgrade fromSocial Office 2.x to 3.x, youfirstneedto upgrade your portal from Liferay6.1 to Liferay6.2. For informationonupgrading Liferay,please referto UpgradingLiferay.RemembertoundeployyourSocial Office 2.x plugins before upgradingyourportal to6.2. If you have a LiferayPortal EE subscription,make sure toapply any available fixpacksbefore deployingyourSocial Office 3.x plugins. Once your 6.2 portal isready,deployyourSocial Office 3.x plugins. Whenyoufirstlogintoyour portal as an administratorafterinstallingSocial Office 3,you’ll see the Social Officeconfigurations portlet.Youcan use thisportletto grant the Social Office Userrole tousers.The Social Office User providesaccesstothe Dashboardhome page,the publicProfile page,andall of theirapplications. You’re nowreadyto use Social Office!
  • 60. Upgrading from Social Office 3.0.0 to 3.0.1 Before upgradingfromSocial Office 3.0.0to 3.0.1, make sure to sethot.undeploy.on.redeploy=true inyour portal-ext.propertiesfile.ThispropertymakesLiferaycompletelyundeployapluginbefore deployinganewversionof the plugin.If youdon’tsethot.undeploy.on.redeploy=true before upgrading,the upgrade mightnotcorrectlyhandle activities.Settinghot.undeploy.on.redeploy=true ensuresthatactivitiesare handledcorrectly. Afterinstallingthe newversionof Social Office,you’re all set! SOME OUT OF THE BOX FEATURES Accessing Liferay Services In manycases,you’ll wanttointeractwithone of Liferay’smanyservices.Thisispossible fromall of the scriptinglanguagessupported,butthe syntax isa little differentforeachlanguage. To illustrate the correctsyntax forinteractingwithLiferayservices,let’slookata simple example that usesthe UserLocalService toretrievealistof usersand thenprintstheirnamestothe log file. We’ll initiallyimplementthe exampleinJavapseudo-code. Let’ssee firsthowthiswouldworkinBeanshell,whichisverysimilartoJava. Beanshell Beanshell isaJavascriptinglanguage that’sdesignedtorunJava code withlittle ornochanges.In thisexample,we onlyhave one smallchange tomake because Beanshell doesn’tsupportthe use of Java Generics.
  • 61. Groovy Groovyis alsobasedon Javaand isperhapsa little easierthanBeanshell because literallyanycode writteninJavaalsoruns inGroovy. Thismeanswe can execute the exactsame code fromourJava example withoutanychanges. Of course,we couldmake thissomewhatGroovierbysimplifyingthe programasfollows: The script engine supportsmore thanjustJava-like languages.Despitethe name,youshouldbe aware that JavaScriptbearslittle resemblancetoJava,butyou can still use itinLiferay’sscript engine. JavaScript Liferayusesthe Rhino JavaScriptEngine toprovide JavaScriptsupportinthe scriptengine.The followingcode providesa JavaScriptversionof ouroriginal Javaprogram.
  • 62. You can see the Javascriptexample iscompact.Rubyisevenmore compact. Ruby Rubyis supported throughthe use of JRubyandour previousexample couldbe implementedin Rubyas follows: Python Lastly,LiferayprovidesPythonsupportbasedonJythonandthe previousexamplecouldbe implementedwiththe followingcode. As youcan see,Liferay’sservicescanbe accessedfromanyof these languages. Authoring The Basic Content Let’stake an example: You’ve beenassignedthe tasktobuildawebsite foran innovative new social networkingsitecalled Nose-ster.You’vedecidedtotake advantage of LiferayPortal anditsrapiddeploymentfeaturesas well asitsabilitytogeta fullyfunctional,content-richwebsite withintegratedsocial featuresup and runninginlittle time.Together,we cangetyoustarted. We’ll walkthroughthe creationof Nose-ster’swebsite,startingbycreatingandpublishingsome simple contentusingLiferay’sbuilt-inWYSIWYGeditor.We’ll thentake advantage of Liferay’srobust
  • 63. structure editor.We’ll use templatestodisplaythe contentandthenexploresome of the advanced publishingfeaturessuchasthe built-inworkflow andAssetPublisher. Creating Content The Simple Way As we’ve statedabove,contentisthe reasonwebsitesexist.LiferayPortal has made iteasierthan everto getcontentpublishedtoyoursite.Because LiferayPortal issoflexible,youcanuse basic authoringtoolsrightawayor take advantage of the more advancedfeatures.It’sadaptable toyour needs. We’ll beginbycreatingsimplecontentusingLiferay’sWYSIWYGEditorandthenwe’ll publishitto the home page of Nose-ster’swebsite.Thisisafastand straightforwardprocessthatdemonstrates howeasyit isto create and publishcontentonyourLiferayPortal instance.Let’slearnaboutthe WebContentsectionof the control panel sowe can create and publishourfirstpiecesof content. Choosing a Site in the Content Section Whenyoumanage webcontentfromthe Control Panel youcanselectthe locationwhere the contentresides.Forinstance,youcanaddcontentthat’s available toaspecificsite orgloballyacross the portal.The Contentsectionof the Control Panel displaysasitsheadingthe name of the site you’re currentlyworkingon.Thisheadingiscalledthe contextmenu selector:youcan change the scope of where you’dlike toview,editorcreate contentbyusingthe drop-downselectorattached to the heading. Rich, WYSIWYG Editing Once you have the Nose-stersite selected,clickonthe Web Contentlinkinthe Control Panel.Next, clickthe Add buttonunderthe Web Contenttab.This isa highlycustomizableformthatbydefault has twofields:atitle anda powerful WYSIWYGeditor.We couldcustomize thisformtocontain whateverfieldsourcontent needsbutlet’skeepthingssimplefornow. For now,type the words Welcome to Nose-sterinthe Namefield.Notice thatcontentcanbe localizedinwhateverlanguage youwant.If youclickonthe localize checkbox,twoselectboxes appearwhichallowyou to pickthe language you’re workinginandthe defaultlanguage.Youcan entertranslationsof yourcontentforany language inthe list.The screenshotbelow showsthis interface butfornow,we won’tbe usingit,so youcan leave itunchecked.Inthe contentfield,adda short sentence announcingthe website isupandrunning.
  • 64. The Web ContentEditorprovidesmanyoptionsforcustomization. Gettinga newwebsite upand runningisan excitingstepforanyone,whetheritisa large corporationor a small non-profitcharity.Tocelebrate thismomentousachievementatNose-ster, let’sgive ourannouncementsome of the pompandcircumstance we thinkitdeserves! Usingthe editor,selectall the textandthenchange the style to Heading 1 and the color to Dark Green. You couldinsertanimage here or evenmore textwithadifferentstyle,asdemonstratedinthe screenshotbelow.Youcan alsoadd bullets,numbering,linkstoanothersite orcustomimages.You can evenaddan emoticon.Let’sadda smileyface at the endof our announcement.
  • 65. : Viewyourcontentchangesdirectlyinthe editor. The WYSIWYG editorisa flexible tool thatgivesyouthe abilitytoaddtext,images,tables,linksand more.Additionally,youcanmodifythe displaytomatchthe purpose of the content. Plus, it’s integratedwiththe restof LiferayPortal:forexample,whenyouuploadanimage tobe addedto a page,that image can be viewedandmanipulatedinthe DocumentsandMediaportlet. If you’re HTML savvy,LiferayWCMdoesn’tleave yououtinthe cold.You can clickthe Source button and write yourownHTML if youwish. On the rightof the NewWebContentformare optionsthatallow youtocustomize yourweb content.
  • 66. Newwebcontentcanbe customizedinvariouswaysusingthe menuonthe right. Abstract: letsyouto create a brief summaryof the webcontent.You can alsopair the textwitha small image. Categorization:specifiesthe contenttype fromalistof options.Theyare Announcements,Blogs, General, News,PressRelease,and Test. You can alsocreate tags to make the contenteasiertofind ina search.Note thatthese categoriesare definedbyapropertyinthe propertiesfile. Schedule:customizesthe date andtime yourcontentpublishesand/orexpires. Display Page:letsyou determinewhere the webcontentsare displayedwhenlinkedfromother pages.The conceptof the Canonical URL is new toLiferay6.1. The Canonical URL is unique for articlesthatredirectthe visitortothe article’sdefaultdisplaypage. Imagine youhave a newspaperwithasportssectionanda technologysection.Youadda Sports page and a Tech page to your site,eachone witha specificbannerandlookandfeel.Youwantthe articlestoappear inthe appropriate pages,butyouknow inLiferayarticlesare notrelatedto pages. You can add an article as oftenasyou like indifferentwebcontentdisplayportletsorinconfigured AssetPublishers.Butif youhave a Viewin contextlink,where willyoushow yourarticle?Thisis where you’duse adefaultdisplaypage.Articlesthathave adefaultdisplaypage definedare shown withotherrelatedarticlesinthe same displaypage. Imagine youhave 100 sportsarticlesand100 tech articles.Inpreviousversionsof Liferayyou’dneed to create a page foreach article to show it.Now withonlyone sportspage and one techpage,you can showall articlesinone place ina consistentfashion. Creating A Display Page There are twowaysof creatinga displaypage.Youcan use a ContentDisplay Pagetemplate,which automaticallycreateseverythingyouneed,oryoucancreate one manually.The ContentDisplay Page template isfoundunder PageTemplates inthe Portal sectionof the Control Panel. To create a displaypage manually,addanAssetPublishertoa page.Thenmake it the DefaultAsset Publisherforthe page.ThisdefinesthisAssetPublisherasthe one that displaysthe contentif several AssetPublishersare onthe same page.Setthisup by clicking Configuration onyourAsset Publisher.Underthe Setup tab,navigate to Display Settings andcheck the checkbox labeled Setas the DefaultAssetPublisherfor This Page.
  • 67. Once you’ve givenanarticle itsdefaultdisplaypage,linkstothe article redirectthe usertoits defaultdisplaypage.Tosee howthisworks,addanAssetPublishertoanotherpage,like the Home page of the newspaper,andconfigure itto View in a Specific Portlet.Thissettingisfoundinthe AssetLink BehaviormenuunderDisplaySettings.If youclickonthe link,you’llbe redirectedtothe DefaultDisplayPage of the article. You nowsee that the linklookssomethinglikethis: www.nosester.com/nose-article Thisis an example of acanonical URL, and it’sa nice enhancementforSearchEngine Optimization (SEO) because the article’sURLbecomesthe page URL. To a searchengine that’scrawlingyoursite, thismeansthat the locationof yourarticle neverchanges.Andif youdecide touse the contenton anotherpage inthe future,the article isstill availableatthisURL. This feature isusedinsearch results,inrelatedassetsandinAssetPublishers. RelatedAssets:enablesyoutoconnectany numberof assetswithinasite or across the portal,even if theydon’tshare any tags and aren’tinthe same category.You can connectyourcontentto a Blogs Entry, Message BoardsMessage,WebContent,CalendarEvent,BookmarksEntry,Documentsand MediaDocument,anda Wiki Page. Thisblogentryhas linkstothree RelatedAssets:one webcontentdisplayandtwoblogentries.
  • 68. Permissions:customize whohasaccessto the content.Bydefault,contentisviewable byAnyone (GuestRole).Youcan limitviewablepermissionsbyselectinganyRole fromthe drop-downorinthe list.Additionally,LiferayPortal providesthe abilitytocustomize permissionsinmore detail.Select the More Options linknexttothe dropdownbuttonand you’ll findthe differentactivitiesyoucan grant or denyto yourwebcontent. PermissionsforWebContentallowyoutofine-tune how yourcontentisaccessed. Custom fields:customize metadataaboutthe webcontent.The fieldscanrepresentanythingyou like,suchasthe webcontent’sauthororcreationdate.If customfieldshave beendefinedforweb content(whichcanbe done fromthe CustomFields page of the Control Panel),theyappearhere. For thispiece of webcontent,we don’tneedtochange anything.Afteryou’re finishedwith permissions,click SaveasDraft.Thissavesthe contentindraftform.Once you’re satisfiedwithyour changes,selectPublish.Thismakesthe contentavailable fordisplay,butwe still have someworkto do to enable userstosee it.InLiferayWCM, all contentresidesinacontainer,whichisone of two portlets:WebContentDisplayorWebContentList.Byfar the most frequentlyusedisthe Web ContentDisplay portlet. Configuring Additional Portlet Settings Go back to the Control Panel,andclickon PortalSettings underthe Configuration heading.We’ve alreadylookedatthe optionsavailablefromthe Generaland Authentication links.Now let’sexamine the otherportal settingsoptions. USERS If you clickon Usersfromthe Portal Settingsscreen,you’ll findthree tabs:Fields,Reserved CredentialsandDefaultUserAssociations. The Fieldstaballowsyouto enable/disable the followingfields:  Enable/disablerequiringthe Termsof Use  Enable/disableuserscreennames autogeneration  Enable/disablerequiringthe lastnames  Enable/disablethe birthdayfield  Enable/disablethe genderfield
  • 69. The nexttab isReservedCredentials.Youcanenterscreennamesandemail addresseshere thatyou don’twant otherstouse.Liferaywill thenpreventusersfromregisteringwiththese screennames and email addresses.Youmightuse thisfeature topreventusersfromcreatingIDsthatlooklike administrativeIDsorthat have reservedwordsintheirnames. The DefaultUser Associationstabhasthree fieldsallowingyoutolist(one perline) sites,roles,and usergroupsyou wantnewusersto become membersof automatically.By default,Liferayassigns newusersto boththe Users role and the PowerUsersrole. If you have definedotherusergroups,sitesorrolesyouwantnewlycreateduserstobe membersof by default,enterthemhere.Forexample,youmayhave definedsite templatesincertainuser groupsto pre-populate endusers’private pages.If there isaparticularconfigurationyouwant everyone tohave,youmaywantto enterthose usergroupshere. Mail Host Names Mail HostNamesappearsafterAuthenticationandUserson the Portal Settingsscreenof the Control Panel.Youcan enterothermail hostnames(one perline) besidesthe one youconfiguredonthe General tab.Thisletsthe portal knowwhichmail hostnamesare ownedbyyourorganization. E-Mail Notifications There are five tabsunderthe Email Notificationspage of Portal Settings.The Sendertaballowsyou to setthe portal’sadministrativename andemail address.Bydefault,theseare Joe Bloggsand test@liferay.com.Youcanchange themto whateveryouwant. Thisname andemail addresswill appearin the fromfieldinall email messagessentbythe portal.
  • 70. You can customize the email template forthe email messagessenttouserswhohave justcreated theiraccounts. The other fourtabs are Account Created Notification,Email VerificationNotification,Password ChangedNotificationandPasswordResetNotification.These tabsallow youtocustomize the email messagesthatare sentto userseach time anyof those foureventsoccur.
  • 71. You can referto thislist of variablesthat’savailable foruse inemail templates. A listof tokens,entitled“Definitionof Terms,”isprovidedsoyoucan insertcertainvalues(suchas the portal URL or the userID) whenyouare settingupthe custom email messages. Content Sharing The ContentSharingsectionof the Portal Settingsareaof the Control Panel allowsyoutochoose whetherornot site administratorscandisplaycontentinsitesfromothersitestheyadminister.For example,suppose thatacertainuseris a site administratorof twosites: Engineering andMarketing. The checkbox inthe ContentSharingsectionof Portal Settingsdetermineswhetherornot the site administratorcandisplaycontentfromthe Marketingsite inthe Engineeringsite andvice versa. The ContentSharingsectionof Portal Settingsalsoallowsyoutochoose abehaviorforwhetheror not subsitescandisplaycontentfromparentsitesandforconfiguringthe defaults.There are three options: Enabledby Default: Thismeansthat subsitescandisplaycontentfromparentsitesbydefaultbut thiscan be disabledbyasite administrator. Disabledby Default:This meansthatsubsitescannotdisplaycontentfromparentsitesbydefault but thiscan be enabledbya site administrator. Disabled:Thismeans that subsitescannotdisplaycontentfromparentsitesandthisbehavior cannot be changedby a site administrator. Identification The identificationsectionhasseveral linksforaddresses,phone numbersandotherinformationyou can configure inyourportal.Thisallowsyouto setup contact informationforthe organizationthat ownsthe portal.Developerscanqueryforthisinformationintheirapplications. Miscellaneous: Display Settings
  • 73. Thissectionallowsyoutosetthe defaultportal language andthe time zone.Youcanalsoset upa portal-wide logowhichappearsinthe topleftcornersof portal pages. You can specifyvariousdisplaysettingsforyourportal includingoptionsforthe defaultlanguage, otheravailable language,time zone,portal logo,anddefaultthemesforthe portal andControl Panel. Liferay’sdefaulttheme isconfiguredtodisplaythe portal logo.Forcustomthemes,youcanchoose whetherornot to displaythe logo.Be careful tochoose animage file thatfitsthe space.If you pick somethingtoobig,itmightoverlapwiththe navigation. Configuring Liferay for High Availability LiferayPortal isa robust,enterprise-readyportal solution.Assuch,itisfullyreadytosupport mission-critical,enterpriseapplicationsinanenvironmentconfiguredformultipleredundanciesand 24/7 uptimes.The product,however,like otherproducts of itskind,doesn’tcome configuredthis wayout of the box,so there are some stepsthatneedto be takento tune itfor your needs. Thistopic coversthese topicsindetail.Liferayrunsonso manydifferentJavaEE applicationservers that we can’t coverall the differencesbetweenthem.Forthisreason,we’lldiscussLiferay configurationsonly.Forexample,we’ll lookathow toconfigure Liferaytoworkina clustered environment,butnothowto create the clusterinyour applicationserver.The documentationfor your particularapplicationserverisalwaysamuchbetterplace to learnthose kindsof things. Thistopic explainshowtoconfigure Liferayforanumberof advancedscenarios,suchas  Managing LiferaywithLiferayConnectedServices  Clustering  DistributedCaching  DeployingCustomizedversionsof Liferay  Performance TestingandTuning Duringthisdiscussion,we’ll mentionanumberof otheropensource productsuponwhichLiferay reliesformuchof thisfunctionality.These productsall have theirowndocumentationwhichshould be consultedfora fullerview of whatthese productscando.For example,LiferayusesEhcache for itscaching mechanism.We’llcoverhowtoconfigure Ehcache toenable cachesinLiferay,butwill referyouto that product’sdocumentationforfurtherinformationaboutthatproduct. SometimesLiferaysupportsmultiple productswhichperformthe same function.There are,for example,several singlesign-onimplementationsyoucanuse withLiferay.We’ll leave ituptoyou to selectwhichproductbestfitsthe needsof yourprojectwithoutrecommendingone productover another. Integrating Existing Users into Liferay Liferayprovidesanumberof userauthenticationoptions.Youcanconfigure Liferaytoconnectto LDAP or NTLMserverssousersfrom those environmentscanloginto yourLiferayserver.Youcan
  • 74. alsoconfigure Liferaytoallowuserstologinvia Facebookor OpenIDaccounts.Liferay’sControl Panel providesinterfacesforsettingupuserauthenticationusingthe followingservices:  LDAP  SSO  CAS  Facebook  NTLM  OpenID  Crowd  OpenSSO  SiteMinder  Shibboleth  SAML Let’sstart by learninghowtoconnectLiferaytoan LDAP server. LDAP You can use the LDAP tab of the Authenticationpage toconnectLiferaytoan LDAP directory.There are twoplacesfor youto configure the LDAPsettings:here inthe Control Panel orinyourLiferay server’sportal-ext.propertiesfile.Youcan browse anHTML versionof Liferay’sportal.propertiesfile online athttp://docs.liferay.com/portal/6.2/propertiesdoc/portal.properties.html.We recommend youuse the Control Panel toconfigure LDAPserverconnectionsettingssince yoursettingswillbe storedinthe database.Note that if youuse both,the settingsinthe database will be mergedwith the settingsinportal-ext.properties.If there’saconflictoroverlappingdata,the LDAPserver settingsinthe database take precedence overthe serverssetinthe portal-ext.propertiesfile. Configuringthe LDAPsettingsfromthe Control Panel iseasieranddoesnotrequire arestartof Liferay.The onlycompellingreasontouse the portal-ext.propertiesfileisif youhave manyLiferay nodeswhichneedbe configuredtorunagainstthe same LDAPdirectory.Inthat case,for yourinitial deployment,itmaybe easiertocopythe portal-ext.propertiesfile toall of the nodessothe first time theystart up,the settingsare correct.Regardlessof whichmethodyouuse,the available settingsare the same. You configure the global valuesfromthe LDAPtab of the Authenticationpage. Enabled:Checkthisbox to enable LDAPAuthentication. Required:Checkthisbox if LDAP authenticationisrequired.Liferaywill thennotallow ausertolog inunlesshe or she can successfullybindtothe LDAPdirectoryfirst.Uncheckthisbox if you wantto allowuserswithLiferayaccountsbutnoLDAP accounts to loginto the portal. LDAP Servers: LiferaysupportsconnectionstomultipleLDAPservers.Youcanuse the Add button beneaththisheadingtoaddLDAPservers.We explainhow toconfigure new LDAPserversbelow. Import/Export: Youcan importandexportuserdata fromLDAP directoriesusingthe following options:  ImportEnabled:Checkthisbox to cause Liferaytodo a massimportfromyour LDAP directories.If youwantLiferaytoonlysynchronize userswhentheylogin,leavethisbox
  • 75. unchecked.Definitelyleavethisuncheckedif youare workingina clusteredenvironment. Otherwise,all of yournodeswouldtrytodoa massimportwheneachof themstartsup.  Importon Startup Enabled: Checkthisbox to have Liferayrunthe importwhenitstarts up. Note:Thisbox onlyappearsif youcheck the ImportEnabled box above.  ExportEnabled:Checkthisbox to enable Liferaytoexportuseraccountsfromthe database to LDAP.Liferayusesa listenertotrackany changesmade to the User objectandwill push these changesoutto the LDAP serverwheneverthe Userobjectisupdated.Note that by defaultoneverylogin,fieldssuchasLastLoginDate are updated.Whenexportisenabled, thishas the effectof causinga userexporteverytime the userlogsin.Youcan disable this by settingthe followingpropertyinyourportal-ext.propertiesfile:  users.update.last.login=false Use LDAP Password Policy:Liferayusesitsownpasswordpolicybydefault.Thiscanbe configured on the PasswordPoliciespage of the Control Panel.Checkthe UseLDAPPassword Policy box if you wantto use the passwordpoliciesdefinedbyyourLDAPdirectory.Once thisisenabled,the PasswordPoliciestabwill displayamessage statingyouare notusinga local passwordpolicy.You will nowhave touse your LDAPdirectory’smechanismforsettingpasswordpolicies.Liferay does thisby parsingthe messagesinthe LDAPcontrolsreturnedbyyourLDAP server.Bydefault,the messagesinthe LDAPcontrolsthat Liferayislookingforare the messagesreturnedbythe Fedora DirectoryServer.If youare usinga differentLDAPserver,youwill needtocustomize the messagesin Liferay’sportal-ext.propertiesfile,asthere isnotyeta GUI for settingthis.See below forinstructions describinghowtodothis. Once you’ve finishedconfiguringLDAP,clickthe Savebutton.Next,let’s lookathow to addLDAP servers. Adding LDAP Servers The Add buttonbeneaththe LDAPserversheadingallowsyou toaddLDAP servers.If youhave more than one,youcan arrange the serversbyorderof preferenceusingthe up/downarrows.Whenyou add an LDAPServer,youwill needtoprovide several piecesof datasoLiferaycan bindto that LDAP serverandsearch it for userrecords.Regardlessof how manyLDAPserversyouadd,each serverhas the same configurationoptions. ServerName: Enter a name for yourLDAP server. DefaultValues:Several leadingdirectoryserversare listedhere.If youare usingone of these, select it andclickthe Reset Values button.The restof the formwill be populatedwiththe properdefault valuesforthat directory. Connection:These settingscoverthe basicconnectiontoLDAP.  Base ProviderURL:This tellsthe portal where the LDAPserverislocated.Make sure the machine onwhichLiferayisinstalledcancommunicate withthe LDAPserver.If there isa firewall betweenthe twosystems,checktomake sure the appropriate portsare opened.  Base DN:This isthe Base DistinguishedName foryourLDAPdirectory.Itis usuallymodeled afteryour organization.Foracommercial organization,itmaylooksimilartothis: dc=companynamehere,dc=com.
  • 76.  Principal: By default,the administratorIDispopulatedhere.If youhave removedthe default LDAP administrator,youwillneedtouse the fullyqualifiedname of the administrative credential youuse instead.Youneedanadministrativecredentialbecause Liferaywill be usingthisID to synchronize useraccounts toand fromLDAP.  Credentials:Thisis the passwordforthe administrative user. Thisis all youneedto make a regularconnectiontoan LDAPdirectory.The restof the configuration isoptional.Generally,the defaultattributemappingsprovide enoughdatatosynchronize backto the Liferaydatabase whenauserattemptsto login.To testthe connectiontoyour LDAPserver, clickthe Test LDAP Connection button. If you are runningyourLDAPdirectoryinSSL mode to preventcredential informationfrompassing throughthe networkunencrypted,youwill have toperformextrastepstoshare the encryptionkey and certificate betweenthe twosystems. For example,assumingyourLDAPdirectoryhappenstobe MicrosoftActive DirectoryonWindows Server2003, you wouldtake the followingstepstoshare the certificate: ClickStart→ AdministrativeTools → Certificate Authority.Highlightthe machine thatisthe certificate authority,right-clickonit,andclick Properties.From the General menu,click View Certificate.Selectthe Detailsview,andclick Copy To File. Use the resultingwizardtosave the certificate asa file.Aswiththe CASinstall (seethe below sectionentitled SingleSign-On),youwill needtoimportthe certificate intothe cacertskeystore.The importishandledbya commandlike the following: keytool -import-trustcacerts-keystore /some/path/jdk1.5.0_11/jre/lib/security/cacerts -storepass changeit-noprompt-aliasMyRootCA -file/some/path/MyRootCA.cer The keytoolutilityshipsaspart of the JavaSDK. Once thisis done,goback to the LDAP page in the Control Panel.Modifythe LDAPURL inthe Base DN fieldtothe secure versionbychangingthe protocol tohttpsand the port to 636 like the following: ldaps://myLdapServerHostname:636 Save the changes.Your LiferayPortal will now use LDAPinsecure mode forauthentication. Users:This sectioncontainssettingsforfindingusersinyourLDAPdirectory.  Authentication Search Filter: The searchfilterbox can be usedto determinethe search criteriaforuser logins.Bydefault,Liferayusesusers’email addressesfortheirloginnames. If you have changedthissetting,youwill needtomodifythe searchfilterhere,whichhas beenconfiguredtouse the email addressattributefromLDAPasa search criterion.For example,if youchangedLiferay’sauthenticationmethodtouse screennamesinsteadof the email addresses,youwouldmodifythe searchfiltersoitcan match the enteredloginname:  (cn=@screen_name@)  ImportSearch Filter: Dependingonthe LDAP server,there are differentwaystoidentifythe user.The defaultsettingisusuallyfine:  (objectClass=inetOrgPerson)
  • 77. If you wantto search foronlya subsetof usersor usersthathave differentLDAPobjectclasses,you can change this.  UserMapping:The nextseriesof fieldsallowsyoutodefine mappingsfromLDAPattributes to Liferayfields.ThoughyourLDAPuserattributesmaybe differentfromLDAPserverto LDAP server,there are five fieldsLiferayrequirestobe mappedforthe userto be recognized.Youmustdefine amappingtothe correspondingattributesinLDAPforthe followingLiferayfields: o Screen Name(e.g., uid) o Password (e.g., userPassword) o Email Address (e.g., mailor email) o First Name(e.g., nameorgivenName) o Last Name(e.g.,sn) If you’dlike toimportLDAP groupsas Liferayusergroups,make sure to define amappingforthe Liferaygroupfieldsothatmembershipinformationispreserved: o Group (e.g., member) The other LDAPusermappingfieldsare optional. The Control Panel providesdefaultmappingsforcommonlyusedLDAPattributes.Youcanalsoadd your ownmappingsif youwish.  Test LDAP Users:Once youhave your attribute mappingssetup(see above),clickthe Test LDAP Users buttonand Liferaywill attempttopull LDAP usersandmatch themwiththeir mappingsasa preview. Figure x:TestingLDAPUsers Groups:This sectioncontainssettingsformappingLDAPgroupstoLiferayusergroups.  ImportSearch Filter: This isthe filterforfindingthe LDAPgroupsthatyou want to map to Liferayusergroups.E.g.,  (objectClass=groupOfNames)
  • 78. Enter the LDAPgroup attributesyouwantretrievedforthismapping.The followingattributescanbe mapped.The Group Nameand Userfieldsare required,the Description isoptional. o Group Name(e.g., cn or o) o Description (e.g., description) o User(e.g., member)  Test LDAP Groups:Clickthe Test LDAPGroups buttonto displayalistof the groupsreturned by yoursearch filter. Export: This sectioncontainssettingsforexportinguserdatafrom LDAP.  UsersDN: Enterthe locationinyourLDAP tree where the userswill be stored.WhenLiferay doesan export,itwill exportthe userstothislocation.  UserDefault ObjectClasses: Whena useris exported,the useriscreatedwiththe listed defaultobjectclasses.Tofindoutwhatyourdefaultobjectclassesare,use anLDAPbrowser tool such as JXplorertolocate a userand view the ObjectClassattributesstoredinLDAPfor that user.  GroupsDN: Enterthe locationinyour LDAPtree where the groups will be stored.When Liferaydoesanexport,itwill exportthe groupstothislocation.  Group DefaultObjectClasses: Whena groupis exported,the groupiscreatedwiththe listed defaultobjectclasses.Tofindoutwhatyourdefaultobjectclassesare, use anLDAPbrowser tool such as Jxplorerto locate a groupand view the ObjectClassattributesstoredinLDAP for that group. Figure x:MappingLDAP Groups Once you’ve setall youroptionsandtestedyourconnection,click Save.Fromhere,youcanadd anotherLDAPserveror setjust a fewmore optionsthatapplyto all of your LDAPserverconnections. LDAP Options Not Available in the GUI
  • 79. Althoughmostof the LDAP configurationcanbe done from the Control Panel,there are several configurationparametersthatare onlyavailable byaddingtoyourLiferayserver’sportal- ext.propertiesfile.These optionsmaybe available inthe GUIin future versionsof LiferayPortal but for nowtheycan onlybe configuredbyeditingthe propertiesfile. If you needtochange any of these options,copythe LDAPsectionfromLiferay’sportal.properties file intoyourportal-ext.propertiesfile.Note thatsince youhave alreadyconfiguredLDAPfromthe GUI, any settingsfromthe propertiesfile thatmatchsettingsalreadyconfiguredinthe GUI will be ignored.The GUI, whichstoresthe settingsinthe database,alwaystakesprecedenceoverthe propertiesfile. ldap.auth.method=bind #ldap.auth.method=password-compare Seteitherbindorpassword-compare forthe LDAPauthenticationmethod.Bindispreferredbymost vendorssoyoudon’t have toworry aboutencryptionstrategies.Passwordcompare doesexactly whatit soundslike:itreadsthe user’spasswordoutof LDAP, decryptsit andcomparesit withthe user’spasswordinLiferay,syncingthe two. ldap.auth.password.encryption.algorithm= ldap.auth.password.encryption.algorithm.types=MD5,SHA Setthe passwordencryptiontousedtocompare passwordsif the propertyldap.auth.methodisset to password-compare. ldap.import.method=[user,group] If you setthisto user,Liferaywill importall usersfromthe specifiedportionof the LDAPtree.If you setthisto group,Liferaywill searchall the groupsand importthe usersin each group.If you have userswhodo not belongtoanygroups,theywill notbe imported. ldap.error.password.age=age ldap.error.password.expired=expired ldap.error.password.history=history ldap.error.password.not.changeable=notallowedtochange ldap.error.password.syntax=syntax ldap.error.password.trivial=trivial ldap.error.user.lockout=retrylimit These propertiesare alistof phrasesfromerror messageswhichcanpossiblybe returnedbythe LDAP server.Whenauserbindsto LDAP,the servercan return controls withits response of success or failure.These controlscontainamessage describingthe errororthe informationthatiscoming back withthe response.Thoughthe controlsare the same across LDAPservers,the messagescanbe
  • 80. different.The propertiesdescribedherecontainsnippetsof wordsfromthose messagesandwill workwithRedHat’s FedoraDirectoryServer.If youare notusingthat server,the wordsnippetsmay not workwithyourLDAP server.If theydon’t,youcan replace the valuesof these propertieswith phrasesfromyour server’serrormessages.Thiswill enable Liferaytorecognize them.Next,let’s lookat the Single Sign-OnsolutionsLiferaysupports. SSO Single Sign-Onsolutionsallowyoutoprovide asingle logincredentialformultiple systems.This allowsyoutohave people authenticatetothe Single Sign-Onproductandtheywill be automatically loggedinto Liferayandto otherproductsas well. Liferaysupportsseveral single sign-onsolutions.Of course,if yourproductisnotyetsupported,you may choose toimplementsupportforityourself byuse of the extensionenvironment.Alternatively, your organizationcanchoose tosponsorsupportfor it.Please contactsales@liferay.comformore informationaboutthis. Authentication: Central Authentication Service (CAS) CASis an authenticationsystemoriginallycreatedatYale University.Itisawidely-usedopensource single sign-onsolutionandwasthe firstSSOproduct to be supportedbyLiferay. Your firststepwill be tocopy the CASclient.jarfile toLiferay’slibraryfolder.OnTomcat,thisisin [Tomcat Home]/webapps/ROOT/WEB-INF/lib.Once you’vedone this,the CASclientwillbe available to Liferaythe nexttime youstartit. The CAS ServerapplicationrequiresaproperlyconfiguredSecure SocketLayercertificate onyour servertowork. If youwishto generate one yourself,youwillneedtouse the keytool utilitythat comeswith the JDK.Your firststepis to generate the key.Next,youexportthe keyintoafile.Finally, youimportthe keyintoyourlocal Java keystore.Forpublic,Internet-basedproduction environments,youwillneedtoeitherpurchase asignedkeyfromarecognizedcertificateauthority (suchas Thawte or Verisign) orhave yourkeysignedbya recognizedcertificate authority.For Intranets,youshouldhave yourITdepartmentpre-configure users’browserstoacceptthe certificate sotheydon’tgetwarningmessagesaboutthe certificate. To generate akey,use the followingcommand: keytool -genkey -aliastomcat-keypasschangeit-keyalgRSA Insteadof the passwordinthe example (changeit),use apasswordyouwill remember.If youare not usingTomcat,you may wantto use a differentaliasaswell.ForFirstandLast names,enterlocalhost or the host name of your server.Itcannot be an IP address. To exportthe keyto a file,use the followingcommand:
  • 81. keytool -export-aliastomcat-keypasschangeit-fileserver.cert Finally,toimportthe keyintoyourJavakeystore,use the followingcommand: keytool -import-aliastomcat-file %FILE_NAME% -keypasschangeit-keystore $JAVA_HOME/jre/lib/security/cacerts If you are ona Windowssystem,replace $JAVA_HOMEabove with%JAVA_HOME%.Of course,all of thisneedstobe done on the systemonwhichCAS will be running. Once your CASserverisup and running,youcanconfigure Liferaytouse it.Thisis a simple matterof navigatingtothe Settings→ Authentication → CAS tabinthe Control Panel.Enable CAS authenticationandthenmodifythe URLpropertiestopointtoyourCAS server. Enabled:Checkthisbox to enable CASsinglesign-on. Import from LDAP: A usermaybe authenticatedfromCASandnotyetexistinthe portal.Selectthis to automaticallyimportusersfromLDAPif theydonot existinthe portal. The rest of the settingsare variousURLs,withdefaultsincluded.Change localhostinthe default valuestopointto yourCAS server.Whenyouare finished,click Save.Afterthis,whenusersclickthe Sign In link,theywill be directedtothe CASservertosignin to Liferay. Authentication: Facebook LiferayPortal alsoenablesuserstologinusingtheirFacebookaccounts.Toenable thisfeature,you simplyneedtoselectthe Enablebox andenterthe Application IDandApplicationSecretwhich shouldhave beenprovidedtoyoubyFacebook.FacebookSSOworksbytakingthe primary Facebookemail addressandsearchingforthe same email addressinLiferay’sUser_table.If a match isfound,the useris automatically signedon(providedthe userclicked allow fromthe Facebook dialog).If there isn’tamatch,the userispromptedinLiferaytoadd a user fromFacebook.Once selected,anewuseriscreatedbyretrievingfourfieldsfromFacebook(firstname,lastname, email addressandgender). Authentication: NTLM NTLM isa Microsoft protocol thatcan be usedforauthenticationthroughMicrosoftInternet Explorer.ThoughMicrosofthasadoptedKerberosinmodernversionsof Windowsserver,NTLMis still usedwhenauthenticatingtoa workgroup.LiferayPortal now supportsNTLMv2 authentication. NTLM v2 ismore secure andhas a stronger authenticationprocessthanNTLMv1. Enabled:Checkthisbox to enable NTLMauthentication. Domain Controller:Enter the IPaddressof yourdomaincontroller.Thisisthe serverthatcontains the useraccounts youwant to use withLiferay.
  • 82. Domain: Enter the domain/ workgroupname. Service Account: You needtocreate a service accountforNTLM. Thisaccount will be acomputer account,not a useraccount. Service Password: Enterthe passwordforthe service account. Authentication: OpenID OpenIDisa newsingle sign-onstandardwhichisimplementedbymultiplevendors.The ideais multiple vendorscanimplementthe standardandthenuserscan registerforan ID withthe vendor theytrust.The credential issuedbythatvendorcanbe usedbyall the websitesthat support OpenID.Some highprofileOpenIDvendorsare AOL, LiveDoor,andLiveJournal.Please seethe OpenIDsite fora more complete list. A mainbenefitof OpenIDforthe userishe or she no longerhasto registerfora new account on everysite inwhichhe or she wantsto participate.Userscanregisteron one site (the OpenID provider’ssite)andthenuse those credentialstoauthenticate tomanywebsiteswhichsupport OpenID.Manywebsite ownersoftenstruggle tobuildcommunitiesbecauseendusersare reluctant to registerforsomany differentaccounts.SupportingOpenIDmakesiteasierforsite ownersto buildtheircommunitiesbecause the barrierstoparticipating(i.e.,the effortittakestoregisterfor and keeptrackof manyaccounts) are removed.All of the accountinformationiskeptwiththe OpenIDprovider,makingitmucheasiertomanage thisinformationandkeepituptodate. LiferayPortal can act as an OpenIDconsumer,allowinguserstoautomaticallyregisterandsignin withtheirOpenIDaccounts.Internally,the productuses OpenID4Javatoimplementthe feature. OpenIDisenabledbydefaultinLiferaybutcanbe disabledhere. Authentication: OpenSSO OpenSSOisanopensource single sign-onsolutionthatcomesfromthe code base of Sun’sSystem AccessManager product.LiferayintegrateswithOpenSSO,allowingyoutouse OpenSSOtointegrate Liferayintoan infrastructure thatcontainsamultitude of differentauthenticationschemesagainst differentrepositoriesof identities. You can setup OpenSSOonthe same serveras Liferayora differentbox.Follow the instructionsat the OpenSSOsite toinstall OpenSSO.Once youhave itinstalled,create the Liferayadministrative userin it.Users are mappedback andforth byscreennames.By default,the Liferayadministrative userhas a screenname of test,so inOpenSSO,youwouldregisterthe userwiththe IDof test andan email addressof test@liferay.com.Once youhave the usersetup,login to OpenSSOusingthisuser. In the same browserwindow,gotothe URL for yourserverrunningLiferayandloginas the same user,usingthe email address test@liferay.com.Gotothe Control Panel andclick Settings→ Authentication → OpenSSO.Modifythe three URLfields(LoginURL,LogoutURL, and Service URL) so theypointto yourOpenSSOserver(i.e.,onlymodifythe hostname portionof the URLs),clickthe
  • 83. Enabled checkbox,and thenclick Save.LiferaythenredirectsuserstoOpenSSOwhentheyclickthe Sign In link. Using Scripting for Advanced Flexibility Liferayprovidesarobustscriptengine thatcan be usedto interpretscriptsinBeanshell,Javascript, Groovy,PythonandRuby. The scriptengine came outof Liferay’sinvolvementwiththe Romulus project(http://www.ict-romulus.eu).ItwasoriginallydevelopedtosupportnonJava-basedportlets, but hasnow beenextendedtohandle alotmore.Forexample,whenLiferay’sworkflow framework was introduced,the scriptenginewasleveragedtosupportthe executionof scriptsfromwithina workflowmodule.A scriptconsole isnow includedinthe ServerAdministrationportletinthe control panel.Itallows systemadministratorsaneasywayto execute scriptstoperformrepetitive user maintenance operations,bulkmanipulationsusingthe LiferayAPItoensure consistency,oreven systemlevel operations. Thistopic helpsyoutounderstandLiferay’sscriptengine andcoversthe followingtopics:  AccessingLiferay’sservice layerfromascript  Runningscriptsfromthe scriptconsole  Usingthe scriptengine withworkflow  LeveragingcustomJavatoolsinthe script engine The most commonthingyou’ll wanttodo isaccess Liferay’sservices.If youhave anyfamiliaritywith Liferay’sdevelopertoolsandAPI,thiswill be asnapforyou. Using Liferay Portal as a collaborative platform Many siteshave grownorganically.You mayhave grownyour communitybyusingseparate tools: firsta forumsapplication,andthenawiki forcollaborative documentation,andmaybe evenachat application.Itcanbe hard (anderror-prone) tointegrate all theseapplicationssoyouruserscan use themseamlessly.Thankfully,Liferayincludesasuite of collaborative applications,andthey’reall integratedtogether. LiferayPortal offerseverystandardcollaborative applicationthat’savailable.Theseapplications range from personal productivityapplicationslikeacalendarandemail,tocommunity-building applicationslikemessageboards,polls,andwikis.
  • 84. LiferayPortal’smessage boardsare asfullyfeaturedasanystandalone forumapplication,withthe addedbenefitthatthey’re integratedwiththe restof the system. Thisis a suite of integratedapplicationswithall the featuresof similar,standalone applications.For example,LiferayPortal’smessage boardsinclude categoriesandsubcategories,messagethreads, captcha, RSS feeds,email notification,postingviaemail,andmuchmore.Butmore thanthis,the applicationsare integratedwiththe restof LiferayPortal’sframework.Userslogin,andtheirprofiles are usedautomaticallybythe message boardsandall the othercollaborativeapplications.Andas we’ll see later,functionalityfromthe builtinapplicationscanbe addedtoyour ownto provide featureslike commentsinyourownsoftware,andyoudon’thave towrite any code to do it. LiferayPortal’swiki isanotherexampleof afull-featuredcollaborativeapplication.Ithassupportfor authoringpagesina WYSWYG editor,ormore advanceduserscan use the easy-to-learnstandard Wiki Creole syntax.Userscancommentonwiki articles,anditkeepsafull historyof everychange that’sbeenmade,allowinguserstorevertbackto any change.It alsosupportsRSSfeeds(justabout everyLiferayapplicationdoes)soyoucan subscribe tosee new articlesastheyare posted.Each site can have one or more wikis,andeachwiki canhave one or more top-level nodes. One importantfeature of all the collaborativeapplications–aswell aswebcontentanddocuments– isthe Recycle Bin.If usersdelete contentthatneedstobe restoredlater,youdon’thave tofinditin your backups:it’sin the Recycle Bin.
  • 85. The Recycle Bincan holdany kindof content. We couldgo throughall of LiferayPortal’scollaborativeapplications,butlet’ssave thatforthe body of the book.LiferayPortal’ssuite of collaborativeapplicationsincludesablog (completewithblog aggregationfeaturessoyoucan publishmultiple users’blogentriesinone place),achatapplication for userswhoare online atthe same time,message boards,awiki,aknowledgebase thatyoucan use to publishalibraryof technical articles,apollingsystemyoucanuse tohave usersvote on certainquestions,andpersonal productivityapplicationslikeacalendarandemail. LiferayPortal includeseveryapplicationyou’llneedtoenable userstocollaborate. Manual Configuration for Sending Mail You don’thave to use the setupwizardto configure Liferay.The setupwizardbehindthe scenes createsa configurationfilethatyoucan create manually.Create atextfile calledportal- ext.propertiesinyourLiferayHome folder.Thisfile overridesdefaultpropertiesthatcome with Liferay.The firstsettingyou’ll override isthe defaultconfigurationthatpointsLiferaytothe embeddedHSQLdatabase. As statedabove,there are twowaysto setup the connection:  Use the built-inconnectionpool.  Use yourapplicationserver’sconnectionpool. Use the setupwizardif you’re usingthe built-inconnectionpool.If youwanttouse your application server’spool,continuewiththisprocedure.
  • 86. If you wantto use your applicationserver’s connectionpool,youwill have tocreate one inyour applicationserverthatpointstoyourdatabase.Itshouldbe calledjdbc/LiferayPool.Tocause Liferay to use thisconnectionpool,addthe followingdirectivetoyourportal-ext.propertiesfile: Next,install Liferayaccordingtothe instructionsforyourapplicationserver.Once it’sinstalled,you can set upthe mail configuration. For mail,youcan use Liferay’scontrol panel tocreate the configurationandthisisthe recommendedway.Goto ControlPanel → Server Administration → Mailand enteryoursettingsfor your mail sessionsettings.If,however,you’resettingupa lotof Liferaymachinesandthey’re all goingto have similarmail configurations,it’seasiertodothe configurationonce and thencopythe configurationfiletomultiple machines.Inthiscase,you’ll wanttouse the portal-ext.propertiesfile. To use the built-inmail session,use the followingpropertiesandcustomizetheirvaluesforyour environment: To use your applicationserver’smail session,create itfirst.Thenspecifyitinthe portal- ext.propertiesfile: Whenyou’ve finished,save the file. Restartthe Server. Running Scripts from the Control Panel To see a verysimple example of the scriptconsole inaction, logintothe portal asan administrator and navigate tothe control panel → ServerAdministration→ Script.Change the scripttype to Groovyand modifythe currentcode to looklike the following: Clickthe execute buttonandcheckthe console orthe log foryour output. Let’simplementamore realisticexample.We’ll retrieve some userinformationfromthe database, make some changesand thenupdate the database withourchanges.Ourcompanyhas updatedthe
  • 87. termsof use andrequiresthateveryone be presentedwiththe updatedtermsof use onthe nextlog in.Whenusersagree to the termsof use,a Boolean attribute calledagreedToTermsOfUse issetin theiruserrecords.Aslongas the Boolean istrue,Liferaywill notpresentthe userwiththe termsof use.However,if we setthisflagtofalse foreveryone,all userswill have toagree toitagainto use the site. We’ll againuse Groovy,soensure the scripttype is setto Groovyand execute the followingcode to checkthe statusof the agreedToTermsOfUse attribute: Nowwe’ll actuallyupdate eachuserinthe systemtosethisor her agreedToTermsOfUse attribute to false.We’ll be sure toskipthe defaultuserasthe defaultuserisnotrequiredtoagree to the Terms of Use.We’ll alsoskipthe adminuserthat’scurrentlyloggedinandrunningthe script.If you’re loggedinas someone otherthantest@liferay.com,be sure toupdate the followingscriptbefore runningit. To verifythe scripthasupdatedthe records,run the firstscriptagain and youshouldsee all users (exceptthe defaultuserandyourID) have beenupdated. That’s all that’sneededtorunscriptsand to accessthe Liferayservice layer.There are,however, some thingstokeepinmindwhenworkingwiththe scriptconsole:  There isno undo  There isno preview  WhenusingLocal Services,nopermissionscheckingisenforced  Scriptsare executedsynchronously,sobe careful withscriptsthatmighttake a longtime to execute.
  • 88. For these reasons,youwanttouse the scriptconsole withcare,andtest runyour scriptson non- productionsystemsbeforeyourunthemonproduction. Of course,the scriptengine hasusesbeyondthe scriptconsole.One of the mainusesof itisin designingworkflows. Extending and customizing Liferay for your own needs BeyondusingLiferayasa developmentplatformfornew applications,LiferayPortal hasalsobeen designedtobe extendedandmodified.Asanopensource project,itssource code isavailable,but LiferayPortal’sdevelopershave designedthe producttomake iteasyto buildwhateveryouwant out of it. The first(and easiest) wayof customizingpartsof LiferayPortal iswithApplicationDisplay templates.These letyouchange the waybuilt-inapplicationslook.Forexample,if youdon’tlike the DocumentsandMediaLibrary’sfile managerview withlarge icons,youcancreate an Application Displaytemplate thatshowsdocumentsinalistview.If youdon’tlike the layoutof the Blogsportlet, youcan change itso that it has the lookyouwant. LiferayPortal goesfarbeyondthis,though.Special software componentscalled hook andextplugins enable developerstochange anyaspectof Liferay’sinterface andbehavior–withouthavingto modifyanyof LiferayPortal’ssource code.Thisprovidesyouall the benefitsof buildingyoursite fromscratch, but withoutall the efforttoactuallybuildfromscratch.If you wantto make a change to the userregistrationscreens,addsupportfora proprietarysingle sign-onmechanismthatyou’ve written,adda feature tothe message boardsapplication,oranythingelse,youcanmake those customizations.Andif you’re adeveloper,we’resure youknow thatit’sa whole loteasierto customize somethingthatalmostdoesthingsexactlythe wayyouwantthanitis to write that feature fromscratch.With LiferayPortal,you can have yourcake and eatit too. FOR MORE REFERENCES VISIT: https://www.liferay.com/resources https://dev.liferay.com/develop https://web.liferay.com/community/forums https://web.liferay.com/community/wiki https://web.liferay.com/community/blogs/highlighted
  • 89. Thank You!!! For any help contact: Shikhar Saran Srivastava shikhar.447@rediffmail.com 8339041831 http://shikhar.honor.es