text;
stringlengths
5
32.6k
you can use the ldap tab of the authentication page to connect liferay to an there are two places for you to configure the ldap settings here in the control panel or in the url file which is we recommend you use the control panel since your configuration settings will be stored in the database. both, the settings in the database will be merged with the settings in if there's a conflict or overlapping data, the ldap servers set in the control panel take precedence over the servers set in configuring the ldap settings from the control panel is easier and does not require a restart of liferay. use the url file is if you have many liferay nodes which will be configured to run against the same ldap directory. your initial deployment, it may be easier to copy the url file to all of the nodes so the first time they start up, the settings are regardless of which method you use, the available settings are the you configure the global values from the ldap tab of the authentication page enabled check this box to enable ldap authentication required check this box if ldap authentication is required. then not allow a user to log in unless he or she can successfully bind to the uncheck this box if you want to allow users with liferay accounts but no ldap accounts to log in to the portal ldap servers liferay supports connections to multiple ldap servers. click on the add button beneath this heading to add ldap servers. importexport you can import and export user data from ldap directories import enabled check this box to cause liferay to do a mass import from if you want liferay to only synchronize users when they log in, leave this box unchecked. definitely leave this unchecked if you are working in a clustered environment. otherwise, all of your nodes would try to do a mass import when each of them starts up import on startup enabled check this box to have liferay run the import note this box only appears if you check the import export enabled check this box to enable liferay to export user accounts liferay uses a listener to track any changes made to the user object and will push these changes out to the ldap server whenever the user object is updated. note that by default on every login, fields such as lastlogindate are updated. when export is enabled, this has the effect of causing a user export every time the user logs in. disable this by setting the following property in your url use ldap password policy liferay uses its own password policy by default. this can be configured on the password policies page of the control panel. the use ldap password policy box if you want to use the password policies defined by your ldap directory. once this is enabled, the password policies tab will display a message stating you are not using a local password policy. will now have to use your ldap directory's mechanism for setting password liferay does this by parsing the messages in the ldap controls by default, the messages in the ldap controls that liferay is looking for are the messages returned by the fedora directory server. if you are using a different ldap server, you will need to customize the messages in liferay's url file, as there is not yet a gui see below for instructions describing how to do this once you've finished configuring ldap, click the save button. the add button beneath the ldap servers heading allows you to add ldap servers. if you have more than one, you can arrange the servers by order of preference when you add an ldap server, you will need to provide several pieces of data so liferay can bind to that ldap server and search it for regardless of how many ldap servers you add, each server has the server name enter a name for your ldap server default values several leading directory servers are listed here. are using one of these, select it and click the reset values button. the form will be populated with the proper default values for that directory connection these settings cover the basic connection to ldap base provider url this tells the portal where the ldap server is located. make sure the machine on which liferay is installed can communicate with the if there is a firewall between the two systems, check to make sure the appropriate ports are opened base dn this is the base distinguished name for your ldap directory. usually modeled after your organization. for a commercial organization, it may look similar to this dccompanynamehere,dccom principal by default, the administrator id is populated here. removed the default ldap administrator, you will need to use the fully qualified name of the administrative credential you use instead. administrative credential because liferay will be using this id to synchronize credentials this is the password for the administrative user this is all you need to make a regular connection to an ldap directory. of the configuration is optional. provide enough data to synchronize back to the liferay database when a user to test the connection to your ldap server, click the test if you are running your ldap directory in ssl mode to prevent credential information from passing through the network unencrypted, you will have to perform extra steps to share the encryption key and certificate between the two for example, assuming your ldap directory happens to be microsoft active directory on windows server 2003, you would take the following steps to share click start administrative tools certificate authority. highlight the machine that is the certificate authority, right-click on it, and from the general menu, click view certificate. details view, and click copy to file. use the resulting wizard to save the as with the cas install see the below section entitled single sign-on, you will need to import the certificate into the cacerts the import is handled by a command like the following the keytool utility ships as part of the java sdk once this is done, go back to the ldap page in the control panel. ldap url in the base dn field to the secure version by changing the protocol to ldaps and the port to 636 like this your liferay portal will now use ldap in secure mode for users this section contains settings for finding users in your ldap authentication search filter the search filter box can be used to determine the search criteria for user logins. addresses for their login names. if you have changed this setting, you will need to modify the search filter here, which has been configured to use the email address attribute from ldap as a search criterion. changed liferay's authentication method to use screen names instead of the email addresses, you would modify the search filter so it can match the import search filter depending on the ldap server, there are different objectclassinetorgperson is fine but if you want to search for only a subset of users or users that have different object classes, you can change user mapping the next series of fields allows you to define mappings from ldap attributes to liferay fields. though your ldap user attributes may be different from ldap server to ldap server, there are five fields liferay requires to be mapped for the user to be recognized. to the corresponding attributes in ldap for the following liferay fields the control panel provides default mappings for commonly used ldap attributes. you can also add your own mappings if you wish groups this section contains settings for mapping ldap groups to liferay import search filter this is the filter for finding ldap groups you want to enter the ldap group attributes you want retrieved for this the following attributes can be mapped test ldap groups click the test ldap groups to display a list of the groups returned by your search filter export this section contains settings for exporting user data from ldap users dn enter the location in your ldap tree where the users will be when liferay does an export, it will export the users to this user default object classes when a user is exported, the user is created with the listed default object classes. to find out what your default object classes are, use an ldap browser tool such as jxplorer to locate a user and view the object class attributes stored in ldap for that user groups dn enter the location in your ldap tree where the groups will be when liferay does an export, it will export the groups to this group default object classes when a group is exported, the group is created classes are, use an ldap browser tool such as jxplorer to locate a group and view the object class attributes stored in ldap for that group figure 15.16 mapping ldap groups once you've set all your options and tested your connection, click save. here, you can add another ldap server or set just a few more options that apply to all of your ldap server connections although most of the ldap configuration can be done from the control panel, there are several configuration parameters that are only available by editing these options will be available in the gui in future versions of liferay portal but for now they can only be configured by editing if you need to change any of these options, copy the ldap section from the url file into your url file. you have already configured ldap from the gui, any settings from the properties file that match settings already configured in the gui will be ignored. which stores the settings in the database, always takes precedence over the set either bind or password-compare for the ldap authentication method. preferred by most vendors so you don't have to worry about encryption password compare does exactly what it sounds like it reads the user's password out of ldap, decrypts it and compares it with the user's password in liferay, syncing the two set the password encryption to used to compare passwords if the property url is set to password-compare if you set this to user, liferay will import all users from the specified if you set this to group, liferay will search all the groups and import the users in each group. belong to any groups, they will not be imported these properties are a list of phrases from error messages which can possibly be when a user binds to ldap, the server can return controls with its response of success or failure. message describing the error or the information that is coming back with the though the controls are the same across ldap servers, the messages can the properties described here contain snippets of words from those messages and will work with red hat's fedora directory server. using that server, the word snippets may not work with your ldap server. don't, you can replace the values of these properties with phrases from your this will enable liferay to recognize them. look at the single sign-on solutions liferay supports single sign-on solutions allow you to provide a single login credential for this allows you to have people authenticate to the single sign-on product and they will be automatically logged in to liferay and to other liferay supports several single sign-on solutions. not yet supported, you may choose to implement support for it yourself by use of alternatively, your organization can choose to please contact email for more information cas is an authentication system originally created at yale university. widely-used open source single sign-on solution and was the first sso product to please follow the documentation for cas to install it on your application server your first step will be to copy the cas client.jar file to liferay's library on tomcat, this is in tomcat homewebappsrootweb-inflib. you've done this, the cas client will be available to liferay the next time you the cas server application requires a properly configured secure socket layer certificate on your server to work. if you wish to generate one yourself, you will need to use the keytool utility that comes with the jdk. next, you export the key into a file. import the key into your local java key store. production environments, you will need to either purchase a signed key from a recognized certificate authority such as thawte or verisign or have your key signed by a recognized certificate authority. your it department pre-configure users' browsers to accept the certificate so they don't get warning messages about the certificate to generate a key, use the following command instead of the password in the example changeit , use a password you will if you are not using tomcat, you may want to use a different alias as for first and last names, enter localhost or the host name of your to export the key to a file, use the following command finally, to import the key into your java key store, use the following command if you are on a windows system, replace javahome above with javahome. of course, all of this needs to be done on the system on which cas will be once your cas server is up and running, you can configure liferay to use it. this is a simple matter of navigating to the settings authentication cas tab in the control panel. enable cas authentication and then modify the url properties to point to your cas server enabled check this box to enable cas single sign-on import from ldap a user may be authenticated from cas and not yet exist in select this to automatically import users from ldap if they do not the rest of the settings are various urls, with defaults included. localhost in the default values to point to your cas server. after this, when users click the sign in link, they will be directed to the cas server to sign in to liferay liferay portal also enables users to log in using their facebook accounts. enable this feature, you simply need to select the enable box and enter the application id and application secret which should have been provided to you by facebook sso works by taking the primary facebook email address and searching for the same email address in liferay's user table. found, the user is automatically signed on provided the user clicked allow if there isn't a match, the user is prompted in liferay to add a user from facebook. once selected, a new user is created by retrieving four fields from facebook first name, last name, email address and ntlm is a microsoft protocol that can be used for authentication through though microsoft has adopted kerberos in modern versions of windows server, ntlm is still used when authenticating to a liferay portal now supports ntlm v2 authentication. secure and has a stronger authentication process than ntlmv1 enabled check this box to enable ntlm authentication domain controller enter the ip address of your domain controller. the server that contains the user accounts you want to use with liferay domain enter the domain workgroup name service account you need to create a service account for ntlm. will be a computer account, not a user account service password enter the password for the service account openid is a new single sign-on standard which is implemented by multiple the idea is multiple vendors can implement the standard and then users can register for an id with the vendor they trust. vendor can be used by all the web sites that support openid. please see the openid site url for a a main benefit of openid for the user is he or she no longer has to register for a new account on every site in which he or she wants to participate. register on one site the openid provider's site and then use those credentials to authenticate to many web sites which support openid. site owners often struggle to build communities because end users are reluctant to register for so many different accounts. supporting openid makes it easier for site owners to build their communities because the barriers to participating i.e., the effort it takes to register for and keep track of many accounts are all of the account information is kept with the openid provider, making it much easier to manage this information and keep it up to date liferay portal can act as an openid consumer, allowing users to automatically register and sign in with their openid accounts. openid is enabled by default in liferay but can be disabled here atlassian crowd is a web-based single sign-on product similar to cas. be used to manage authentication to many different web applications and because atlassian crowd implements an openid producer, liferay works and has simply use the openid authentication feature in liferay to opensso is an open source single sign-on solution that comes from the code base of sun's system access manager product. liferay integrates with opensso, allowing you to use opensso to integrate liferay into an infrastructure that contains a multitude of different authentication schemes against different you can set up opensso on the same server as liferay or a different box. the instructions at the opensso site once you have it installed, create the liferay administrative user in it. are mapped back and forth by screen names. administrative user has a screen name of test, so in opensso, you would register the user with the id of test and an email address of once you have the user set up, log in to open sso using this in the same browser window, go to the url for your server running liferay and log in as the same user, using the email address email. the three url fields login url, logout url and service url so they point to your opensso server i.e., only modify the host name portion of the urls, click the enabled check box and then click save. liferay will then redirect users to opensso when they click the sign in link siteminder is a single sign-on implementation from computer associates. 5.2 introduced built-in integration with siteminder. http header to implement its single sign-on solution to enable siteminder authentication in liferay, check the enabled box on the if you are also using ldap with liferay, you can check the if this box is checked, users authenticated from siteminder who do not exist in the portal will be imported from ldap the last field defines the header siteminder is using to keep track of the user. the default value is already populated. if you have customized the field for your installation, enter the custom value here when you are finished, click save. next, let's learn about the saml 2.0 saml is an xml-based open standard data format for exchanging authentication and authorization data between parties known as an identity provider and a service an identity provider is a trusted provider that enables users to use single sign-on to access other websites. a service provider is a website that hosts applications and grants access only to identified users with proper saml is maintained by the oasis security services technical liferay 6.1 ee and later versions support saml 2.0 integration via the saml 2.0 provider ee plugin. app from liferay marketplace that allows liferay to act as a saml 2.0 identity provider or as a service provider. first, we'll look at how to set liferay up as an identity provider and then we'll look at how to set it up as a service in order to set liferay up to act as a saml identity provider, use the following install the saml 2.0 provider ee app, either via the control panel's marketplace interface or manually. successfully deployed, look for the saml admin entry in the portal section next, you need to generate a keystore to use with saml. keystore using the java keytool utility. navigate to your liferay homedata directory in a command prompt or terminal and run the following command to generate a keystore there upon running this command, you'll be prompted to enter the following this information will be included in the keystore. questions, a keystore named url is created with the alias entity id liferaysamlidp and the password liferay. simple, use the same password for liferaysamlidp as for the keystore log in to your portal as an administrator and click on the saml admin entry for the saml role, select identity provider, and for the entity id, enter the alias of the keystore you generated in your liferay after clicking save, additional options appear in the saml admin control leave the saml role and entity role as you configured them in step 3. certificate and private key section, enter the same information that you entered when you generated your keystore, then click save. your certificate and private key information, you can view information about your certificate or download your certificate finally, after you've saved your certificate and private key information, check the enabled box at the top of the general tab and click save. you've successfully set liferay up as a saml identity provider! to configure liferay's saml identity provider settings, navigate to the identity provider tab of the saml admin control panel portlet. liferay as a saml identity provider is only useful if you can connect to one or navigate to the service provider connections tab of the saml admin control panel portlet and click on the add service provider button to add a saml service provider. right now, we don't have one to add but next, we'll learn how to set liferay up as a saml service provider after you've set up another liferay instance as a service provider, you can come back to this liferay instance's control panel and add the service provider in order to set liferay up to act as a saml service provider, use the following many of the steps are similar to the ones for setting liferay up to act a single liferay instance can be configured as a saml identify provider or a saml service provider but not both! already set up one liferay instance as a saml identity provider, use a different liferay instance as a saml service provider install the saml 2.0 provider ee app, either via the control panel's id liferaysamlsp and the password liferay. use the same password for liferaysamlsp as for the keystore itself for the saml role, select service provider, and for note that these options are different than if you were setting up liferay as an identity provider. next, you need to configure an identity provider connection. identity provider connection tab. enter a name for the identity provider, enter its entity id, and enter its metadata url. separate liferay instance as an identify provider following the previous instructions, you'd enter the following information finally, after you've saved your certificate and private key information and configured an identity provider connection, check the enabled box at the top of the general tab and click save. liferay up as a saml service provider! if you'd like to configure liferay's saml service provider settings, navigate to the service provider tab of the saml admin control panel portlet note the previous two sections explained how to use the saml portlet's control panel interface to configure liferay as an identity provider and as a it's possible to configure liferay as an identity provider or as a service provider entirely through the url file. however, we recommend using the control panel saml interface because it specifies required fields and validates some fields suppose that you have two liferay instances running on ports 8080 and 9080 of suppose further that you've configured the liferay running on port 8080 as a saml identity provider and the liferay running on port 9080 as a saml service provider, following the instructions above. and service provider have been correctly configured, navigating to initiates the saml identity provider based login process. service provider based login process, just navigate to the liferay running on port 9080 and click sign in, navigate to try to access a protected resource url such as a control panel url. examine how to configure portal-wide user settings the users page of portal settings has three tabs fields, reserved credentials the fields tab allows you to enabledisable the following fields enabledisable requiring the terms of use enabledisable requiring the last names enabledisable the birthday field enabledisable the gender field the next tab is reserved credentials. you can enter screen names and email addresses here that you don't want others to use. users from registering with these screen names and email addresses. use this feature to prevent users from creating ids that look like administrative ids or that have reserved words in their names the default user associations tab has three fields allowing you to list one per line sites, roles and user groups you want new users to become members of by default, liferay assigns new users to both the users role and if you have defined other user groups, sites or roles you want newly created users to be members of by default, enter them here. defined site templates in certain user groups to pre-populate end users' private if there is a particular configuration you want everyone to have, you may want to enter those user groups here.;;
in this chapter, we introduced liferay marketplace, your one-stop shop for browsing and downloading liferay-compatible applications. browse, purchase, download, and install apps. url or through liferay portal's when you purchase apps, you can do so via your personal account for information about developing and uploading apps to liferay marketplace, please see the marketplace chapter of the liferay after discussing liferay marketplace, we discussed general plugin management. covered liferay portlet plugins as well as layout, theme, hook, ext, and web finally, we looked at how to manually deploy plugins to liferay and discussed some configuration issues.;;
"one of the primary ways of extending the functionality of liferay portal is by plugin is an umbrella term for installable portlet, theme, layout template, hook, ext and web module java ee.war files. comes bundled with a number of functional portlets, themes, layout templates, hooks and web modules, plugins provide a means of extending liferay to be able portlets are small web applications that run in a portion of a web page. heart of any portal implementation is its portlets, because all of the functionality of a portal resides in its portlets. the container's job is to manage the portal's pages and to aggregate the set of portlets that are to appear on any particular page. core doesn't contain application code. instead, all of the features and functionality of your portal application must reside in its portlets tip liferay 4.4.2 and below support the portlet 1.0 standard jsr-168. liferay 5.0 and above support the portlet 2.0 standard jsr-286. portlet 2.0 portlets in liferay 4.4.2, but because the portlet 2.0 standard is backwards-compatible, portlets written to the 1.0 standard will run in liferay portlet applications, like servlet applications, have become a java standard which various portal server vendors have implemented. defines the portlet 1.0 specification and the jsr-286 standard defines the a java standard portlet should be deployable on any portlet container which supports the standard. portlets are placed on the page in a certain order by the end user and are served up dynamically by the portal this means certain givens that apply to servlet-based projects, such as control over urls or access to the object, don't apply in portlet projects, because the portal server generates these objects portal applications come generally in two flavors 1 portlets can be written to provide small amounts of functionality and then aggregated by the portal server into a larger application or 2 whole applications can be written to reside in only one or a few portlet windows. the choice is up to those designing the the developer only has to worry about what happens inside of the portlet itself; the portal server handles building out the page as it is most developers nowadays like to use certain frameworks to develop their applications, because those frameworks provide both functionality and structure for example, struts enforces the model-view-controller design pattern and provides lots of functionality, such as custom tags and form validation, that make it easier for a developer to implement certain standard with liferay, developers are free to use all of the leading frameworks in the java ee space, including struts, spring mvc and java server faces. allows developers familiar with those frameworks to more easily implement portlets and also facilitates the quick porting of an application using those frameworks over to a portlet implementation additionally, liferay allows for the consuming of php and ruby applications as portlets so you do not need to be a java developer in order to take advantage of liferay's built-in features such as user management, sites, organizations, page building and content management. you can also use scripting languages such as you can use the plugins sdk to deploy your php or ruby application as a portlet and it will run seamlessly inside of liferay. plenty of examples of this; to see them, check out the plugins sdk from liferay's public code repository does your organization make use of any enterprise planning erp software that exposes its data via web services? you could write a portlet plugin for liferay that can consume that data and display it as part of a dashboard page for your do you subscribe to a stock service? you could pull stock quotes from that service and display them on your page, instead of using liferay's built-in do you have a need to combine the functionality of two or more servlet-based applications on one page? you could make them into portlet plugins and have liferay display them in whatever layout you want. struts, spring mvc or jsf applications you want to integrate with your portal? it is a straightforward task to migrate these applications into liferay, then they can take advantage of the layout, security and administration infrastructure that liferay provides figure 13.15 envision theme from liferay's theme themes are hot deployable plugins which can completely transform the look and most organizations have their own look and feel standards which go across all of the web sites and web applications in the infrastructure. liferay makes it possible for a site designer to create a theme plugin which can be installed, allowing for the complete transformation of the portal to whatever there are lots of available theme plugins on liferay's web site and more are being added every day. this makes it easier for those who wish to develop themes for liferay, as you can now choose a theme which most closely resembles what you want to do and then customize it. than starting a theme from scratch. you can learn more about theme development figure 13.16 murali theme from liferay's theme layout templates are ways of choosing how your portlets will be arranged on a they make up the body of your page, the large area into which you can drag liferay portal comes with several built-in layout templates. if you have a complex page layout especially for your home page, you may wish to create a custom layout template of your own. hook plugins were introduced with liferay 5.2. as the name implies, they allow hooking into liferay's core functionality. this means they enable developers to override or replace functionality that is in the core of the system. hook into the eventing system, model listeners and portal properties. also override liferay's core jsps with your own. have been designed to replace most of the reasons for using the extension environment with something that is easier to use and hot deployable web plugins are regular java ee web modules designed to work with liferay. liferay supports integration with various enterprise service bus esb implementations, as well as single sign-on implementations, workflow engines and these are implemented as web modules used by liferay portlets to provide liferay portal has a section of the control panel called plugins installation, which you can find under the server heading. this section not only allows you to see what plugins are installed in your portal, but also it enables you to run the search indexer on those portlets that support it and install new portlets use the dockbar's go to menu to select control panel. you should now see the page which allows you to configure and install portlets the default view of the plugins installation page shows which plugins are already installed on the system and whether or not they are active. plugins tab allows you reindex certain portlets to improve their searchability. the theme and layout template plugins tabs display which portal roles can access figure 13.18 plugins installation theme tab default if you would like to see what plugins are available, you can do so by clicking the install more button, where changes based on please note the machine running liferay must have access to the internet to read the official and community repositories. machine does not have internet access, you will need to download the plugins from the site and install them manually. we will discuss how to do this later in it's easy to navigate from the initial page of the plugin installer to different pages since the plugins are listed alphabetically. number of items per page and navigate to a specific page if you know where a particular plugin appears in the list. this is a standard feature of liferay and you will see it in most of liferay's portlets after you click the install more button, a new view appears. this view has multiple tabs, and by default, displays the portlet plugins tab. note the list displayed is a list of all of the plugins available across all of the repositories to which the server is subscribed. mechanism which allows you to search for plugins by their name, by whether or not they are installed, by tag or by which repository they belong to. a plugin, choose the plugin by clicking on its name. use online web forms on your web site, you might want to install the web form this portlet provides a handy interface which allows you to create you can specify an address to which the results find the web form portlet in the list by searching for it or browsing to it. once you have found it, click on its name. another page will be displayed which describes the portlet plugin in more detail. click this button to install your plugin figure 13.20 installing the web form once you click install, your chosen plugin will automatically download and be installed on your instance of liferay. if you have the liferay console open, you can view the deployment as it happens. when it is finished, you should be able to go back to the add application window and add your new plugin to a page in the same procedure is used for installing new liferay themes, layout templates, instead of the portlet plugins tab, you would use the appropriate tab for the type of plugin you wish to install to view the list of for themes, convenient thumbnails plus a larger version when you click on the details of a particular theme are shown in the list after clicking on the install button for a theme, the theme becomes available on the look and feel tab of any page installing plugins manually is almost as easy as installing plugins via the there are several scenarios in which you would need to install plugins manually rather than from liferay's repositories your server is firewalled without access to the internet. impossible for your instance of liferay to connect to the plugin you are installing portlets which you have either purchased from a vendor, downloaded separately or developed yourself for security reasons, you do not want to allow portal administrators to install plugins from the internet before they are evaluated you can still use the control panel to install plugins that are not available this is by far the easiest way to install plugins if your server is firewalled, you will not see any plugins displayed in the portlet plugins or theme plugins tabs. instead, you will need to click the this gives you a simple interface for uploading a.war file containing a plugin to your liferay portal figure 13.21 installing a plugin click the browse button and navigate your file system to find the portlet or the other field on the page is optional you can specify your own context for deployment. if you leave this field blank, the default context defined in the plugin or the.war file name itself will be that's all the information the plugin installer needs in order to deploy your and your plugin will be uploaded to the server and deployed. you should see it in the add content window. available on the look and feel tab in the page definition if you do not wish to use the update manager or plugin installer to deploy plugins, you can also deploy them at the operating system level. liferay starts, it creates a hot deploy folder which is, by default, created inside the liferay home folder. this folder generally resides one directory up from where your application server is installed, though it may be elsewhere depending on which application server you are running. liferay home folder is for your application server, please see the section on the first time liferay is launched, it will create a folder structure in liferay home to house various configuration and one of the folders it creates is called deploy. copy a portlet or theme plugin into this folder, liferay will deploy it and make it available for use just as though you'd installed it via the plugin installer in fact, this is what the plugin installer is doing behind you can change the defaults for this directory structure so it is stored anywhere you like by modifying the appropriate properties in your please see the above section on the url file for more information to have liferay hot deploy a portlet or theme plugin, copy the plugin into your hot deploy folder, which by default is in liferay homedeploy. watching the liferay console, you should see messages like the following the available for use message means your plugin was installed correctly and is available for use in the portal sometimes plugins fail to install. there can be different reasons for installation failure based on several factors, including the container upon which liferay is running changing the configuration options in multiple places you can often tell whether or not you have a plugin deployment problem by looking at the liferay server console. if the hot deploy listener recognizes the plugin, you'll see a plugin copied successfully message. not followed up by an available for use message then you have an issue with your plugin deployment configuration, probably due to one of the factors listed let's take a look at each of these factors tip this applies to liferay versions prior to version 4.3.5. versions above 4.3.5 are able to auto detect the type of server it is running on, which makes things a lot easier. if you are running a newer version of liferay, you can skip this section. if you are upgrading from one of these liferay by default comes as a bundle or as a.war file. has been made to make the.war file as generic as possible, sometimes the default settings are inappropriate for the container upon which liferay is most of these problems were resolved in liferay 4.3.5 with the addition of code that allows liferay to determine which application server it is running on and adjust the way it deploys plugins as a result. one of these older versions, you may still have settings in your url file that are no longer needed. the manual override of the default value of url in versions of liferay prior to 4.3.5, there is a property called url that defines the folder where plugins are deployed after the hot deploy utilities have finished preparing them. folder the container defines as an auto-deploy or a hot deploy folder. default in older versions of liferay, this property is set to..webapps. default value works for tomcat containers if tomcat has been launched from its bin folder but will not work for other containers that define their hot deploy folders in a different place. in newer versions of liferay, this value is automatically set to the default for the application server upon which liferay for example, glassfish defines the hot deploy folder as a folder called autodeploy inside of the domain folder in which your server is running. default, this is in domainsdomain1autodeploy. the hot deploy folder as a root folder inside the particular server by default, this is in serverdefaultdeploy. weblogic defines this folder inside of the domain by default, this is in userprojectsdomains autodeploy the best thing to do when upgrading to newer versions of liferay portal is to remove this property altogether. it is not needed, as the autodetection of the container handles the hot deploy location. if, for whatever reason, you need to customize the location of the hot deploy folder, follow the instructions below you will first need to determine where the hot deploy folder is for the consult your product documentation for this. have this value, there are two places in which you can set it in the url file and in the plugin installer portlet to change this setting in the url file, browse to where liferay was deployed in your application server. inside of this folder should be here you will find the url file. open this file in a text editor and look for the property if it does not appear in the file, you can add it. safest way to set this property, as we will see later, is to define the property using an absolute path from the root of your file system to your application for example, if you are using glassfish, and you have the server installed in javaglassfish, your url property would look like the following remember, if you are on a windows system, use forward slashes instead of back save the file and then restart your container. instead of changing the hot deploy destination directory in your url file, you can do it via the plugin installer. the setting this way, navigate to the plugins installation page of the control panel, click the install more button. next, click on the configuration tab of the plugin there are a number of settings you can change on this tab, including the default folders for hot deploy, where liferay should look for figure 13.22 changing the hot deploy destination the setting to change is the field labeled destination directory. to the full path to your container's auto deploy folder from the root of your when you are finished, click the save button at the bottom of the the setting will now take effect without your having to restart your note the setting in the control panel overrides the setting in the if you are having hot deploy trouble in liferay versions 4.3.5 and greater, it is possible the administrator of your application server has changed the default folder for auto deploy in your application server. to set url to the customized folder location as you would with older versions of liferay. in liferay 4.3.5 and greater, this setting still add the property to your url file and set its value to the fully qualified path to the auto deploy folder configured some containers, such as websphere, don't have a hot deploy feature. unfortunately, these containers do not work with liferay's hot deploy system. but this does not mean you cannot install plugins on these containers. deploy plugins manually using the application server's deployment tools. is able to pick up the portlet plugins once they get deployed to the container manually, especially if you add it to the same enterprise application project when liferay hot deploys portlet and theme.war files, it sometimes makes modifications to those files right before deployment. deploy plugins using an application server vendor's tools, you will want to run your plugins through this process before you attempt to deploy them navigate back to the configuration tab of the plugin installer. location you would like plugin.war files to be copied to after they are processed by liferay's plugin installer process into the destination directory you will use this as a staging directory for your plugins before you install them manually with your server's deployment tools. now you can deploy plugins using the plugin installer portlet or by dropping.war files into your auto deploy directory. liferay will pick up the files, modify them and then copy the result into the destination directory you have you may then deploy them from here to your application server if you don't have one already, create a url file in the liferay home folder of your liferay installation. create a folder called websphere-deploy inside your liferayhome this is the folder where the lucene index, jackrabbit config and make sure the url file inside the plugin you want to install has the following context parameter in it liferay versions 5.2.2 and higher will automatically inject this into the url file on websphere containers the websphere deploy occurs in two steps. you will first use liferay's tools to pre-deploy the file and then use websphere's tools to do the actual this is because liferay makes deployment-time modifications to the plugins right before they are actually deployed to the application for other application servers, this can usually be done in one step, because liferay can make the modifications and then copy the resulting.war file into an autodeploy folder to have it actually deployed. websphere does not have an autodeploy feature, we need to separate these two deploy your.war file using liferay's plugin installer or by copying it into liferay will make its modifications, and because we changed the url in the first step, it will copy the resulting.war file into liferayhomewebsphere-deploy. copied successfully message in the log use websphere's tools to deploy the.war file. the.war file equal to the file name i.e., my-first-portlet . once the.war file is deployed, save it to the master configuration go back to the applications enterprise applications screen in the you will see your portlet is deployed but not yet liferay will immediately recognize the portlet has been deployed and the portlet will be automatically started and registered upon subsequent restarts of websphere experienced websphere system administrators can further automate this by writing a script which watches the websphere-deploy directory and uses wsadmin commands to then deploy plugins automatically sometimes, especially during development when several people have administrative access to the server at the same time, the auto deploy folder location may inadvertently be customized in both the url file and in the if this happens, the value in the control panel takes precedence over the value in the properties file. if you go into the control panel and change the value to the correct setting, plugin deployment will start working";;
you don't have to use the setup wizard to configure liferay. behind the scenes creates a configuration file that you can create manually. create a text file called url in your liferay home folder. this file overrides default properties that come with liferay. you'll override is the default configuration that points liferay to the embedded as stated above, there are two ways to set up the connection use the built-in connection pool use your application server's connection pool use the setup wizard if you're using the built-in connection pool. to use your application server's pool, continue with this procedure if you want to use your application server's connection pool, you will have to create one in your application server that points to your database. to cause liferay to use this connection pool, add the following directive to your url file next, install liferay according to the instructions for your application server. once it's installed, you can set up the mail configuration for mail, you can use liferay's control panel to create the configuration and go to control panel server administration mail and enter your settings for your mail session settings. however, you're setting up a lot of liferay machines and they're all going to have similar mail configurations, it's easier to do the configuration once and then copy the configuration file to multiple machines. to use the built-in mail session, use the following properties and customize their values for your environment to use your application server's mail session, create it first. when you've finished, save the file next, follow the instructions for installing liferay on your particular application server in the section below.;;
liferay home is one folder above jetty's install location for this section, we'll refer to jetty server's installation location as if you do not already have an existing jetty server, we recommend you download a liferayjetty bundle from if you have an existing jetty server or would like to install liferay on jetty manually, please follow the steps below before you begin, make sure you have downloaded the latest liferay.war file and liferay portal dependencies from the liferay.war file should be called liferay-portal-6.1.x-.war and the dependencies file should be called now that you have all of your installation files, you're ready to start installing and configuring liferay on jetty let's work with the liferay depenency jar files first unzip the jar files found in the liferay portal dependencies zip file to your take care to extract the zip file's.jar files directly into this folder next, you need several.jar files which are included as part of the liferay many application servers ship with these already on the the best way to get the appropriate versions of these files is to download the liferay source code and get them from once you have downloaded the liferay source, unzip the source into a we'll refer to the location of the liferay source as copy the following jars from liferaysourcelibdevelopment to your make sure the jdbc driver for your database is accessible to jetty. the jdbc driver for your version of the database server. extract the jar file and copy it to jettyhomelibextliferay now that your.jar files are in place, let's configure your domain to get jetty ready for running liferay portal, you must make a number of modifications that involve configuration files, initialization files and run create a url file to modify the behavior of jetty's url. it's best to base your url file on the default one found in now that your class loading is specified, let's create initialization files and run scripts that invoke these configuration directives during jetty's this initialization file does the following create a run script appropriate to your operating system classpath and resource base of your web application lastly, create the following folders now that your general jetty startup files are set in place, let's consider how you will manage your data source if you want to manage your data source within jetty, continue following the if you want to use the built-in liferay data source, you can skip this section management of databases in jetty is done via the file edit url and insert the following text within the root element to specify the data pool for your data be sure to pass in value jdbcliferaypool as the second argument be sure to replace the url database value i.e. lportal , user value and password value with values specific to your database your data pool needs jetty's jndi and jetty plus libraries loaded to access have sections that load these libraries as long as jndi and plus options to set these options, edit your url file and add jndi and plus as values for the options variable now you have your database specified and ready for use with liferay on let's consider your mail session next if you want to manage your mail session within jetty, use the following if you want to use the built-in liferay mail session, you can skip management of mail sessions in jetty is done via the configuration file within the root element to specify your mail session. pass in value mailmailsession as the first argument and to replace the mail now you'll be able to use this mail session with liferay let's revisit your configuration to make sure we'll be able to access your data source and mail session from liferay portal first, navigate to the liferay home folder, which is one folder above if you are using jetty to manage your data source, add the following to your url file in your liferay home to refer to your otherwise, if you are using liferay portal to manage your data source, follow the instructions in the deploy liferay section for using the setup wizard if want to use liferay portal to manage your mail session, you can configure the mail session within liferay portal. your portal as described in the deploy liferay section, go to control panel server administration mail and enter the settings for otherwise, if you are using jetty to manage your mail session, add the following to your url file to reference that mail session let's start your server and deploy liferay portal! liferay can be deployed as an exploded web archive within jettyhomewebapps if you already have an application folder jettyhomewebappsroot, delete it or move it to a location outside of jettyhomewebapps then extract the contents of the liferay portal.war file into before you start liferay portal, let's consider whether you want to also start the setup wizard along with liferay portal - do this if you want to configure your portal, setup your site's administrative account andor manage your database within liferay if this is your first time starting liferay portal 6.1, the setup wizard is if you want to re-run the wizard, specify url in your properties file e.g. the setup wizard is invoked during server startup start liferay portal without invoking the setup wizard - do this if want to preserve your current portal settings to start the server without triggering the setup wizard, specify the url file the setup wizard creates has url conveniently specified for you note property values in url override now its time to launch liferay portal! start liferay portal by executing url windows or url see the section on the setup wizard above for more information about the setup you've just installed and deployed liferay portal on jetty - way to go!;;
"note java 7 deprecated some classes used by jboss 5.1. liferay home is one folder above jboss's install location download and install jboss eap 5.1.x into your preferred directory. directory is referred to as jbosshome throughout this section download the latest version of the liferay portal.war file now that you have all of your installation files, you are ready to start installing and configuring liferay on jboss first we'll take care of dependencies and potential conflicts unzip liferay's dependencies to jbosshomeserverdefaultlib download your database driver.jar file and put it into the folder as for demonstration purposes, we'll download the mysql connectorj and put its.jar file into the jbosshomeserverdefaultlib folder next we'll delete jboss's hibernate validator and hsql jars to prevent remove the following files from next we need to clean up the entries for the jar files that we deleted comment out the blocks with the name hsqldbrealm and jmsxarealm around we'll also delete some other files that can cause conflicts with liferay when remove the following directories and files from jbosshomeserverdefaultdeploy delete the following in jbosshomeserverdefaultdeployers now that we've added all of the necessary dependencies and removed unnecessary files, it's time to deploy liferay navigate to url and delete all extract the contents of the liferay war file into this folder create a file named url in the this configuration file defines a domain that does not allow parent classes instead, liferay portal's classes are exported. comes with its own hibernate jars, the above configuration is needed to tell liferay to ignore these jars and to use its own jars instead. this configuration, you may encounter a hibernate exception. necessary to add a url file to the web-inf folder of each liferay plugin; see the deploying plugins section below jbosshome and add the following properties delete the following files from the url add the following lines to your url file note the autodeploy folder must be set with the full name of the folder; you can't use any variables to define the location the first line is the value for the default server. line should point to the deploy folder configured for jboss increase the memory given to the jvm by deafult jboss gives 512mb memory to the jvm. likely that you will face the following error at startup, runtime or shutdown to give the jvm more memory, edit url url on nix and change -xmx512m to -xmx1024m start the jboss application server liferay is now successfully installed on jboss 5.1 add a url to the web-inf folder of each plugin, with the the liferaydomain referenced in the above configuration is the domain we defined above during step 3 of the deploying liferay section. plugins to use the liferay domain ensures that if jboss and liferay have different versions of a jar file, the plugin will use liferay's version. this configuration, liferay plugins might end up using the wrong versions of jar you can make this configuration either before or after the plugin war has been deployed, as long as jboss is not running. this configuration before deployment. otherwise, if there's a jar conflict, you'll have to shut down your server, configure the plugin to use the liferay you should've already set up your hot deploy folder in the previous section. deploy your plugins, simply copy them into your configured liferay home deploy folder, and they are automatically copied to jboss's default deploy folder let's see how we'd get it installed on that";;
liferay home is one folder above resin's install location for this section, we will refer to your resin server's installation location as if you do not already have an existing resin server, we recommend you download a liferayresin bundle from if you have an existing resin server or would like to install liferay on resin manually, please follow the steps below before you begin, make sure you have downloaded the latest liferay.war file and liferay portal dependencies from the liferay.war file should be called liferay-portal-6.1.x-.war and the dependencies file should be called now that you have all of your installation files, you are ready to start installing and configuring liferay on resin let's work with the depenency jar files first unzip the jar files found in the liferay portal dependencies zip file to take care to extract the zip file's.jar files directly into this folder next, you need several.jar files which are included as part of the liferay many application servers ship with these already on the the best way to get the appropriate versions of these files is to download the liferay source code and get them from once you have downloaded the liferay source, unzip the source into a we'll refer to the location of the liferay source as great! now you have your.jar files in place. the primary file used in configuring your domain is you need to make common modifications necessary to you'll also create a run script and add a folder to hold but let's start with the changes to url make the following modifications to your url. your application cluster make the following configuration changes to accomplish this, insert the following elements as server defaults for your main application cluster. create an appropriate script in resinhomebin to help you start resin if you're on windows, create a batch script url and insert the following text in the script if you're on unixlinux, create shell script url and create the folder resinhomelog if it doesn't already exist. resin, the server generates log files access, jvm-default and watchdog-manager in this folder now that you've completed some important common configuration tasks to support if you want to manage your data source within resin, continue following the if you want to use the built-in liferay data source, you can skip this section management of databases in resin is done via the configuration file edit url and insert a element be sure to give it the jndi name jdbcliferaypool and add it within the application tier cluster element as in the example below be sure to replace the url database value i.e. lportal , user value and password value with values specific to your database resin is now managing your database connection. if you want to manage your mail session within resin, use the following if you want to use the built-in liferay mail session, you can skip management of mail sessions in resin is done via the configuration file that specifies your mail session. be sure to give it the jndi name add your mail element within the application tier cluster use the example below, replacing its values with the values of your you can specify additional properties for your mail session as needed now that your mail session is squared away, we'll make sure liferay can access let's make sure liferay's connected to your data source and mail session first, navigate to the liferay home folder, which is one folder above resin's install location i.e. resinhome.. if you're using resin to manage your data source, add the following to your url file in your liferay home to refer to your data if you're using liferay portal to manage your data source, follow the instructions in the deploy liferay section for using the setup wizard if want to use liferay portal to manage your mail session, configure the mail session within liferay portal. that is, after starting your portal as described in the deploy liferay section, go to control panel server administration mail and enter the settings for your mail session if you're using resin to manage your mail session, add the following to your url file to reference that mail session now liferay can access your database and your mail session. liferay can be deployed as an exploded web archive within resinhomewebapps if you already have an application folder resinhomewebappsroot, delete it or move it to a location outside of resinhomewebapps extract the contents of the liferay portal.war file into the following files should now exist in your before you start liferay portal, let's consider whether you want to also start the setup wizard along with liferay portal - do this if you want to configure your portal, setup your site's administrative account andor manage your database within liferay if this is your first time starting liferay portal 6.1, the setup wizard is if you want to re-run the wizard, specify url in your properties file e.g. the setup wizard is invoked during server startup start liferay portal without invoking the setup wizard - do this if want to preserve your current portal settings to start the server without triggering the setup wizard, specify the url file the setup wizard creates has url conveniently specified for you note property values in url override now its time to launch liferay portal on resin! start liferay portal by executing your url windows or url please see the section above describing how to use the setup wizard you've installed liferay portal on resin and have it up and;;
liferay home is one folder above tomcat's install location for this section, we will refer to your tomcat server's installation location as if you do not already have an existing tomcat server, we recommend you download a liferaytomcat bundle from if you have an existing tomcat server or would like to install liferay on tomcat manually, please follow the steps below before you begin, make sure you have downloaded the latest liferay.war file and liferay portal dependencies from the liferay.war file should be called liferay-portal-6.1.x-.war and the dependencies file should be called next, let's get started by addressing liferay's library dependencies liferay portal needs to have the liferay portal dependency jars, an appropriate jdbc driver and a few other jars installed extract the liferay dependencies file to tomcathomelibext. do not extract to this directory, you can copy the dependencies archive to this directory, extract them and then delete the archive next, you need several.jar files which are included as part of the liferay many application servers ship with these already on the class path but tomcat does not. the best way to get the appropriate versions of these files is to download the liferay source code and get them from once you have downloaded the liferay source, unzip the source into a we'll refer to the location of the liferay source as make sure the jdbc driver for your database is accessible by tomcat. the jdbc driver for your version of the database server. extract the jar file and copy it to tomcathomelibext liferay requires an additional.jar on tomcat installations to manage this is included in the bundle but you need to add it if you're place this file in tomcat's libext folder now that you have the necessary libraries in place, we'll move on to configuring the steps in this section focus on creating a context for your web application modifying the list of classesjars to be loaded let's get started with our configuration tasks create a url windows or url file unix, linux, mac os in when you start tomcat, catalina calls edit the file and populate it with following this sets the character encoding to utf-8, sets the time zone to greenwich mean time and allocates memory to the java virtual machine create the directory tomcathomeconfcatalinalocalhost and create a edit this file and populate it with the following contents to set up a portal web application setting crosscontexttrue allows multiple web apps to use the same class in the content above you will also find commented instructions and tags for configuring a jaas realm, disabling persistent sessions and open url and replace the line this allows catalina to access the dependency jars you extracted to to ensure consistent use of utf-8 uri encoding, edit url and add the attribute uriencodingutf-8 to below is an example of specifying this encoding make sure there is no url file in your now let's consider configuration of your database if you want tomcat to manage your data source, use the following procedure. you want to use liferay's built-in data source, you can skip this section make sure your database server is installed and working. a different machine, make sure it's accessible from your liferay machine add your data source as a resource in the context of your web application note the above resource definition assumes your database name is lportal and your mysql username and password are both root. these values with your own database name and credentials your tomcat managed data source is now configured. if you want to manage your mail session within tomcat, use the following if you want to use the built-in liferay mail session, you can skip create a mail session bound to mailmailsession. edit tomcat url and configure a mail session. replace the mail session values with your own your mail session is configured. next, we'll make sure liferay will be able to access your mail session and database in this section we'll specify appropriate properties for liferay to use in connecting to your database and mail session if you are using tomcat to manage your data source, add the following to your url file in your liferay home to refer to your otherwise, if you are using liferay portal to manage your data source, follow the instructions in the deploy liferay section for using the setup wizard if want to use liferay portal to manage your mail session, you can configure the mail session within liferay portal. your portal as described in the deploy liferay section, go to control panel server administration mail and enter the settings for otherwise, if you are using tomcat to manage your mail session, add the following to your url file to reference that mail session now it's time to deploy liferay portal on your tomcat we'll deploy liferay as an exploded web archive within your if you are manually installing liferay on a clean tomcat server, delete the contents of the tomcathomewebappsroot directory. then extract the liferay.war file to before you start liferay portal, let's consider whether you want to also start the setup wizard along with liferay portal - do this if you want to configure your portal, setup your site's administrative account andor manage your database within liferay if this is your first time starting liferay portal 6.1, the setup wizard is if you want to re-run the wizard, specify url in your properties file e.g. the setup wizard is invoked during server startup start liferay portal without invoking the setup wizard - do this if want to preserve your current portal settings to start the server without triggering the setup wizard, specify the url file the setup wizard creates has url conveniently specified for you note property values in url override now its time to launch liferay portal on tomcat! start tomcat by executing url or if the setup wizard was disabled, your site's home page opens in your otherwise, the setup wizard opens in your browser to use the setup wizard, please see the section above congratulations on successfully installing and deploying liferay on tomcat!;;
jonas is somewhat unique among the open-source application servers for two reasons it is built entirely on an osgi core, allowing for dynamic deployment of simultaneous webapps and containers and allows the clean separation of the configuration directory from the server itself. configuration is recommended by the developers of jonas as a way to cleanly deploy so you can revert to default settings later if you don't have an existing jonas installation, it is recommeded to use the available liferay-jonas bundle, which can be downloaded from given the unique nature of the server, there are a few steps to consider in the otherwise, installing on jonas follows much the same pattern as other servers configure, copy dependencies and deploy a pristine jonas installation comes with a number of samples, tutorials and a lot of this is unnecessary and irrelevant for in addition, the server already contains an application deployed to the root context, which you must remove prior to installing the liferay.war package and which you'd want to remove anyway for a production jonas allows you to decide where to place all the server configuration and deployment settings, also called jonasbase. created by unzipping the jonas application likely called jonas-full-5.2.2 or similar is referred to as jonasroot. this allows a unique, clean separation between application and configuration the structure of jonasbase is by default, the jonasbase directory is the same as jonasroot. new jonasbase is a simple process, outlined in the jonas configuration to remove sample files and unneeded configuration navigate to the directory you unpackaged jonas into, jonasbase find the following sample directories and remove them navigate to jonasbaseconf and remove the following files this disables the default settings for the databases available in jonas, as well as removing configuration for jetty as a container to use for the to remove the default application installed on the root context this will fully remove the maven deployment plan and artifact for the jonas default application, as well as the administration console from now that jonas is prepared for configuring liferay to run on the server as its root application, you can begin tuning the settings for liferay. jonas has its own deployment of hypersonic it uses internally. of hsql must be disabled, along with other jonas services, so they won't to turn of hsql and other jonas-level services open the file url in the directory jonasbaseconf find the configuration section for the jonas database manager, starting change the datasources definition around line 353 to read thereby preventing the hsql database from being used internally find the services configuration around line 82 modify the services being loaded to read this prevents the internal db and security services from interfering to put jonas into production mode for proper deployment of liferay, find the this allows jonas to startup appropriately with liferay installed now that the application server has all extraneous services and applications disabled, you can now tweak the configuration of the containers within jonas by default, the tomcat container is set to listen on a different http port and port than liferay uses by default to change the tomcat ports for liferay's use open the file url inside of jonasbaseconf find the connector definition around line 69 change it to reflect the default ports if you are using any other settings in tomcat's server settings, you can adjust the ports if needed such as changing the ajp port from 9009 to to modify the osgi defaults to ensure required java packages are bootsrapped by open the file url inside of jonasbaseconfosgi find the declaration for javase-packages around line 93 and add the following packages to make it read to ensure the required packages are loaded once you have the required configuration in place, all that is left is to copy the portal dependencies and the liferay.war file and start the server. maintains libraries inside jonasbaselibext and the application inside to install liferay-portal-dependencies-6.1.x-.zip unzip the archive liferay-portal-dependencies-6.1.x-.zip on your navigate to jonasbaselibext copy the.jar files from liferay-portal-dependencies-6.1.x- to install any additional libraries needed, such as database connectors to deploy the liferay-portal-6.1.x-.war file copy the liferay-portal-6.1.x-.war file from its current directory paste the liferay-portal-6.1.x-.war file into the deploy directory once the necessary files have been installed, all that is needed is to start run the command url start on windows and.jonas start on unix-lixe jonas starts and liferay opens a browser to;;
liferay home is one folder above the domain to which you will be installing for example, if your domain location is oraclemiddlewareuserprojectsdomainsbasedomain, then your liferay home for this section, we will refer to your weblogic server's installation location before you begin, make sure you have downloaded the latest liferay.war file and liferay portal dependencies from the liferay.war file should be called liferay-portal-6.1.x-.war and the dependencies file should be called these instructions assume you have already configured a domain and server and that you have access to the weblogic console note weblogic 10.0 supports jdk 1.5 but does not support jdk 1.6 now that you have all of your installation files, you are ready to start installing and configuring liferay on weblogic liferay requires several.jar files including the liferay dependency jars and a jar file for your database driver. the following steps describe how to install navigate to the folder which corresponds to the domain to which you will be inside this folder is a lib folder. dependencies archive to this folder so the dependency.jar files are if weblogic does not already have access to the jdbc driver for your database, copy the driver to your domain's lib folder as well you will also need the url copied to your domain's lib folder or you will get sax parsing errors after you deploy liferay. url, url, url and url to the endorsed folder you just created now that you have your weblogic installation is loaded up with jar files for liferay to use, let's consider how to configure your database if you want weblogic to manage your data source, use the following procedure. you want to use liferay's built-in data source, you can skip this section browse to your weblogic console. click the lock edit button above the domain structure tree on the left side of the page from the domain structure tree on the left, select data sources. the new button on the right side of the screen give the data source a name, such as liferaydatasource define the jndi name as jdbcliferaypool select your database type, the driver class and then click the next button accept the defaults on the next screen by clicking next on the next screen, put in your database name, host name, database user if you have been following the defaults we have been using so far, you would use lportal, localhost, root, and no password as the next screen allows you to test your database configuration. if the test succeeds, you have configured your select the check box of the server to which you want to deploy this data source adminserver is the default. click the activate changes button on the left, above the domain structure your data source can now be managed from within weblogic. let's consider the mail session for your domain if you want weblogic to manage your mail sessions, use the following procedure. if you want to use liferay's built-in mail sessions, you can skip this section in the domain structure tree, select mail sessions. edit button again to enable modifying these settings click the new button which is now enabled on the right side of the screen give the mail session a name, such as liferaymail select your new liferaymail session from the list by clicking on it on the screen that appears, define the jndi name as mailmailsession and select the check box of the server to which you want deploy this data source to adminserver is the default click the activate changes button on the left side of the screen, above the now you have your mail session specified and ready for liferay to use in order for special characters and other languages to display correctly, you must set url under javaoptions in the setdomainenv file let's revisit domain configuration to make sure we'll be able to access your data source and mail session from liferay portal first, navigate to the liferay home folder then, if you are using weblogic to manage your data source, add the following to your url file in your liferay home to otherwise, if you are using liferay portal to manage your data source, follow the instructions in the deploy liferay section for using the setup if want to use liferay portal to manage your mail session, you can configure the mail session within liferay portal. your portal as described in the deploy liferay section, go to control panel server administration mail and enter the settings for otherwise, if you are using weblogic to manage your mail session, add the following to your url file to reference that mail liferay can now communicate with your data source and mail session. follow the instructions in this section to deploy liferay portal to your domain before you deploy liferay portal, consider whether you want to use the setup start the setup wizard along with liferay portal - do this if you want to configure your portal, set up your site's administrative account andor manage if this is your first time starting liferay portal 6.1, the setup wizard is if you want to re-run the wizard, specify url in your properties file e.g. the setup wizard is invoked during server startup start liferay portal without invoking the setup wizard - do this if want to preserve your current portal settings to start the server without triggering the setup wizard, specify the url file the setup wizard creates has url conveniently specified for you note property values in url override property now that you have enabled or disabled the setup wizard, let's move on to in the domain structure tree, select deployments. edit button above the domain structure tree click the install button on the right side of the screen click the upload your files link browse to where you have stored the liferay.war file, select it and then select the liferay.war file from the list and click next leave install this deployment as an application selected and click next give the application a name the default name is fine. defaults selected and then click finish when it finishes, a summary screen is displayed. click the activate changes link on the left above the domain structure in the deployments screen, select the liferay application and click the select servicing all requests in the pop up click yes to continue on the next screen to launch liferay portal if the setup wizard was disabled, your site's home page opens in your otherwise, the setup wizard opens in your browser for more information on how to use the setup wizard, please see the section congratulations on your deployment of liferay portal on weblogic 10!;;
"liferay home is one folder above the domain to which you will be installing for example, if your domain location is oraclemiddlewareuserprojectsdomainsbasedomain, then your liferay home for this section, we will use weblogichome to refer to your weblogic server's installation oraclemiddleware before you begin, make sure you have downloaded the latest liferay.war file and liferay portal dependencies from the liferay.war file should be called liferay-portal-6.1.x-.war and the dependencies file should be called these instructions assume you have already configured a domain and server and that you have access to the weblogic console if you still have the mainwebapp module installed, remove it first note there is a known issue with the sun and jrockit jvms bundled with to resolve this, use sun jvm 1.6.0u24 or jrockit jvm 1.6.024 let's get started by installing the jar files liferay needs liferay needs the jar files contained in the liferay dependencies archive and the driver jar file applicable for your database navigate to the folder that corresponds to the domain to which you will be inside this folder is a lib folder. dependencies archive to this folder so the dependency.jar files reside in if weblogic does not already have access to the jdbc driver for your database, copy the driver to your domain's lib folder as well your jar files are in place and ready for liferay start oracle weblogic if you want to configure your database andor mail session if you want weblogic to manage your data source, use the following procedure. you want to use liferay's built-in data source, you can skip this section select services data sources. give your data source a name, such as liferay data source. choose the type of database and click next. the database driver class is selected figure 14.45 creating a data source in weblogic 10.3 you should be on the connection properties enter the database name, the host name, the port, the database user weblogic uses this information to construct the appropriate jdbc url to connect to your database. weblogic next confirms the information you provided. additional parameters must be added to the url. provide your database name, host name, user name and click test configuration to make sure weblogic can connect to your database you will be back to the list of data sources. notice your new data source has click on your data source to edit it click the targets tab and check off the server instances to which you wish to deploy your data source. if you want weblogic to manage your mail sessions, use the following procedure. if you want to use liferay's built-in mail sessions, you can skip this section figure 14.46 weblogic mail sessions select mail sessions and create a new mail session which points to your give it the name liferay mail and give it the jndi name of mailmailsession choose your server and then click finish now let's make sure liferay can access this mail session let's revisit domain configuration to make sure we'll be able to access your data source and mail session from liferay portal create a url file in the liferay home folder, which is one folder up from your domain's home folder if you are using weblogic to manage your data source, add the following to your url file in liferay home to refer to your data if you are using liferay portal to manage your data source, follow the instructions in the deploy liferay section for using the setup wizard if want to use liferay portal to manage your mail session, you can configure the mail session in the control panel. as described in the deploy liferay section, go to control panel server administration mail and enter the settings for your mail if you are using weblogic to manage your mail session, add the following to your url file to reference that mail session in order for special characters and other languages to display correctly, you must set url under javaoptions in the setdomainenv file lastly, you must provide weblogic a reference to java server faces jsf to insert the following deployment descriptor within the element of url found in your liferay now its the moment you've been waiting for liferay deployment! this section provides instructions for deploying liferay to your application before you deploy liferay portal, consider whether you want to use the setup start the setup wizard along with liferay portal - do this if you want to configure your portal, set up your site's administrative account andor manage if this is your first time starting liferay portal 6.1, the setup wizard is if you want to re-run the wizard, specify url in your properties file e.g. the setup wizard is invoked during server startup start liferay portal without invoking the setup wizard - do this if want to preserve your current portal settings to start the server without triggering the setup wizard, specify the url file the setup wizard creates has url conveniently specified for you note property values in url override property select deployments and click the install button. from weblogic's common files directory and select install this deployment as after installing the jsf libraries, go back to deployments and select the liferay.war file from the file system or click the upload your files link to upload it and then click next select install this deployment as an application and click next if the default name is appropriate for your installation, keep it. give it a name of your choosing and click next after the deployment finishes, click save liferay launches in one of the following manners if the setup wizard was disabled, your site's home page opens in your otherwise, the setup wizard opens in your browser please see the section above for how to use the setup wizard note after liferay is installed, you may see an error initializing the web because the xsl parser configured by default within weblogic cannot compile a style sheet in this portlet, liferay disables it by default. re-enable this portlet, extract url and url from the liferay.war archive and copy them to your jdk's endorsed folder for if you are using jrockit, this folder may be weblogichomejrockit16005jrelibext; if your are using sun jdk, this folder may be weblogichomejdk16024jrelibext you are now running liferay on oracle weblogic.";;
"tip throughout this installation and configuration process, websphere prompts you to click save to apply changes to master configuration. intermittently to save your changes liferay home is in a folder called liferay in the home folder of the user when the application server binaries have been installed, start the profile management tool to create a profile appropriate for liferay click the advanced profile creation option and then click next. you can specify your own values for settings such as the location of the profile and names of the profile, node and host. you can optionally choose whether to deploy the administrative console and sample application and also add web-server definitions if you web server definitions are used with ibm http server. information about these options, please see the websphere documentation figure 14.48 choose the advanced profile option to specify your own settings check the box deploy administrative console. for working with your application server. you'd only install these on a development machine. ensure you specify a performance tuning setting other than development, since you're installing a server for figure 14.49 use a performance tuning setting other than development. please see the websphere documentation for further information about performance tuning settings choose node and host names for your server. figure 14.50 choose node and host names appropriate to your environment administrative security in websphere is a way to restrict who has access to for simplicity, we've disabled it but you may want to have it enabled in your environment. please see websphere's documentation figure 14.51 we've disabled administrative security but you may want to enable it each profile needs a security certificate, which comes next in the wizard. you don't have certificates already, choose the option to generate a personal certificate and a signing certficate and click next once the certificates are generated, set a password for your keystore. figure 14.52 set a password for your keystore next, you can customize the ports this server profile uses. ports that are open on your machine. when choosing ports, installation detects existing websphere installations and if it finds activity, it figure 14.53 websphere gives you a nice user interface for customizing the ports your server uses if you want websphere to start automatically when the machine is booted, you this differs by operating system. configuring this the way you want, click next websphere ships with ibm http server, which is a rebranded version of if you want to front your websphere server with ibm http server, please see websphere's documentation for details websphere then creates your profile and finishes with a message telling you the profile was created successfully. you're now ready to install liferay! liferay ships with dependency.jars it needs to have on the global classpath. these should be copied to websphere's global folder provided for this purpose once you've copied the.jars here, start the server profile you're planning to once it starts, you're ready to configure your database if you want websphere to manage the database connections, follow the note this is not necessary if you're planning on using liferay's standard database configuration; in that case, skip this section. you'll set your database information in liferay's setup wizard after the open the administrative console and log in for name, enter the name of jdbc provider e.g. mysql jdbc provider you already copied the necessary.jar s to a location on the server's class path click data sources under additional properties everything else should stay at the default values. when finished, go back into the data source and click custom properties and then click the show filter function button. last of the small icons under the new and delete buttons type user into the search terms and click go figure 14.55 modifying data source properties in websphere select the user property and give it the value of the user name to your click ok and save to master configuration do another filter search for the url property. for example, the mysql url would be do another filter search for the password property. the user id you added earlier as the value for this property. go back to the data source page by clicking it in the breadcrumb trail. click the test connection button. once you've set up your database, you can set up your mail session if you want websphere to manage your mail sessions, use the following procedure. if you want to use liferay's built-in mail sessions, you can skip this section click the built-in mail provider for your node and server click mail sessions and then click the new button give it a name of liferaymail and a jndi name of mailmailsession. ok and save to master configuration click security global security and deselect use java 2 security to restrict application access to local resources if it is selected. now you're ready to deploy liferay browse to the liferay.war file and click next leave fast path selected and click next, then click next again make sure your server is selected and click next keep the context root set to and click next when liferay has installed, click save to master if you plan to use liferay's setup wizard, skip to the next step. to use websphere's data source and mail session, create a file called url in your liferay home folder. select the liferay application and click start figure 14.56 starting liferay on websphere in the setup wizard, select and configure your database type. liferay then creates the tables it needs in the database you've installed liferay on websphere!";;
liferay portal by default is configured to sit at the root i.e., of your dedicating your application server to running only liferay portal is a good practice, allowing for separation between your portal environment and your web application environment. practice for portals, which by definition are application development platforms for that reason, your instance of liferay is likely to be hosting many applications and even integrating several of them together on a for this reason, you should design your system so your portal environment has all the resources it needs to do this. the sole consumer of any other.war files that get deployed to the application server helps to make sure your system performs optimally if, however, you want liferay to share space on an application server with other in this instance, you may not want to make liferay the default application in the root context of the server there are two steps to modifying this behavior deploy liferay in a context other than root for example portal modify the url file to tell liferay the context to which to change the file, open it in a text editor. property at the top of the file this default setting defines liferay portal as the application that sits at the if you change it to something else, say portal, for example, you can then deploy liferay in that context and it will live there instead of at a full discussion of the url file appears in chapter 20 note for weblogic users weblogic also requires that you modify the url file which is included with liferay. change this so it matches the path you set in your url file. you will have to modify the url file inside the liferay.war before extract the file from the.war file, modify it and then put it then deploy the modified liferay.war file to the;;
after you have created users, user groups, organizations, roles, sites and teams your portal will be ready to host content and applications. liferay's portal settings to fit your environment and your particular portal many configurations can be performed through liferay's portlet-driven this section covers how to configure portal settings such as notifications, display settings and monitoring now that you have been navigating in the control panel, you should be pretty all the options appear in the left navigation, their interfaces appear in the middle and any sub-options appear on the right. focused so far on the maintenance of users and portal security. links in the portal category focus on various portal settings which cover how the portal operates and integrates with other systems you may have. our discussion of liferay's portal settings by examining how to configure password policies can enhance the security of your portal. requirements on password strength, frequency of password expiration and more. additionally, you can apply different password policies to different sets of if you are viewing a page other than the control panel, select control panel from the go to menu of the dockbar. next, click on the password policies link on the left side of the screen under the portal heading. there is already a default password policy in the system. the same manner as you edit other resources in the portal click actions and the password policy settings form contains the following fields. specific settings via the check boxes prompts setting-specific options to name requires you to enter a name for the password policy description lets you describe the password policy so other administrators changeable determines whether or not a user can change his or her password change required determines whether or not a user must change his or her password after logging into the portal for the first time minimum age lets you choose how long a password must remain in effect reset ticket max age determines how long a password reset link remains password syntax checking allows you to set a minimum password length and to choose whether or not dictionary words can be in passwords. detailed requirements such as minimum numbers of alpha numeric characters, lower case letters, upper case letters, numbers or symbols password history lets you keep a history with a defined length of passwords and prevents users from changing their passwords to one that was password expiration lets you choose how long passwords can remain active you can select the age, the warning time and a grace limit lockout allows you to set a number of failed log-in attempts that triggers you can choose whether an administrator needs to unlock the account or if it becomes unlocked after a specific duration from the list of password policies, you can perform several other actions edit brings you to the form above and allows you to modify the password permissions allows you to define which users, user groups or roles have permission to edit the password policy assign members takes you to a screen where you can search and select users in the portal to be assigned to this password policy. be enforced for any users who are added here delete shows up for any password policies you add beyond the default you cannot delete the default policy next, let's examine liferay's portal settings most global portal settings can be configured from the portal settings section the configuration heading contains the following links general lets you configure global settings, such as the company name, domain, the virtual host, a global portal logo and more authentication allows you to configure log in ids, connection to ldap and users has three tabs, labeled fields, reserved credentials and default user the fields tab enables or disables some user fields, such as the reserved credentials tab lets you reserve screen names and email addresses so users cannot register using them. this to prevent users from registering on the portal with user names that contain profanity or that sound official, such as admin or president. default user associations tab lets you configure default membership to roles, user groups, sites for new users and provides a check box which allows you to retroactively apply these to existing users mail host names lets you add a list of other mail host names to be associated with your organization. for example, your main domain might be url but you might use url for your email any domain names associated with your organization can go here email notifications allows you to configure liferay to send email notifications for certain events, such as user registrations, password changes, etc. you can customize those messages here let's discuss these settings next the general link takes you to a page with three headings main configuration, navigation and additional information. under the main configuration heading, you can set the name of the company, organization or site which is running the this name also defines the name of your portal's default site. default name is url so you will definitely want to set this to reflect you can also set the mail domain, virtual host and content under the navigation heading, you can set a home page for your portal here as well as default landing and logout pages. additional information heading, you can specify a legal name, id, company type, sic code, ticker symbol, industry and industry type the authentication page has several tabs general, ldap, cas, facebook, ntlm, openid, open sso and siteminder. you can use any of these authentication methods to configure how users will authenticate to liferay. quite a few authentication methods, there are different settings for each the settings on the general tab of the authentication page affect only liferay functionality and don't have anything to do with the integration options on the the general tab allows you to customize liferay's standard specifically, the general tab allows you to select from several global authentication settings authenticate via email address default, screen name or user id a numerical id auto-generated in the database not recommended if enabled, liferay allows a user to check a box which will cause the site to remember the user's log in by placing a if disabled, users will always have to log in enabledisable account creation by strangers. site, you will probably want to leave this on so visitors can create enabledisable account creation by those using an email address in the domain of the company running the site which you just set on the general this is handy if you are using liferay to host both internal and external web sites. you can make sure all internal ids have to be created by administrators but external users can register for ids themselves will send users a verification email with a link back to the portal to verify the email address they entered is a valid one they can access by default, all settings except for the last are enabled. email address is an important default for the following reasons an email address is, by definition, unique to the user who owns it people can generally remember their email addresses. haven't logged into the portal for a while, it is possible they will forget their screen names, especially if they weren't allowed to use their screen names of choice because they were already taken if a user changes his or her email address, it is more likely the user will forget to update his or her email address in his or her profile, if the email address is not used to authenticate. not updated, all notifications sent by the portal will fail to reach the so it is important to keep the email address at the forefront of a user's mind when he or she logs in to help the user keep it up to date we'll examine how to set up ldap authentication next.;;
in this chapter, we examined two liferay utility applications the software catalog and the knowledge base. the software catalog allows you to define a set of software items to make available to visitors to your portal. the software catalog will be replaced by liferay marketplace and will soon be the knowledge base application is an ee-only application that allows you to create articles and organize them into full books or guides that liferay's weather portlet displays basic weather-related information for multiple configurable locations. take a tour of the liferay marketplace and learn how to manage liferay plugins.;;
"how well do you know your users? do you ever wonder what they're thinking? how do they feel about the hot-button issues of what's their favorite ice cream flavor? use liferay's polls feature you can find out the answer to these and other questions that should help you better understand your users there are two portlets involved in making and displaying a poll the polls portlet, which is accessed through the control panel, and the polls display portlet, which can be added to any page in the portal the polls portlet helps you set up the poll question and the possible answers the polls display portlet is an instanceable portlet that lets you select which poll to display, and is the portlet you put on the page the polls portlet allows users and administrators to create multiple choice polls that keep track of the votes and display results on the page. separate polls can be managed; a separate portlet called polls display can be configured to display a specific poll's questions and results the polls display portlet allows users to vote for a specific poll's questions questions must be created from the polls portlet in the you can display one question at a time or you can combine several questions inside a nested portlet to create a survey we'll begin by creating a poll in the control panel in the control panel, navigate to the polls link under content. a form appears that allows you to fill out all the figure 7.30 besides the title and the polls question, you must enter data for each of the choices fields when creating a new title enter the name of the poll question polls question enter the text of the poll question expiration date enter the date and time you want the poll to expire choices enter at least two answer options for the poll question add choice enter additional answer options for the poll question permissions manage who can view and edit the poll when you have finished creating your poll, click save, and it is added to the as more polls are created in the control panel, they become accessible through the polls display portlet until they are either deleted or they expire. set an expiration date for a poll by selecting the day and time in the add poll form or in the new question form. the default is set to never expire when a poll expires, users can't enter votes any more, but if a polls display portlet is still publishing it, the poll results are displayed on the page. remove an expired poll from a page, remove the poll display portlet or configure it to show another poll question. details about the polls display portlet permissions can be set on individual polls as they are set elsewhere in permissions can be used, for example, to allow some privileged users to vote on a certain poll question, while others can only view it. further information about permissions, please see chapters 15 and 16 as you can see, creating a poll is fairly straightforward. the two-step process and put your poll on a page now that you have created your poll question, it's time to present it to your navigate to your portal and add the polls display portlet to a page. is available from the content management section of the add more the polls display portlet may look strange when it first appears on your page. that's because it's not configured. before visitors to your site can use the poll, they must be able to access it. click on the link labelled please configure this portlet to make it visible to all users, and a dialog box like figure 7.31 in the initial configuration of the polls display portlet, the question field will remain blank until you select the appropriate poll under the setup tab is a menu option labeled question. displays the name of the poll you created. choose it, click save, and it is that, in a nutshell, is how you create a poll, but there is another way to add a question to the polls display portlet start by navigating to your portal and placing the polls display portlet on a using the icons in the lower left of the portlet, choose the add a new form appears that lets you create another question. when you are done filling out the form, click save and you new poll appears once the poll question has been successfully placed on the page, you can perform other tasks by using the icons in the lower left corner of the portlet. besides adding questions, you can also edit the currently selected question or figure 7.32 these three buttons, highlighted in red, allow you to manage the edit question displays a similar dialog box to the one used to create the select question displays the same dialog box as configuration, allowing you to choose different questions from the dropdown menu you can also manage the polls display portlet by clicking the wrench symbol in the upper right corner of the portlet's title bar. when you create a poll question, it appears in a list in the control panel. after users vote in the poll, the data is collected here. name and the question, as well as a breakdown of the poll results appears, including percentages and total number of votes per answer and the total number figure 7.33 selecting a poll in the polls portlet allows you to see all the information related to the poll results below this is an item called charts. this option shows the poll results the graphs are area, horizontal bar, line, figure 7.34 this is what the pie chart for the ice cream poll results looks there is also a listing of the users who voted in your poll, how they voted, and a timedate stamp of when their votes were cast. represented by their screen name while guest users are represented by a number with liferay polls you can do many things. you can ask users very specific questions or you can use polls to create a little fun for your community. with most things in liferay, you are only limited by your imagination. let's see what you can do with liferay's chat feature.";;
"we have explored many of the portlets in liferay's collaboration suite. have seen how you can configure all of the portlets in a similar fashion using after this, we went over all of the portlets in the blogs and blogs aggregation portlets can be used to manage shared blogs or blogs belonging to a group of people at once. features you would want in a blog, including rich text editing, links to news aggregators, tags, rss feeds, and more the calendar portlet likewise can be used to manage a shared calendar or a it includes features for events, event notification, repeatable events, and import and export to and from the standard icalendar format discussion becomes easy with liferay's message boards portlet. be used to manage heavily trafficked discussion forums with ease. all of the security features of the liferay platform and includes administrative functions for thread priorities, moving threads, nested discussion categories, banning users, and more liferay's wiki portlet is a state of the art wiki application that users can make use of to collaborate on web pages. again, it inherits the strengths of the liferay platform in the form of security, interface, and search. use the wiki portlet to manage several wiki nodes or use many wiki portlets to the polls portlet is a fun way to interact with users of your site to get an understanding of what they're thinking at any given time. create multiple choice polls that keep track of the votes and display results you can view these results in a number of ways, including charts liferay provides a chat solution for your portal that's very easy to use. allows logged-in users to see who else is logged in to the portal and view users can go invisible if they don't want others to know that users can chat with each other via instant messages. also set up a jabber chat server and configure liferay to use it; this allows users who have logged in to your portal via their browsers to chat with users using traditional desktop clients integrating mail with your portal is easy with the mail portlet. many custom or gmail mail accounts as you wish, and this portlet can keep them all organized in one place, together with the rest of the things liferay is liferay's collaboration platform is a full suite of integrated applications that empower users to work together. you can use them to great effect to enhance your portal and to build a vibrant, active community.";;
liferay's chat portlet provides a convenient way of allowing users to send each other instant messages when they are logged into your web site. bar at the bottom of every page, showing who is logged on, their statuses, and any chats the logged-in user has open the chat portlet is distributed with the liferay bundles, but is not included as part of the.war distribution, as it is a separate plugin. installed the liferay.war manually on your application server, you can install the chat portlet by going to the control panel, clicking plugins installation, and then clicking the install more portlets button. chat portlet in the list, click on it, and then click install the chat portlet is very simple to use. settings found near the lower right corner next to online friends . you can set your status, choose whether or not to show that you are online, and whether or not to play a sound if someone sends you a message while you have the window or tab in the background. the chat portlet displays the number of click the online friends link and then click on a friend's name to open a chat window. you can have multiple chats open at a time, and can have one or more of them minimized liferay 6.1 introduced jabber server integration to liferay's chat portlet. jabber is the original name of the xmpp extensible messaging and presence protocol protocol, an open-standard communications protocol based on xml. using a chat server helps liferay's chat scale to very large installations and allows for communication between different chat clients. server integration allows users using the chat portlet in their browser windows to chat with other users using desktop clients like empathy, pidgin, or kopete jabber server integration is not enabled by default since it requires a running once you have installed and started a jabber server, you can enable jabber server integration by creating a url file to override some properties of your chat portlet's url file. could modify your chat portlet's url file directly, but it's a best practice to override it instead you can use any chat server that supports jabber. server integration feature was tested with versions 3.7.0 and 3.7.1 of openfire, a real time collaboration server distributed under the open source to enable jabber chat integration, follow these steps if you are using openfire on a linuxmac system, you can startstop the chat server by executing the openfire shell script in the override the url file in your chat-portletweb-infsrc directory with a url file in the same directory. deploy the portlet, the properties files should be copied to your if you have already deployed the chat portlet, create the url file in your note that you must change url to the host name. using openfire, you can find the host name by using the openfire administration if you did not set up administrative credentials when you started openfire, the default credentials are username admin, password admin figure 7.36 openfire administration web additionally, make sure that you set url to true and have added the correct values to url and url. chat server on a remote machine or chose to not use the default port, change if the property url is set to true, the chat portlet will import the user automatically to jabber after he logs in to the portal. once the user is imported, he can use any jabber client using the same screen name and password he uses to log in to the portal. imported as they become online in the chat portlet note that it's a lazy import. users are imported only after they log in to the portal and their buddies will be added to his list only if they see each they won't be able to use other jabber chat clients until they log in to the portal if url is set to false, users need to create their jabber account and add buddies manually. they have to create their accounts using the same screen name and password they use in the portal. the chat portlet won't be able to connect to their jabber account alternatively, since openfire integrates with ldap, if you are using openfire and your portal is also using ldap for authentication, you can disable the next, let's look at how you can integrate your email addresses with liferay's;;
liferay's mail portlet enables your users to interact with their email using an easy to use, ubiquitous web interface. if your mail system supports the imap protocol, you can use the mail portlet to integrate your users' mail with the you can also connect the mail portlet to a mail account the mail portlet is distributed with the liferay bundles, but is not included as part of the.war distribution, as it is a separate plugin. installed the liferay.war manually on your application server, you can install the mail portlet by going to the control panel, clicking plugins installation, and then clicking the install more portlets button. mail portlet in the list, click on it, and then click install figure 7.37 liferay's mail portlet to connect the mail portlet with an email account, click the add a new email from there, you are given a choice between a custom email choose the option that you wish, and fill out the for a gmail account, all you need to do is provide your email address and your password, and the portlet will take care of the rest for a custom mail account, the following fields are necessary address lets you enter the email address which receives mail for this login lets you choose a user name for logging into the account password lets you choose a password for logging into the account incoming settings allows you to specify the host name for your imap internet mail access protocol or pop server incoming port allows you to specify the port upon which the imap or pop use secure incoming connection allows you to use an encrypted connection to the server provided that your server supports it outgoing smtp server lets you enter the host name of your smtp simple outgoing port allows you to specify the port upon which the smtp service use secure outgoing connection allows you to use an encrypted connection your new email account now appears as a tab at the top of the page along with the button for adding a mail account. you can add as many mail accounts as you want in order to view them in the click the tab for the mail account you just configured to be brought to an interface which allows you to read your mail and compose new messages. to compose a new message, click the compose email link on the left side of the portlet. a form appears which allows you to compose an email message using the same rich text editor that appears you can read, reply, and create messages, as well as manage all of your folders in liferay's mail portlet the mail portlet is a great way to integrate a familiar service with other the collaboration features that liferay provides.;;
in this chapter, we explored liferay's asset framework. liferay is considered an asset and can utilize the features provided by the asset framework tags, categories, comments, ratings, and relationships. examined the asset publisher portlet and looked at the many configuration options for choosing what kinds of assets to display and how to display them. saw that the asset publisher portlet is designed to integrate with the tags navigation and categories navigation portlets to allow users to browse content we also learned about the display page attribute of web content, the content display page page template, and canonical urls for assets. can have display page associated with them so that the full view of the asset is the display page of an asset is used in the;;
to configure the documents and media portlet, click on the wrench icon at the top of the portlet window and select configuration. customizations appear on the setup tab. to change your documents and media portlet's top-level folder, click select next to root folder, browse to the folder you'd like to be your new top-level folder, and click save. folder is the highest-level folder that's accessible from the documents and for example, suppose you created a folder called my documents in the documents and media portlet's default home folder. documents folder to be your portlet's new root folder, the original home folder figure 4.12 to make portlet-specific configurations for documents and media, click on the wrench icon at the top of the portlet window and select configuration by default, the documents and media portlet contains a search bar to help users if you'd like the search bar not to appear, uncheck the maximum entries to display dropdown menu lets you set a limit on how many folders and files can be displayed in the portlet window by default, the documents and media portlet contains three display style views icon, list, and descriptive. icons for each appear in the portlet window, allowing users to select the display style with which they're most under the display style views heading, you can select which display styles users are able to choose and you can arrange the order of the selected the topmost display style in the list becomes the portlet's related assets are enabled by default for documents and media files. assets allow users to link assets together even if the assets don't share any to disable related assets for files in your documents and media portlet, uncheck the related assets box. for more information on related assets, see the section on defining content relationships in chapter 6 under the show columns heading, you can customize which columns appear when your documents and media portlet uses the list display style. sizes, downloads, and actions are displayed. you can also configure the portlet to display files' create dates and modified dates. being displayed, move them to the current box or to the available box. arrange the columns in the current box to control the order in which the columns appear in the portlet the topmost column in the box appears as the leftmost comment ratings are also enabled by default for documents and media files. users decide that a certain comment about a file is useful or informative, they can rate it as good by clicking on the thumbs up icon next to the rating. they think the comment is unhelpful or misleading, they can click on the thumbs if you'd like to disable comment ratings for files within your portlet, uncheck the enable comment ratings box.;;
this chapter has been your guide to liferay site management and advanced web we've seen how you can use liferay to manage both simple content and advanced content with structures and templates. you can use liferay to create multiple sites with different membership types. we've also learned how to use page and site templates to simplify the site liferay wcm also includes a powerful staging environment, allowing you to stage content locally on the same server or remotely to another server. publish your site when you want it, on the schedule you choose. create different variations of your site that can be worked on simultaneously you saw how to allow users to create personal customizations of site pages. discussed how site administrators can create teams as a flexible means of we also saw how to configure mobile device rules so that site pages are presented differently depending on the device making a page whether your site is small and static or large and dynamic, liferay's wcm enables you to plan and manage it. with tools such as the wysiwyg editor, structures and templates, you can quickly add and edit content. content display and asset publisher, you can rapidly select and configure what content to display and how to display it. workflow, you can set up custom publishing rules to fit your organization. by using liferay's staging and scheduling mechanisms, you can manage various branches of pages and content and control when they are published to your live you will find that managing your site becomes far easier when using liferay's web content management system.;;
in this chapter, we examined liferay's documents and media library, a powerful and customizable virtual shared drive. liferay 6.1 introduced the ability to mount multiple external repositories to the documents and media library. documents and media library can be used to store files of any kind. documents and media display portlet is meant to be configured to show chosen hierarchies of folders and files from the documents and media library. gallery is meant for presenting media files such as images or videos document types and metadata sets provide a flexible way to distinguish between different types of files and to define custom metadata fields for them. previews are automatically generated by default, but liferay supports integration with external tools that offer greater speed, higher quality, and finally, we discussed liferay sync, an add-on product for liferay 6.1 that allows your liferay server to directly synchronize files on users' desktop and mobile environments.;;
whenever possible, liferay 6.1 generates previews of documents added to the out of the box, liferay only ships with java-based apis to generate previews for documents. the only tool available that is 100 java and has a compatible license to be distributed with liferay is pdfbox. a vanilla installation of liferay 6.1, if you upload a pdf file to the documents and media portlet, liferay will process the pdf in a separate thread to generate this process may last only a few seconds for a small file. the file is, the longer it takes the first time you run a conversion like this, look for a console message that indicates something like the following while a default implementation of image generation for document previews and thumbnails is provided via pdfbox, you'll need to install and configure some additional tools to harness the full power of liferay's documents and media these tools include openoffice or configured, documents and media content is displayed using a customized viewer depending on the type of content. configuring liferay to use openoffice or libreoffice in server mode allows you to generate thumbnails and previews for supported file types .pdf,.docx,.odt,.ppt,.odp, etc., lets you view documents in your browser and lets you convert documents. faster and higher-quality previews and conversions. video previews, lets you play audio and video files in your browser and extracts please see the external services section of chapter 16 for instructions on how to configure liferay to use these tools with the above tools installed and enabled, the documents and media library figure 4.13 previews in documents and media you can view a document with a customized viewer that allows you to navigate through the different pages of the document and read its content figure 4.14 viewing an office document you can view a multimedia document audio or video and play it online. browser supports html5, it uses the native player of the browser. document previews are powerful and help users browse media more successfully to when adding new documents or viewing existing documents, a process is triggered automatically that extracts the file's metadata. process is tika and it's already included in liferay out of the box you can see the metadata when viewing the document, in the right side of the you can force users to add only certain document types to a folder. child folders inherit the restrictions of their parent folder. this behavior by editing the folder and selecting the allowed document types figure 4.16 restrict marketing folder to use specific document types if workflow is enabled, you can specify different workflow definitions per furthermore, you can specify different workflow definitions per document you can set this by editing the folder. figure 4.17 restrict marketing folder to use specific document types and workflow document types are a powerful way to enforce rules for documents uploaded by next, we'll see a way to make it incredibly easy for users to access documents stored in liferay's documents and media repositories wouldn't it be great if you could access documents and folders belonging to liferay's documents and media library from your own machine's file manager? can, thanks to the documents and media library's webdav integration. stands for web-based distributed authoring and versioning. based on http that allows users to create, edit, move or delete files stored on webdav is supported by most major operating systems and desktop environments, including linux both kde and gnome, mac os and windows suppose you've created an image gallery folder using a documents and media portlet and uploaded some images to it. portal users with the appropriate permissions can access this folder, and the image files it contains, using a browser and liferay's web interface. webdav provides an alternative way to do this using a file manager instead of a web browser. a documents and media portlet on a remote server, you'll need log in credentials for the portal and the webdav url of the folder you'd like to access next, navigate to the documents and media portlet hosting the folder you'd like mouse over the folder image gallery for our example and select figure 4.18 select access from desktop to get the webdav url of a folder on windows, right-click on my computer and select map select an unused drive, paste the webdav url, and click you're prompted to enter your liferay credentials and then, provided you have the required permissions, the image gallery folder appears. now add, edit, move or delete files in this directory on mac os x, select go connect to server in finder. webdav url of the folder you'd like to access in the server address field, click connect and you should be prompted for your liferay credentials on linux, you must slightly modify the webdav url of your folder in your file for kde's dolphin, change the url's protocol so that it says for gnome's nautilus, change the url's protocol so that it says dav instead of you're prompted for your liferay credentials note that liferay increments the version numbers of files edited and uploaded via webdav so you don't have to worry that using your file manager will bypass the functionality of liferay's web interface. application is a powerful way to manage any types of files your users need to next, let's look at how you can leverage liferay portal's asset framework now you know just how easy it is to store your files using liferay's documents in the next section we'll review some ways to organize and manage your assets so you're getting the most out of your content.;;
"liferay sync, released in september 2012, is an add-on product for liferay 6.1 ga2 ce and ee that synchronizes files between your liferay server and users' desktop and mobile environments. with liferay sync, your users can publish and access shared documents and files from their native environments without using a windows and mac os desktops and android and ios-based mobile platforms as users add and collaborate on documents and files, liferay sync automatically synchronizes them across all configured sync clients. liferay sync is fully integrated into the liferay platform so that features such as authentication, versioning, and social collaboration function in the liferay sync stores files locally so that they're always available, even when you're offline. it automatically synchronizes your files liferay sync manages documents and site information through liferay 6.1's clients securely communicate to liferay using user-supplied credentials such that each user can only access those documents and sites for which they have permission. changes made through liferay sync are immediately available to the rest of the liferay platform, including users accessing liferay through traditional web-based interfaces for desktop environments, a new folder structure is created and used for files found therein can be treated as any ordinary file. credentials, sync frequency, and other options can be configured in-client. native desktop notification events keep you abreast of what sync is doing, and native menu and taskbar integration keep sync controls within easy reach mobile environments are naturally dependent on the way in which documents are for android and ios, documents are maintained in a file list, and can be viewed by clicking on the files themselves. other apps can be opened using liferay sync, thereby dropping them into your sync folder and synchronizing them across other sync clients. pulling down on the sync file list forces a refresh. liferay sync is designed to work with both liferay 6.1 ga2 ce and ee. with liferay ce limits users to syncing one site. enables users to synchronize documents and files across all the sites which they liferay sync is also designed to work with liferay social office. one site from social office ce as well as one site from liferay portal ce. you've installed social office ce on liferay portal ee, then you can sync any site from portal, but only one from social office. office ee on liferay portal ee, then you can sync any and all sites for windows or mac os, visit the liferay sync product page liferay sync product now on the right-side navigation menu to download the client application for for windows, the client application installer should there's also a linux beta version follow the on-screen instructions of the installer wizard to configure your client to connect to an existing liferay 6.1 deployment using upon launching the windows application installer, you'll be prompted to choose browse to an appropriate location on figure 4.19 use the liferay sync installation wizard to choose an installation location leave the run liferay sync button checked to automatically start liferay sync figure 4.20 you'll see the following screen once liferay sync has been installed. click finish to exit the installation wizard the first time you run liferay sync, you'll have to enter some account sync needs to know where you'd like to locally store the files it's supposed to sync with your liferay server. and, of course, it needs to know your server's url and the account credentials with which it should authenticate figure 4.21 the first time you run liferay sync, you'll have to tell it how to communicate with your liferay server the options for the mac os application installer are similar liferay sync for mac is packaged in a dmg file. double-clicking on a dmg mounts it as a disk image, and opens a window showing the contents of the image. install sync, drag the liferay sync icon to the applications folder. installed, go to your applications folder to run it figure 4.22 drag the liferay sync icon to the applications folder when you launch liferay sync, the first thing you need to do is provide it with the url for the liferay server that you'll be using sync with, along with your after that, you'll need to run through the brief setup process that was described above for windows figure 4.23 you can provide the same information requested by the windows application installer once you've finished your configuration and have clicked ok, liferay sync starts running in the background, and an icon appears in your top menu bar. you wish to change any of your settings, click the icon to open the liferay sync note that on windows, the sync menu says for ios, visit the app store, search for liferay, and install the liferay sync for android, go to google play, search for liferay, and install the liferay sync once the mobile apps are installed, follow the on-screen instructions as below once installed, you'll see a liferay sync icon in your taskbar whenever it's a green checkmark means liferay sync has a working connection to your liferay server and is updating the files in your sync folder according to the interval you specified in the wizard. click the liferay sync icon in your figure 4.24 open the liferay sync taskbar menu to access the following options open sync folder opens your liferay sync folder in your native file manager open website provides links to the pages containing the documents and media portlets which you have permission to access. by default, you can find links to your personal documents and media repository as well as links to the documents and media repositories of all the other sites you belong to tip note for administrators if you don't have a documents and media portlet anywhere on a site that's been selected for syncing, you'll have to add otherwise, users will get a the requested resource was not found error when they try to use the open website link from their sync menus recent files shows a list of recently created or modified files from all the properties preferences, on mac os lets you change properties like starting on login, desktop notifications, and sync frequency. the account information you provided when you started sync for the first time. for example, you can enter a new url for your liferay server and enter a different set of liferay credentials figure 4.25 open the liferay sync menu and select properties preferences, on mac os to edit the settings you configured during setup there are three items listed in the general settings section. sync on login is checked by default. if you don't want sync to start show desktop notifications is also checked by unless you uncheck this, when a file that you have synced is changed, a small notification will appear in the corner of your screen. for updates every field enables you to set how frequently it will check to see this can be set anywhere between 5 seconds and 30 click the edit settings button in the account settings section to specify your server's url and enter your liferay credentials. button to make sure liferay sync can communicate with the server. settings also allows you to specify your sync folder, the folder where sync will by default, files are stored in the liferay-sync subfolder of your personal documents folder finally, the site settings section allows you to choose which sites you wish by default, it will list all of the sites that you are a member of, but you can uncheck any of those sites if you don't want to sync sync now instructs liferay sync to check the liferay server for updates pause syncing instructs liferay sync to suspend syncing until further notice. if someone added a very large file to one of your shared folders that's taking a very long time to sync, you might want to use this option and resume syncing at about displays liferay sync version information, copyright information, and a check for updates checks to see if a new version of liferay sync is available from url and allows you to set whether or not liferay sync should automatically check for updates once liferay sync has been configured and is running, any files you add to or modify in your sync folder are automatically detected and uploaded to your also, changes from other users are downloaded to your sync if you delete a file your sync folder, it will only be deleted locally. this mechanism prevents users from accidentally when you delete a file from you sync folder, sync will no longer download changes to this file the next time it syncs. back to syncing a file, simply restore it from you recycle bin or trash can. once the file is restored back to the sync folder, sync keeps that file in sync by uploading any of your changes and downloading any changes from the server you can run through the following exercise to familiarize yourself with how to create, edit, download, and upload files with liferay sync. liferay sync folder in your file manager use the open sync folder option of the liferay sync menu from the taskbar, and create a new file called edit this file and enter the word test. access this file from your liferay site. open your browser, navigate to your liferay site, and sign in with your liferay account credentials. sure that that you're on the site you want to sync with. administration documents and media. figure 4.26 you can access the same files from liferay sync that you can from liferay's web interface download the file click the small triangle icon at the top right corner of the url icon and select download to a convenient location on your machine and check that it still says test. your sync folder and edit it so that it says second test. and then go back to your browser and refresh your documents and media page. click on the url icon, look at the information displayed to the right, and you'll see that its version number has incremented figure 4.27 updating a file through liferay sync increments the file's version number. you can view a file's version number through the web interface click sync now from the menu to force sync to download any remote changes. you'll see that it now says second test your edit was uploaded to the server. you can be confident that this edit was also downloaded by all other liferay sync clients connected to your site liferay sync uses the default liferay permissions to determine which files and folders are synced to the user's machine. this means that whatever files a user can access from a certain site are the ones that will be pulled down by liferay sync if that site is selected in the sync client. of liferay sync permissions by performing the following steps. new file on your desktop called url. then use your browser to log into liferay and create a new user called secretagent with the email address then assign the secretagent user to the secret site and grant the site administrator role to this user. other members of this site unless they are assigned by an administrator. as the secretagent and use go to control panel, select secret site in the context menu selector, and click on documents and media. next, we'll configure our liferay sync client to log in with the secretagent user's credentials and access the secret site. open the liferay sync menu from the taskbar and select properties. click on the edit settings button, choose a new sync folder, enter your server's url, and enter the secret agent's sites except the secret site, and click ok. file that you uploaded to the secret site, is downloaded to your new sync open it and check that it says classified information. reconfigure your sync client connect to your liferay instance using the credentials of another user who doesn't belong to the secret site, the a liferay sync folder that can only be accessed by the secretagent user and once you've installed liferay sync on your android or ios mobile environment, you'll be able to access the same functionality that's available when using sync however, the interface differs from that of the sync after installing liferay sync for android, an empty screen appears asking you this screen appears whenever preferences are missing touch the screen and it displays the settings view. to settings by clicking on the wrench icon at the top right corner of the enter your liferay server credentials by filling in your login, password, your login is either your user account's email use the same credentials you use to log in to the portal in the server field, enter your portal's url. click the key icon on the top right to test your connection and check if everything is correct note for gingerbread users if you can't see some of the features described here, click on the menu button to view a list of all possible actions. includes options to refresh, open the settings menu, upload files, take photos, after you have successfully tested your connection, hit the back button and you'll see a list of liferay sites you have access to you can browse the files of a site by tapping on any of them. of the folders and files belonging to the site that you have permission to view from here, you can click on a folder and browse deeper into the folder hierarchy or click the back button to navigate back to parent folders up to the initial single-tap on a file to open it. if the file has never been downloaded before, sync will download it and open after it has finished downloading. view the file's contents if your device has an app installed that can open the for example, in order to open a pdf, you must have at least one pdf otherwise, you will see a message informing you that no viewer is available and you need to install an app that can open the file long-press on any folder or file to find a list of actions you can take on it add to favorites, view details, download, rename or delete. actions menu varies depending on which entry type is selected file or folder on gingerbread, the actions menu looks like this on ice cream sandwich and above, you can find the action icons and menu at the clicking on add to favorites gingerbread or the gray star ice cream sandwich adds the selected file to the favorites list. special files that can be accessed and viewed even when you are offline more if a file is already marked as a favorite, you'll see a remove from favorites or blue star instead. selected file from the favorites list clicking on view details gingerbread or the round icon with the letter i ice cream sandwich opens the details view, which displays the entry's metadata such as creation date, author, version, description, etc. if you click on download floppy disk icon on ice cream sandwich, it downloads and overwrites the local file copy you can rename a folder or file by clicking on the rename option. clicking on delete deletes the filefolder from the remote portal, and other users won't be able to view or download it. above, you can select multiple entries for deletion some actions are not related to a specific folder or file. actions in the menu on the top action bar when no entry is selected gingerbread users need to click on the device menu button. width, some icons may overflow to the three dots button on the right. this button to see all of the available actions the refresh button fetches and updates the list of folders and files that have the camera button allows you to quickly take a picture and upload the image to the image file name is automatically generated with a time the new folder button asks you for the name of the folder you want to create the upload button displays the types of local files you can upload to the choosing image, for example, shows all images that are stored locally once you choose the files and confirm, these files are uploaded to the portal and are placed in the current folder. images, videos, and audio files. if you have installed an app on your device that can open and browse any type of file, you will also see an option called the favorites menu option opens the favorites list. marked as favorites show up in this list. you should mark your most important files as favorites because, as mentioned earlier, the favorites feature gives you quick offline access to them. you can view the contents of items in the favorites list, view their metadata and, of course, remove them from the list next, let's look at the ios sync app after installing liferay sync for ios, an empty screen appears asking you click on settings in the toolbar and enter your liferay server credentials by filling in your login, password, and server information. is either your user account's email address or screen name, whichever you use to log in to the portal in a browser. in the server field, enter your in this example, the server url is url. on test connection to check if your configuration is correct after you have successfully tested your connection, tap on the documents toolbar section and you'll see a list of liferay sites you have access to you can browse the files of a site by tapping on its name or icon. list of the folders and files belonging to the site that you have permission to from here, you can click on a folder to browse deeper into the folder hierarchy. you can also click on the back button to navigate back to parent folders up to you can refresh the list by pushing it down. folders that have been changed in the portal when you click on a file, this file is downloaded from the remote portal and, if a previewer for this file type is available, you can view the contents the next time you open a file, it won't download it again; instead, there are 3 icons at the bottom of the screen when you open a file clicking on the leftmost round icon with the letter i opens the details view, which displays the entry's metadata such as creation date, author, version, clicking on the star icon at the center adds the selected file to the favorites are special files that can be accessed and viewed even when you are offline more details below. marked as a favorite, clicking on the star icon removes the file from the clicking on the rightmost icon displays sharing options. send the file as an email attachment, print the file, or copy it to your some external apps may also appear in this list. share your file with social apps and messengers if they are available in the file list, there's an edit button. clicking on it switches the app to selecting one or more files or folders and clicking on the delete button deletes the selected files or folders from the remote portal. files or folders from the remote portal, other users won't be able to view or selecting only one file or folder enables the rename button. change the entry's name locally and remotely to quickly delete a file or folder from the portal, you can also swipe right and click on the delete button in the file list view if you want to upload an image or video to the portal, click the plus button take a photo or video opens your camera app and lets you take a photo or choose existing allows you to upload multiple photos or videos stored on your create new folder lets you type the name of the folder and creates it in the figure 4.50 upload photos and videos the favorites toolbar section opens the favorites list. been marked as favorites show up in this list. important files as favorites because, as mentioned earlier, the favorites feature gives you quick offline access to them. items in the favorites list, view their metadata and, of course, remove them all downloaded files are stored on your device indefinitely if you want to delete downloaded files locally but don't want to remove them from the portal, go to settings and click on the clear cache button.";;
"mobile device rules allow you to configure sets of rules to alter the behavior of the portal based on the device being used to access liferay. of mobile device users browsing the web has been steadily increasing, so it's important to be able to handle different kinds of devices appropriately. instance, you can configure the look and feel of liferay pages accessed by smartphone or tablet users differently from those accessed by pc users both sites and individual pages can be configured with any number of rule a rule group is designed to describe a group of devices; think of a rule group as a mobile device family. it can contain one or more rules that describe a category of devices, such as all android devices or all ios tablets. define as many rules in a rule group as you need to classify all the devices for which you'd like to define actions. rule groups can be prioritized to determine which one applies to a given page request in order to configure mobile device rules, you need a way to find out the while some of the characteristics are provided by for this reason, there are databases that contain information about thousands of devices. these databases make it possible to learn every detail about a device from the device type, which is included in each request sent to the portal. liferay's mobile device rules can connect to device databases so that you can use their device characteristics in your rules liferay provides such a database in the liferay mobile device detection lmdd app from the liferay marketplace. for instructions on using liferay marketplace to find and install apps note the liferay mobile device detection lmdd app is ee-only for liferay although you can use other device detection databases, doing so requires you to manually integrate the database with liferay apis it's possible to develop plugins that integrate with other device databases. even if you don't have a device database, you can still set up mobile device they won't, however, be effective until a database is deployed, because the portal won't have enough information about the devices being used to make to learn how to tap into liferay's device api, see the you can access the mobile device rules administrative page from the content select the appropriate scope using the context menu selector so your rule groups are available where you expect them to be. mobile device rules administrative page displays a list of defined rule groups to add rules to a rule group, select actions manage rules, or click on a rule group to edit it, and then click figure 3.28 you can manage device rules from the mobile device rules the rules defined for a rule group, along with the priorities of the rule groups selected for a particular site or page, determine which rule group's actions are from the manage rules page for a specific rule set, you can add a rule by specifying a rule type. remember that you can add as many rules to a rule group as you need in order to classify the devices on which note that, by default, only the simple rule type is the rules are designed, however, to be extensible, and additional rule types can be added by your developers. once added, you can edit the rule to specify a device type and operating system figure 3.29 you need to install a device recognition plugin to populate the once you've created some mobile device rule groups and added some rules to them, you'll be ready to set up some actions. the actions defined for a rule group determine what happens to a particular request when the device is detected and the rule group has been found to apply you can add actions to a rule group from the site pages page of the control select either the public or private pages and then look for the mobile rule groups link in the right-hand menu. use the select rule group button to select rule groups to be applied either to a site or to a single page. select the page group itself from the left-hand menu, the selected rule group applies to all the pages of the site by default. individual page and then click the select rule group button, the rule groups you can select multiple rule groups for a particular site or page and order them by priority. decreasing order of priority the actions defined by the first rule group that figure 3.30 you can select a mobile device rule group to apply for a site or page from the site pages section of the control to add actions to a selected rule group, use the actions manage actions button and then click add action. by default, there are four kinds of actions that can be configured for mobile rule groups layout template modifications, theme modifications, simple redirects, and site redirects. template modifications let you change the way portlets are arranged on pages delivered to mobile devices, and themes modifications let you select a specific if it makes more sense for you to create separate mobile versions of certain sites or pages, you can use a redirect to make sure mobile device to define a simple redirect, you need to specify a to define a site redirect, you need only specify the site name and page name of the page to which you're redirecting. like mobile device rules, mobile device actions are designed to be extensible. actions in addition to the four actions provided by default to review, if you'd like to configure an action or actions that take place when mobile device requests are received, take the following steps create a mobile device rule group to represent the family of devices for which to define an action or actions define one or more rules for your rule group that describe the family of devices represented by your rule group apply your rule group to an entire page set of a site all the public pages of a site or all the private pages or to a single page define one or more actions for your rule group that describe how requests to see how this might work in practice, let's discuss a few examples of how you first, suppose you have a separate version of a site on your portal that's specifically designed for mobile phones running for our example, we'll make a site called androidbada liferay and we'll configure the default liferay site to redirect incoming requests from android or bada mobile phones to the androidbada liferay site. is to create the androidbada liferay site go to the sites page of the control panel and click add blank site. enter the name androidbada liferay then, with androidbada selected in the context menu selector, by default, the newly created site doesn't have any pages, so click on add page, enter the name welcome, and click the add now our androidbada liferay site has a public welcome page just next, select liferay in the context menu selector and go to the mobile device rules page of the control panel. click on add rule group, enter the name android and bada mobile phones, and click save. rules are configured for this rule group figure 3.31 after adding a new rule, you'll see a message indicating that no rules have been configured for the rule click the manage rules link and we'll configure our rule group to apply only to mobile phones running android or bada. the name and select simple rule for the type, then click save. the rule to edit it or click actions edit. and bada os hold down control to make multiple selections, select false under tablet since we want our rule group to apply only to mobile phones, and now we just need to define the redirect action for our rule group. make sure liferay is still selected in the context menu selector and click on click on mobile rule groups in the navigation menu to the right figure 3.32 to apply a mobile device rule group to a page set of a site, select the site in the context menu selector, click on mobile rule groups, click select rule group, and select the desired rule click select rule group and then click the android and bada mobile phones rule group that you configured. once you've selected your rule group, click mobile rule groups again and click either on your rule group or actions then click add action, enter the name androidbada liferay redirect, and select site redirect under type. the site dropdown menu that appears, select androidbada liferay and under the page dropdown menu that appears, select the welcome page that you created now android and bada mobile phone users are redirected to the androidbada liferay site from the liferay site let's look at one more example of using mobile device rules before we move on. suppose you'd like to create another rule so that when a site is accessed by an android or ios tablet, a different layout is used. follow the same four steps described above. first, make sure that the liferay site is selected in the control panel's context menu selector and navigate to the mobile device rules page of the control panel. add a simple rule called rule 1 to this rule group. as with the previous example, we only need one rule to describe our device edit rule 1 and select android and iphone os under the os heading and true under the tablet heading, then click save next, click on site pages in the control panel, select mobile rule groups, and select the android and ios tablets rule group. selected two rule groups for the liferay site's public pages and they've been if a device making a request belongs to both of the device families represented by the rule groups, the priority of the rule groups determines which rule group's actions are executed. the first rule group contains only mobile phones and the second rule group contains only tablets, so no devices can belong to both rule groups. need to define an action for our android and ios tablets rule group to use a different layout on the site pages page of the control panel, click on mobile rule groups, and then on actions manage actions next to android and click on add action, enter the name layout template modification, and select the layout template modification action type. lastly, select the 1 column layout template or whichever one you like and now the liferay site's pages are presented to android and ios tablet users with the 1 column layout template.";;
as we discussed before, as your site becomes larger and more complex, management of the content becomes more challenging. tools that help you create content quickly and in an orderly fashion. created a simple announcement with liferay's structure editor that allows you to quickly design a structure and prepare it for the template designers. applied a template to the structure. you know how to display content using the now, you're ready to take advantage of liferay's if a web site isn't properly managed, it can quickly become stale and that if people are finding your site because of search engines, you don't want them presented with outdated and possibly inaccurate web you also want your content to be found easily by your users. additionally, you may want to create content and send it through an approval and reviewal process weeks before you want it displayed on the web site. gives you this flexibility with the schedule and workflow features.;;
in this chapter, we've discussed the reasons for plugin security management, how the plugin security manager checks each plugin against its portal access control list pacl, and how to specify pacl properties for the plugins you create and we also explained liferay's support of the java security policy, in case you need to specify rules above and beyond what pacl now you have a better understanding of how plugin security works, and can use liferay portal's plugin security manager effectively to specify exactly what services your plugin needs in order to function. with security manager turned on will know you're a law abiding citizen, because you've specified what services your applications need to access in order next, we'll show you what it takes to develop apps for publishing to;;
specify the reference ids of plugins for this plugin to access;
specify bean properties the plugin is permitted to acquire specify bean properties the plugin is permitted to set;
set to true if the hook plugin is permitted use custom jsps. hook plugin is not permitted to use custom jsps specify entities for which the hook plugin is permitted to customize indexing. customizing the indexing can involve modifying the search, summary andor specify which language property locales the plugin is permitted to override this example grants the plugin permission to override the great britain locale of english, the spain locale of spanish, and all portuguese locales specify which portal properties the plugin is permitted to override specify which services the plugin is permitted to access specify whether to allow the plugin's servlet filter hooks. true gives the plugin permission to pre-process requests going to the portal's servlets and post-process requests coming from the portal's servlets. default, the plugin's servlet filter hooks are not allowed specify struts action paths that the hook plugin is permitted to add or;;
specify which services the plugin can look up. you can use regular expressions using the sample values below, the plugin can look up objects for key names matthew, mark, mark, luke, and luke. look-up objects for key names containing john with zero or more characters preceding andor trailing john.;;
specify which services the plugin is permitted to listen on via the portal's specify which message bus destinations the plugin is permitted to call send;
specify regular expression patterns used to match any portlet ids that the plugin is permitted to access from the portlet bag pool;
specify the ids of search engines the plugin is permitted to access;
specify portal service classes andor methods the plugin is permitted to access. use the character as a delimiter between a class and its method;
for each portlet the plugin accesses, replicate this property substituting some-portlet in the square brackets with the name of the accessible specify portlet service classes andor methods the plugin is permitted to use the character as a delimiter between a class and its method;;
specify tables in the liferay database on which the plugin is permitted to perform the applicable operations. these property names use the following specify tables on which the plugin can do any and all operations specify tables from which the plugin can delete records specify tables into which the plugin can insert records specify tables in which the plugin can replace records specify tables from which the plugin can delete all records;
specify regular expression patterns used to match names of the thread pool executor for the plugin to access;
we've covered a lot of ground here. you've learned how to use liferay's remote apis, how to enable and disable remote services and access to them, and how to leverage servicecontext objects in your use of liferay services. really tested your neural net processor in working with message bus, and you've detected your grandma's tablet with liferay's device detection api. next we'll take a look at some of the powerful frameworks of liferay portal, learn how they work and how you can leverage them.;;
"the servicecontext class is a parameter class used for passing contextual using a parameter class lets you consolidate many different methods with different sets of optional parameters into a single, the class also aggregates information necessary for transversal features, including permissioning, tagging, categorization, and in this section we'll look at the service context fields, learn how to create and populate a service context, and learn to access service context data first we'll look at the fields of the servicecontext class the servicecontext class has many fields. the best field descriptions are here we'll give you a helpful categorical listing of the fields are you wondering how the servicecontext fields get populated? although all the servicecontext class fields are optional, services that store any type of content need the scope group id specified, at least. simple example of creating a servicecontext instance and passing it as a if you invoke the service from a servlet, a struts action or any other front end class which has access to the portletrequest, use one of the servicecontext object and automatically fill it with all necessary values. the above example looks different if you invoke the service from a servlet you can see an example of populating a servicecontext with information from a request object in the code of the url... the methods demonstrate how to set parameters like scope group id, company id, language id, and more; they also demonstrate how to access and populate more complex context parameters like tags, categories, asset links, headers, and the attributes parameter. url classname, portletrequest portletrequest, you can assure your expando bridge attributes are set on the next let's see an example of accessing information from a servicecontext we'll use code snippets from url..., servicecontext to show you how to access information from a servicecontext and comment on how the context information is being used as we mentioned, your service needs a scope group id from your servicecontext. the same holds true for the blogs entry service because the scope group id provides the scope of the blogs entry the entity being persisted. blogs entry, the scope group id is used in the following way here are the corresponding code snippets can servicecontext be used to access the uuid of the blog entry? can you use servicecontext to set the time the blog entry was added? can servicecontext be used in setting permissions on resources? adding a blog entry, you can add new permissions or apply existing permissions servicecontext helps apply categories, tag names, and the link entry ids to does servicecontext also play a role in starting a workflow instance for the the snippet above also demonstrates the trackbacks attribute, a standard attribute for the blogs entry service. there may be cases where you need to pass in custom attributes to your blogs entry service. carry custom attributes along in your servicecontext. set on the added blogs entry like this you can see that the servicecontext can be used to transfer lots of useful let's look at message bus next.";;
methods in liferay's apis are deprecated when they're no longer called by method deprecation occurs during major releases of liferay. you'll know when there's a major release if you understand liferay's liferay version numbers consist of a three digit knowing what each digit represents is key, so let's consider a case where you were using liferay 6.0.2, and liferay 6.0.3 has just been released;;
"the message bus is a service level api used to exchange messages within the message bus is a mechanism for sending message payloads to producers and consumers to prevent class loading issues. the global class loader, making it accessible to every deployed web application. remote messaging isn't supported, but messages are sent across a cluster message bus has several common uses, including sending search index write and running asynchronous processes you can leverage message bus to send messages between and within your plugins as we show you message bus we'll talk about things like synchronous and asynchronous messaging, serial vs. in-parallel message dispatching, and java and json style messages formats before we get into those topics, let's first try to understand message bus the message bus system contains the following components your services can send messages to one or more destinations, and can listen service can be both a message sender and a message listener. figure below both plugin 2 - service 3 and plugin 5 - service 7 send and the message bus supports synchronous and asynchronous messaging configuration of message bus is done using the following files note the internal file url of url specifies the default message bus class, default asynchronous message sender class, and default synchronous message sender class for liferay you can control your message types by using either the message or liferay core services are typically serialized and in our examples we'll demonstrate both types of message so far we've introduced the message bus system, including message types, destinations, senders, listeners, and approaches to sending messages. show you how easy it is to create your destinations, register listeners, and to demonstrate, we'll implement a business use case our use case will consider jungle gyms r-us and its distribution of playground equipment, buying the equipment from manufacturers and selling the equipment to we'll focus on the company's process for procuring new jungle gym jungle gyms r-us employs the following departments in their procurement process the departments currently use email to exchange comments about new equipment purchases, but someone always seems to be left out of the loop. was gung-ho about getting their hands on the latest and greatest spring rider animals from boingo-boingo industries, but they didn't consider the failing safety reviews discovered by the legal department, because the legal department forgot to copy the sales department in their email to procurement. feelings were hurt, and everybody avoided hanging out in the company breakroom jungle gyms r-us could use liferay's to resolve the communication breakdown, but we'll resolve the jungle gym's communication woes using message bus, to show you how it works. here are the inter-department message exchanges we'll accommodate let's implement procurement's request to finance first in our example, equipment purchases can't proceed without approval from finance since special offers from the manufacturers often only last for a couple hours, procurement makes it their top priority to get approval implementing their exchange using synchronous messaging the following table describes how we'll set things up we've set it up so finance sends its response messages to a destination on which that way a full-bodied response message is sent back to procurement in addition to the response object returned from sending the the procurement department sends a purchase approval request this sender takes the following steps creates the message using liferay's message class stuffs the message with keyvalue pairs sets a response id and response destination for listeners to use in replying sends the message to the destination with a timeout value of 10,000 blocks waiting for the response finance department listens for purchase approval requests and replies back this listener executes the following steps implements the receivemessage message method of the extracts values from the message parameter by getting values associated creates a message based on the message received via the url method, which accesses the response destination name from the message variable and sets the destination of the response message sets the response message's payload sends the response message to the response destination you can implement the listener for the legal department similarly. account for legal department-related classes in our configuration message bus configuration for the purchase approval request process for message bus to direct messages from destinations to listeners, we must register the listeners by configuring the appropriate mappings in our plugin's url file create this file if it's not the configuration above specifies the following beans when finance sends its purchase approval request message for a new three-story spiral slide, the console reports finance's receipt of the message, procurement's receipt of the callback response from finance, and procurement's receipt of the synchronous response returned from sending the message. what the console message looks like do you know what all those yes messages mean? the cash to purchase this cool new slide, and the legal department has no gripes about the slide's safety ratings! next let's have procurement notify the sales and warehouse departments and asynchronous messaging consists of sending a message and then continuing with processing without blocking waiting for an immediate response. sender to continue with other tasks. it's often necessary, however, that the listener can respond to the sender. this can be done using a call-back jungle gyms r-us's procurement department must notify the sales and warehouse departments of incoming equipment while simultaneously soliciting their to assure all three departments are up to speed, any responses from the sales or warehouse departments are posted to a shared destination the following image shows asynchronous messaging, with serial dispatching of figure 11.6 asynchronous messaging with serial dispatching let's package the message as a jsonobject and send it to the destination here's how the warehouse department listens for and handles messages here's how this listener deserializes the jsonobject from the message the class also demonstrates how the warehouse department packages a response message and sends it back to the procurement department, using these steps the sales department listener can be implemented the same way, substituting sales as the department value; the comment would likely be different, too you just used the jsonobject message type to send an asynchronous response remember, we want the procurement, sales, and warehouse departments to be aware of any message regarding the new playground equipment purchasing process. let's leverage our destination keys and department names in handling shared here's how the warehouse might handle messages it receives let's look at receivemessage for a minute. messages differently depending on their destinations messages to junglepurchase are handled as procurement's purchase notifications, while messages to junglepurchaseresponse are treated as departmental responses to procurement's purchase notifications. the doreceiveresponsemessage method performs an important task, checking that the response comes from a department other than itself, and printing an error if it doesn't here are the configuration elements we added to the url from destination beans the purchase notifications will be sent to a serial destination and the responses will be sent to a synchronous destination configuration bean listener map entry warehouse and sales are registered to listen for the notifications from procurement. registered to listen for inter-departmental responses don't forget to send news of these new products to all jungle gyms r-us in the send and forget model, the sender sends messages and continues we'll apply this behavior to jungle gym's company-wide new product procurement isn't expecting response messages from individual employees, so there's no need for the company-wide listener to package up responses. however, want everyone to get product news at the same time, so instead of dispatching news to employees serially we'll dispatch in parallel figure 11.7 asynchronous messaging with parallel dispatching we'll specify a parallel destination type in our url you implemented inter-departmental communications for the procurement process at jungle gyms r-us along the way you used message bus to implement the following next we'll show you the device detection api and its capabilities.";;
"as you know, internet traffic has risen exponentially over the past decade and with the latest and greatest devices, mobile internet access has become the norm and is predicted to pass pc based internet access because of the mobile boom, new obstacles and challenges are presented for how will content adapt to all devices with different how can your grandma's gnarly tablet and cousin's awesome new mobile phone request the same information from your portal the device detection api detects the properties of any device making a request it can also determine what mobile device or operating system was used to make a request, and then follows rules to make liferay render pages to use these features, you must first install a device detection database that can detect which mobile devices are accessing the liferay provides such a database in the liferay mobile device detection lmdd app from the liferay marketplace. for instructions on using liferay marketplace to find and install apps note the liferay mobile device detection lmdd app is ee-only for liferay although you can use other device detection databases, doing so requires you to manually integrate the database with liferay apis you can create your own plugin to use your device's database. simple uses of the device detection api and talk about its properties let's look at a couple of code snippets to get you started. object device from the themedisplay object like this using some of the methods from the javadocs, here's an example that obtains a now your code can get the device object and the dimensions of a device. course this is just a simple example; you can acquire many other device attributes that help you take care of the pesky problems that arise when sending you can refer to the device javadocs mentioned let's look at some device properties next most of the properties of a device can be detected, depending on the device detection implementation you're using. for example, you can obtain the brand name of a device with this code you can grab many other device properties, including hardwaremodel, hardwarename, releaseyear, and releasemonth. values like ismobile, istablet, and many more keep in mind the device api is an api. the underlying implementation may change. you can use your own implementation also. device property names are specific and proprietary to the underlying device api implementation with the device detection api, you can detect the capabilities of a device making request to your portal and render content accordingly; so your grandma's gnarly tablet and your cousin's awesome new mobile phone can make requests to your portal and receive identical content. you're really getting the hang of liferay's apis.";;
"liferay offers many archetypes to help create maven projects for multiple plugin types, including portlet, theme, hook, and layout template plugins. archetypes for each of these plugin types for various versions of liferay, so you almost certainly have the archetype you need archetype is maven's project templating toolkit. with archetype, you can use the same steps we detail below to generate liferay plugin projects of any type note make sure maven is installed and that its executable is in your path we'll demonstrate two ways of creating liferay plugins with maven using liferay ide and using the command line. first, let's learn how to use maven archetypes assign a project name and display name. sample-portlet and sample for the project name and display name, notice that upon entering sample-portlet as the project name, the wizard conveniently inserts sample in grayed-out text as the the wizard derives the default display name from the project name, starts it in upper-case, and leaves off the plugin type suffix portlet because the plugin type is automatically appended to the display name in liferay portal. the ide saves the you from repetitively appending the plugin type to the display name; in fact, the ide ignores any plugin type suffix if you happen to append it to the display name select maven liferay-maven-plugin for the build type. of the options for your plugin project changed, including the location field, which is set to the user's workspace by default. directory in which you want to create the plugin project. practice to create a parent project for your maven plugins, so they can all share common project information. see section using a parent plugin specify the artifact version and group id. 1.0-snapshot and url for the artifact version and group specify the active profile that you'd like your liferay plugin project to if you don't remember your active profile or haven't created one, click the select active profiles... icon immediately to the right of the text if you have any active profiles, they will be listed in the menu on to select an existing profile, highlight its profile id and select the illuminated right arrow button to transfer it to the menu on the otherwise, if you don't have any existing profile, click the green addition button to create a profile and give it an id if you're specifying a new profile, the wizard will still create your plugin, but it will need further attention before it is deployable. need to specify the necessary properties within the new profile; we'll demonstrate specifying these properties in the configuring your liferay maven project section of this chapter you also have the option to create a profile based on a liferay runtime. do this, select the create new maven profile based on liferay runtime button to the far right of the active profiles text field. liferay runtime, new profile id, and liferay version. profile location you can choose to specify your profile in the url recommended or your project's url. maven profile based on a liferay runtime, the ide automatically populates the new profile with the required properties, and no additional profile configuration is needed for the plugin select the portlet plugin type and then click finish figure 9.9 you can build a liferay plugin project using maven by completing the setup wizard you've successfully created a liferay portlet project using maven in next, let's run through steps for creating your liferay maven open the command prompt and navigate to the parent directory in which you want to create the plugin project. archetype will create a sub-directory for note if you haven't already created a parent project, you may want to consider creating one to share common project information. archetype starts and lists the archetypes available to you. to choose an archetype or filter archetypes by group artifact id. output looks similar to the following text to find the right liferay archetype for your project, you can either scroll up to find it or apply filters to narrow the set of results. liferay as your group id, and a plugin type portlet, hook, theme, etc. can help you focus on more applicable liferay archetypes entering liferayportlet as a filter gives a listing of liferay portlet choose an archetype by entering its number you're prompted to choose the archetype version. corresponding to the liferay version for the archetype. required to select the archetype version that corresponds with your liferay instance; older archetype versions are compatible with updated liferay the snapshot below illustrates choosing the archetype version figure 9.10 you're prompted by maven archetype to enter the archetype version enter values for the groupid, artifactid, version, and package coordinates properties of your project. this process is illustrated in the snapshot below figure 9.11 when creating your portlet plugin, you must enter your groupid, artifactid, version, and package properties enter the letter y to confirm your coordinates maven's archetype tool creates a liferay plugin project directory with a new note the archetype file is downloaded and installed automatically to your local repository e.g.,.m2repositorycomliferaymavenarchetypes . mirror pointing to your public repository on nexus, the plugin is installed figure 9.12 your archetype and its dependencies are now available in your local repository following these steps using liferay ide or the command line, you can use archetype to generate all your liferay projects! plugin projects generated from a liferay archetype are equipped with a pom that's ready to work with a parent project. url and url properties from the parent when your plugin is created, you can package and deploy your project to a you can even install and deploy the individual next we'll go through some brief examples to demonstrate deploying your plugins";;
"in this chapter we explored liferay ide, an extension of eclipse ide. learned to to install and set up liferay ide, then to create and deploy liferay projects, as well as import existing projects into liferay ide. we hope you take advantage of it in using liferay portal and after learning all about liferay ide we looked at managing workflows using kaleo designer for java in liferay developer studio. with developer studio's dynamic workflow diagram, you can visualize your workflow and create steps to ensure a the script and template editors give you a convenient workspace to further enhance your workflow development environment because developer studio has access to your custom business logic apis and liferay portal apis, it's simple to customize your workflow definition. your workflows running in liferay, you can publish directly to your existing liferay server; the configuration process is quick and easy. features, the kaleo designer for java in developer studio is a powerful yet next, let's get up-close and personal with liferay's apis!";;
"but the chair whose violet lining with the lamp-light gloating o'er, lenore ii shall press, ah, nevermore! lenore ii didn't make it through the chapter, but you did. your liferay plugins using maven; there's a standard process for generating the archetypes and selecting your plugin options for each plugin type. customize the archetype to your liking. using maven to develop plugins offers an easy and effective way to customize your liferay portal you accomplished a lot in this chapter. you configured maven locally, downloaded and installed the required liferay maven artifacts, and learned to create you're ready to create all kinds of liferay plugins based on liferay's plugin archetypes we've explored maven in this chapter, and the plugins sdk in earlier chapters. you've seen two powerful tools you can use to develop your liferay plugins. addition to these, there's liferay ide and liferay developer studio! at liferay ide in the next chapter note are you wondering if we're going to make more terrible jokes that";;
"instructions from the earlier section on creating new liferay projects, you should already have created the event-listing-portlet project. we'll add two portlets to the event-listing-portlet project the location listing portlet and the event listing portlet. process for creating plugins inside of an existing liferay project. this guide, when we complete developing the event listing and location listing portlets, they'll allow users to add, edit, or remove events or locations, display lists of events or locations, search for particular events or locations, and view the details of individual events or locations. how to create both portlets in the event-listing-portlet project. do, let's clean out the bare-bones default portlet from our the portlet project wizard conveniently creates a default portlet named event-listing-portlet after the project's name. this section will be named locationlisting and eventlisting. confusion between the project's default portlet named event-listing-portlet and the portlet we'll be creating named eventlisting, let's remove the default portlet by removing its descriptors and it's jsp open the url file and remove the... tags and code residing between those tags navigate to the url file and remove the... tags and code residing between those tags you've cleaned out the default portlet from the project. to start creating the example plugins your liferay ide's package explorer shows your event listing plugin project. since it's a portlet type project it has a skeleton in place for supporting more let's start by creating the location listing portlet use the following steps to create the location listing portlet right click on your event-listing-portlet project in liferay ide's package explorer and select new liferay portlet the new liferay portlet dialog box appears with your plugin project event-listing-portlet selected as the portlet plugin project by default. it's a good idea to name your portlet class after the name of your we'll name the class locationlistingportlet in this example. your java package after the plugin's parent project, so it will be url, and leave the superclass as figure 10.7 liferay ide's portlet creation wizard makes creating a portlet class is easy here are the portlet class values to specify for the example location in the next window of the new liferay portlet wizard, you'll specify your portletin our example, this will be locationlisting. the portlet's display name and title; we'll specify both as location in this window, you can also specify which portlet modes you'd like your portlet to have. view mode is automatically selected. there are also options for creating resources you can specify the folder where jsp files will be created as well as whether or not a resource bundle we'll leave the create jsp files box flagged, specify htmllocationlisting as the jsp folder, and flag the create here are the portlet deployment descriptor details to specify for the figure 10.8 liferay ide's portlet creation wizard let's you specify the deployment descriptors for your portlets this window lets you specify portlet deployment descriptor details that are you can set the file paths of your portlet's custom icon, main css file, and main javascript file. next, you can also choose the category for your portlet it's categorized under sample by default, and choose whether or not to add it to the control panel of your liferay portal. the add to control panel box unflagged the last step is to specify modifiers, interfaces, and method stubs to accept the defaults and click finish use the following steps to create the event listing portlet specify eventlistingportlet as the name of the portlet class, enter url as its java package, and select url.mvcportlet as it's superclass figure 10.9 creating portlet classes is simple with liferay ide's portlet creation wizard here are the portlet class values to specify for the example event in this window we'll specify the portlet's deployment descriptor details in the liferay display section, you can choose the category for your portlet it's categorized under sample by default, and choose whether or not to add it to the control panel of your liferay portal. accept the default, leaving the add to control panel box unflagged and the last step in creating your portlet with the wizard is to specify modifiers, interfaces, and method stubs to generate in the portlet class. by default, new portlets use the mvcportlet framework, a light framework that hides part of the complexity of portlets and makes the most common operations the default mvcportlet project uses separate jsps for each portlet mode each of the registered portlet modes has a corresponding jsp with the for example, url is for edit mode and url let's redeploy the plugin project to make our portlet plugins available in the in the servers tab, simply right click the event-listing-portlet now you've created and deployed the location listing portlet and the event listing portlet from the same project. listing portlet is complete it will allow users to enter viable event locations if you've been following along to create the event listing portlet project, next, let's find out how to import existing projects into liferay";;
with maven it's easy to deploy plugins to a liferay portal instance. make sure your parent pom's liferay-specific properties specify the correct liferay version and your liferay portal's deploy directory path here's an example of these properties using liferay 6.1.30 and a deploy directory path of eliferay-portal-6.1.30-ee-ga3deploy if you haven't already created a parent plugin project, see using a parent in your command prompt, navigate to your liferay plugin project's directory package your plugin by entering your command output should be similar to the following output deploy the plugin into your liferay bundle by entering the command output should look similar to the following output your liferay console output shows your plugin deploying. note if you get the following error after executing mvn liferaydeploy, make sure you're executing the command from your plugin's error no plugin found for prefix'liferay' in the current project and in the plugin groups url, url available from the repositories local cuserscdhoag.m2repository, central url url - help 1 if you're deploying the plugin to a release or snapshot repository, specify the repository by adding a distribution management section to your here's an example distribution management section for a snapshot repository the proper contents for your element can be found in the summary tab for each of your repositories figure 9.13 select the summary tab of your repository to see how to specify it for distribution management in your plugin's pom since you created the plugin as a snapshot, you'll have to deploy it to a you can deploy a plugin as a release, but the plugin's pom must specify a valid release version e.g., 1.0 , not a snapshot version e.g., 1.0-snapshot note there are three build phases you'll use when developing plugins with now that you've deployed a plugin using maven, let's consider the types of liferay plugins you can develop with liferay maven archetypes.;;
"you can develop all liferay plugin types with maven portlets, themes, layout templates, hooks, and ext. next, you'll learn how to create each plugin type using maven, and we'll point out where each plugin's directory structure is different than if you created it using the plugins sdk. previous sections for creating and deploying these plugin types in maven using we'll also reference sections of some other chapters in this guide, since they're still relevant to maven developers they explain how you develop each type of plugin regardless of development environment let's start with portlet plugins to create a liferay portlet plugin project, follow the creating liferay plugins tip as you use maven's archetype tool to generate your portlet project, you can filter on group id liferay, or even the group idartifact id combination liferayportlet, to find the liferay portlet archetypes more easily a portlet project created from the the portlet-pluginsrcmainjava directory is created automatically when you create a portlet project with maven. it holds the portlet's java source code portlet-pluginsrcmainwebapp holds its web source code. any portlet plugins using the plugins sdk, you might have noted it uses a the following table illustrates the differences in location of the java source and web source code for a maven project and a plugins sdk project to view the full directory structure of a portlet developed by ant, visit our to deploy your portlet plugin, follow the instructions detailed above in deploying liferay plugins with maven you successfully created a liferay portlet plugin using maven for detailed information on creating portlet plugins, see chapter 3, next, let's run through a brief example for developing a theme plugin using so you're sitting in your armchair next to the fire, just as we described in our chapter introduction; shadows dance on the tapestry-covered wall, and lenore ii your cat is purring atop the mantle. yes, you're passing this cold winter's night in grand style in front of your computer, of course. yourself sitting on a cold hard wooden chair inside an off-white cubicle with empty walls you're still in front of your computer, of course. descriptions paint two very different pictures, but both describe what you're changing the scenery of your portal sets the we'll show you how to develop your own theme plugin i.e., your scenery using maven so your portal has a lasting impression on anyone theme plugin creation is similar to portlet plugin creation. assuming you already created the sample-parent-project and its url to create your liferay theme plugin project follow the creating liferay plugins with maven section, making sure to select theme as the plugin type tip as you use maven's archetype tool to generate your theme project, you liferayportlet, to more easily find the liferay portlet archetypes a theme project created from the several of the directories listed in the structure above are not created automatically; you'll create them as needed, depending on the customizations here's a list of these directories, with a brief description of the srcmainwebapp folder contains your theme's customizations. ever created a theme plugin using the plugins sdk, this folder is used the same way as the docrootdiffs folder. for example, url should go in here's a table describing the directory structure differences between themes created using maven and themes created using the plugins sdk to view the directory structure of a theme developed by ant, visit the anatomy the theme plugin project pom has two additional properties artifact as the parent using the syntax groupidartifactidversion, or use the core themes by specifying unstyled, styled, classic, or url sets the template theme language the default settings for the two theme properties look like this to deploy your theme plugin, follow the instructions in the deploying liferay note when you execute the package goal, a war file is created; it's just like the maven war type project. simultaneously, the parent theme is downloaded and copied, and your theme's customizations are overlaid last. of the theme is created and placed in the target directory. target url in your theme project for more information on liferay themes and its settings, see chapter 5, you successfully developed a liferay theme using maven. hooks are the optimal plugin type for customizing liferay's core features. creating a hook is almost identical to portlet plugin creation in maven. to create a liferay hook plugin project, follow the steps outlined in the creating liferay plugins with maven section, making sure to select hook as tip as you use maven's archetype tool to generate your hook you can filter on group id liferay, or even the group idartifact id combination a hook project created from the the hook-pluginsrcmainjava directory holds the hook's java source code e.g., url , and hook-pluginsrcmainwebapp if you're familiar with creating hook plugins using the plugins sdk, you probably noticed that maven uses a different plugin to view the directory structure of a hook developed by ant, visit the anatomy to deploy your hook plugin, follow the instructions from the deploying liferay for detailed information on creating hooks, see chapter 7, you're nearly a maven expert now; you're able to create portlets, themes, and let's round things out by learning to develop layout templates you can create layout templates to customize the display of portlets on your page and to embed commonly used portlets. in our introduction to themes, we described a nice scene where you're relaxing in a luxurious chair, computer in your lap, lenore ii your cat purring on the mantle above a dancing fire. it would be, but the chair's too small, so your knees are up in the air when your feet are flat on the ground, and your laptop is balanced precariously on top of them. the fire is also surprisingly large for in fact, its flames are already licking at the bottom of the remember lenore ii, softly purring on the mantle? she's going to cook just like the original lenore if we don't do something! but it's so hard to get out of this tiny chair. tell this soul with sorrow laden if, within the distant aidenn, it shall clasp a sainted kitten whom the angels named lenore ii in memory of the late, now cripsy lenore ii, let's create a layout template to create a liferay layout template plugin project follow the creating liferay plugins with maven section, making sure to select layout template as the tip as you use maven's archetype tool to generate your layout template project, you can filter on group id liferay, or even group id artifact id combination liferaylayout, to find the liferay layout template archetypes a layout template project created from the there's a directory structure difference between plugin projects created using liferay maven archetypes and those created using the liferay plugins sdk. following table illustrates this difference to view the directory structure of a layout template developed by ant, visit the to deploy your layout template plugin, follow the instructions detailed above in the deploying liferay plugins with maven section for detailed information on creating layout templates, see chapter 6, creating you've passed your trial by fire the cat thanks you, developing yet another in the next section we'll cover other liferay-provided maven archetypes did you think we covered all the available archetypes for developing liferay the liferay team has been busy expanding our archetype list, and we're proud to show you some additional plugins that you can create using maven check out these exciting archetypes that are now available in addition, there are two new maven goals now available you now have plenty of archetypes at your disposal!";;
"what if you have existing projects that you want to work on in liferay ide? you can import your existing projects into liferay ide to take advantage of we'll cover the following import scenarios importing existing liferay projects from the plugins sdk importing eclipse projects that aren't in liferay ide i.e., don't have the liferay facet or target runtime importing existing liferay ide projects from another liferay ide version or let's start by learning how to import existing liferay projects from liferay you can import liferay projects you created with the plugins sdk, but aren't yet in your liferay ide eclipse workspace. these projects might already have.project or.classpath files in them; regardless, we'll use the same note the next two sections assume that you've created projects with the plugins sdk and are familiar with the directory structure used by the plugins first let's look at the import process for creating a single liferay ide project in liferay ide, go to file new project... you can invoke the same wizard from the liferay shortcut bar; just click the create a new liferay project button figure 10.10 alternate method of importing a project it should be a subdirectory of one of the plugin types e.g., portlets, hooks, themes, etc or it won't import once you select the plugin project folder, its type and sdk version values are updated to the correct values. enough or the project type is incorrect, it gets marked with an error after you select the plugin project folder, the liferay plugin type and liferay plugin sdk version values are updated. outdated or you entered an incorrect project type, its field gets marked select the liferay target runtime to configure on the project once it's if you don't have a liferay portal runtime, use the new... click finish to perform the import remember to verify that your project was configured correctly as a liferay ide verification is described right after our next topic, which is making multiple liferay ide projects from a single plugins sdk next we'll show you how to import all your plugins sdk projects into liferay does your plugins sdk contain multiple plugins? you can easily batch import each plugin in your plugins sdk as its own liferay ide project figure 10.11 choosing the project type for import in the import projects window, use the combo box to select the liferay plugins sdk you're importing plugins from note if your sdk isn't configured in liferay ide i.e., it's not in the dropdown list of the import projects window, use the configure link to to configure a plugins sdk on the installed sdks on the pref page just click add and then browse to the directory of the plugins sdk root once you select your plugins sdk in the combo box, the liferay plugin sdk location and liferay plugin sdk version fields are automatically filled invalid entries are marked with an error the list of projects that are available for import are displayed in a table. any projects already in the workspace are disabled. import have an empty check box; select each project you'd like to import select the liferay runtime you want to set up for the imported projects if you don't have a liferay runtime, can add one now with the new... next, we'll talk about importing existing eclipse the steps we outlined above let you import projects that have never been opened if you've been using eclipse without liferay ide, you may already have a project in your eclipse workspace. follow the import steps below to in eclipse, right-click the project in your project explorer, and select note if you don't have a convert action available it means either that the project is already a liferay ide project, or that it is not faceted i.e., java and dynamic web project facets are not yet configured. configure accordingly before moving on in the convert project wizard, your project should be selected and the sdk location and sdk version should be detected automatically. valid, an error message is displayed figure 10.12 converting a project select the liferay runtime to use for the project. liferay runtime defined, do so now by clicking new... remember to verify that your import was successful and that your project was configured correctly as a liferay ide project. we have one more import scenario to coverimporting existing liferay ide projects into your liferay ide what if you had a liferay ide project in your workspace, but it's not there here's how you can import it into your current workspace existing projects into workspace choose the option select root directory, then click browse... select the directory of the liferay ide project to import in the projects list you should see your liferay ide project note there are two common errors that occur when importing existing liferay ide projects into your workspace the sdk name used in that project doesn't exist in your new workspace the runtime id used doesn't exist in your new workspace you can modify the sdk name in project properties liferay dialog window; you can modify the targeted runtime in the project properties targeted runtimes dialog window let's verify the success of your imports and ensure that they're properly configured as liferay ide projects after importing projects into liferay ide, you'll want to verify that they imported successfully, and that they're properly configured as liferay ide here's how you verify that your imports were successful once the project is imported, you should see a new project inside eclipse and it should have an l overlay image; the l is for liferay! figure 10.13 verifying that the import succeeded let's check the project's target runtime and facets to make sure it's configured as a liferay ide project in the package explorer, right click in the properties window, click project facets and make sure both liferay runtime and liferay plugin facets are properly configured you've confirmed that your import was successful; you can now make revisions to your configured liferay ide project. ide's remote server adapter feature.";;
"the remote server adapter is a feature that lets you deploy your liferay projects to a remote liferay portal server. development instance of liferay that's on another machine, then the remote server adapter is your solution. satisfy two requirements to use a remote server adapter the remote server adapter lets developers deploy local projects to a remote if you're using liferay ide and want to deploy projects to a remote server, the remote ide connector application must be do not install the remote ide connector application on a production server it creates an unnecessary security risk. it is meant for use on development servers only to start deploying projects to a remote server, download and install the following resources on your local development machine of course, we're assuming you have a development server up and running. demonstration uses the remote server adapter on liferay portal bundled with apache tomcat, but you can use the adapter with liferay portal on any you still need to install a full liferay development environment locally on your machine before using the remote server adapter, so that you can compile plugins follow the instructions earlier in the chapter to get your liferay ide or liferay developer studio environment up and running important keep a record of your portal administrator login credentials e.g., usernamepassword for your remote liferay server; you'll need them to configure your connection from liferay ide to the remote liferay server let's start by configuring the remote server adapter you can use liferay ide's remote server wizard to configure the remote server adapter and install the remote ide connector to your liferay instance. alternatively, you can install the remote ide connector to your liferay instance before configuring liferay ide's remote server adapter. server adapter, use the following steps start your remote liferay portal instanceverify that you can log in as an launch liferay ide and open the new server wizard by clicking file new other; select server in the server category and click select remote liferay server liferay 6.1 in the liferay, inc. enter the ip address of the machine with the remote liferay portal instance into the server's host name field. liferayip address, then click next figure 10.15 define the remote liferay server the new server wizard's next page directs you to define the liferay doing so allows projects created for your remote server to use the runtime stub for satisfying jar dependencies needed to compile select the liferay bundle type based on the version of your local liferay bundle, browse to the liferay bundle on the next page of the wizard, configure your connection to your remote leave the liferay portal context path and server manager context path set to the defaults unless these values were changed for your remote liferay your remote liferay portal instance needs the remote ide connector application installed; otherwise, liferay ide can't connect to it. haven't installed liferay ide connector yet, click the remote ide connector if you already downloaded the remote ide connector application and installed it to your remote portal, skip to the next step and browse liferay marketplace for the when you've found it, click free to once you've purchased the application, navigate to the purchased page of the control panel's marketplace interface figure 10.16 click purchased in the marketplace section of the control panel to download and install the remote ide connector application that you purchased find your application in the list of purchased products. buttons to download and install the application. your remote portal, return to the remote liferay server configuration wizard click the validate connection button; if no warnings or errors appear. if you get any warning or error messages in the configuration wizard, check your connection settings once liferay ide is connected to your remote liferay portal instance, click finish in the remote liferay server configuration wizard after you click finish, the new remote server appears in liferay ide's this tab appears in the bottom left corner of the eclipse window if you're using the liferay perspective. connection settings correctly, eclipse connects to your remote server and displays the remote liferay portal instance's logs in the console. remote server is in debug mode, the eclipse java debugger is attached to the you can change the remote server settings at any time. remote server instance in the servers tab to open the configuration editor, where you can modify the settings now that your remote liferay portal server is configured, let's test the remote once your remote liferay portal server is correctly configured and liferay ide is connected to it, you can begin publishing projects to it and using it as you would a local liferay portal server here's how to publish plugin projects to your remote server in liferay ide right click on the server and choose add and remove... note make sure you have available projects configured in liferay ide. if not, you'll get an error message indicating there are no available resources to add or remove from the server select the liferay projects to publish to your remote server; click add to add them to your remote server, then click finish. your console displays a message that the plugin was successfully deployed if publication to the remote server was successful as you make changes to your plugin project, republish them so they take to set your remote server's publication behavior, double click your remote server in the servers tab. choose to automatically publish resources after changes are made, automatically publish after a build event, or never to publish to manually invoke the publishing operation after having modified project files, right click on the server in the servers view and now that you've seen how you can deploy projects in liferay ide and liferay developer studio, we can begin delving into the features it offers. explain developer studio's kaleo designer for java and how you can design workflows for enhanced business logic.";;
"liferay portal includes a workflow engine called kaleo designer for java. kaleo allows portal administrators to set up workflows for their organization's needs; the workflow calls users to participate in processes designed for them. kaleo workflows, called process definitions, are essentially xml documents. kaleo supports a host of xml element types to trigger decisive actions in your you can fine tune the logic of your process definition by incorporating scripts and templates. marketplace includes liferay's kaleo workflow designer that lets you create and modify portal workflows in your browser. with kaleo designer for java, you can design and publish kaleo workflows from liferay developer studio! figure 10.17 kaleo designer for java gives you a powerful environment for designing, modifying, and publishing kaleo workflows kaleo designer for java lets you incorporate back end java development and its graphical interface lets you drag and drop a shortcut on each node gives you easy access to the node's xml, letting you edit its current implementation to make subtle modifications or inject new business logic. studio comes bundled with a javagroovy editor made available by spring source, giving you the same rich editing experience you're accustomed in the editor you can delegate workflow decisions to your custom business logic apis or access any of the liferay portal apis. leverage editors for beanshell, drl, javascript, python, and ruby scripting kaleo designer for java gives you a rich tool set for creatingediting workflows, manipulating workflow nodes, and implementing with kaleo designer for java, you can remotely add and update workflow definitions directly to and from your liferay server. workflow drafts to your portal by simply dragging the workflow file onto your portal server in developer studio's servers tab. workflows you've published from studio and gives you access to workflows already published on the portal server. you can edit existing workflows and create custom business logic in developer studio locally, then republish them on your portal; you don't have to navigate back and forth from your portal and developer studio to complete these tasks. as you can see, kaleo designer for java is a powerful application for creating, modifying, and publishing workflows in note the kaleo forms ee app comes with an existing workflow designer that's used within liferay portal. it's used to design workflow configuration chapter of using liferay portal. chapter of using liferay portal if you're unfamiliar with basic kaleo workflow concepts or want to know how to design your workflow within liferay portal to use kaleo designer for java, install the kaleo forms ee app from liferay the app includes three plugins kaleo-forms-portlet, kaleo-designer-portlet, and kaleo-web plugins here's how to download and install kaleo forms ee download and install the kaleo forms ee app after downloading and installing the kaleo forms ee application, restart the liferay server and a kaleo workflows folder automatically appears underneath the server instance in the servers view of developer studio figure 10.18 in studio's servers view, your server's kaleo workflows folder shows workflows published on your portal developer studio retrieves all workflow definitions published on your portal as mentioned previously, the kaleo designer for java lets you remotely add and update kaleo workflow definitions directly to and from the portal the single approver workflow comes already installed with the kaleo to open a workflow, double click it in the kaleo workflows folder. retrieves the workflow definition from the liferay server so you can edit it in note when you open a workflow, you'll be prompted to choose whether to switch to the kaleo designer perspective. perspective's helpful features, including the palette toolbar, properties view, next, let's get into the flow pun intended by creating our own workflow using the kaleo workflow designer for java developer studio makes it easy for you to write custom business logic that let's create our own workflow in developer studio and highlight features from kaleo designer for java designer along the way to demonstrate designer's features, let's create a workflow definition for a figure 10.19 check out the adventures of liferay's mascots, ray and alloy, found at url create your new workflow definition by going to file new alternatively, you can select liferay kaleo workflow from the toolbar button shown in the figure below figure 10.20 create a new workflow definition locally by selecting liferay kaleo workflow from the toolbar button the create new kaleo workflow file wizard will guide you through the steps necessary to complete the initial setup of your new workflow definition the first window you'll see is the create kaleo workflow form. project specify an existing liferay project to house your workflow folder specify where in the project the workflow definition xml file will name give your workflow definition a descriptive name. initial state name and final state name name your workflow's initial default script type choose a default script type; designer will bring its editor up when you're done creating the workflow open it when you're done creating the workflow the snapshot below displays the setup menu for our ticket process workflow definition when you're finished in this window click next you'll be directed to the choose assignment type window next. provide an initial task name, then choose an assignment type from the list for our workflow example, select assign to asset creator and name the task when our workflow's developer task is invoked, the creator of the workflow's asset is assigned to it. workflow is associated with an asset type. associate our workflow with a dynamic data list ddl figure 10.21 when choosing an assignment type for a task node, you are given multiple options note you must specify a liferay project as a home for the workflow click finish to complete the initial setup of our workflow definition your workflow appears as a workflow diagram, letting you interact with your graphical features and toolbars allow you to customize the palette view is one of designer's most commonly the palette lets you graphically customize your workflow with nodes and in addition, you can choose different behaviors for your mouse figure 10.22 the palette toolbar lets you customize your workflow with additional nodes and transitions transitions connect one node to another. on exiting the first node, processing follows the transition to the node it points to. your pointer into a connector; you connect the starting end of a transition to one node and the other end to the next node in your process in addition to start and end node types, there are five node types you can drag and drop any nodes you need onto your workflow diagram. supports execution of scripted actions and sending notifications that can use for additional information on the node types, refer to the kaleo section of using liferay portal for our ticket-process-definition workflow diagram, we have a simple startnode state node, followed by the developer task node, followed by there are two transitions, from startnode developer and from developer endnode we want a developer to approve his fix and send it for quality assurance to qa, where it must pass testing by a qa engineer. management, where it must be approved by a qa manager. to accurately depict these parallel approval tasks drag and drop a fork node onto your workflow diagram. click the green plus symbol to select new or existing nodes to process in parallel threads. options to select tasks to be done in your fork threads. lets you indicate whether to automatically add a corresponding join node to your figure 10.23 you can select what to fork and whether to automatically create a join node on finishing your fork node in the wizard, kaleo designer places your new nodes onto the workflow diagram's canvas. if you're not happy with the location of your new nodes, drag them to place them where you want on your canvas. ticket process workflow now looks something like this figure 10.24 after creating the fork and join nodes, you can reposition them to your liking why is there a red x in the bottom left of multiple nodes within our workflow? errors indicate something is specified incorrectly or is studio displays hints on resolving each problem. hovering your pointer over a node brings up a floating palette; use it to make quick, convenient customizations to a node the floating palette has several features you can use obviously, there is still work to be done in our workflow definition. multiple error markings and the fork and join nodes aren't connected to let's change the assignments for our two new task nodes, qa and qa management, by clicking the change assignments icon from the floating palette the choose assignment type menu appears for each node, letting you choose their assignment type. after we assign the qa and qa management task nodes, the error markers disappear for our ticket process workflow's qa tasks, let's assign someone other than realistically, each of these tasks would be assigned to for simplicity, lets assign both the qa and qa management if you have a user in mind, specify that user. otherwise, create a user named joe bloggs with screen name joe. to receive emails, he must be registered within liferay portal. registered joe bloggs joe already, see the adding section of using liferay portal for instructions. email, login to the user's account and visit control panel server administration mail for setup options select the change assignments icon from the floating palette for each qa task then, select assign to a specific user from the choose assignment you have options to enter the user's user-id, enter the user's screen name and click figure 10.25 designer lets you assign a task to a specific user of liferay portal assigning the qa and qa management task nodes resolved their error markings no the join node's error marking won't disappear until you connect while we're using designer's workflow diagram, let's go over some of its developer studio provides you with additional features within the workflow below we list some of these features; they can greatly enhance your workflow diagram actions are available via the toolbar in the upper right corner of the workflow diagram these toolbar icons are shown in the figure below more workflow diagram actions are accessible by right clicking on the you've probably noticed the properties and outline views below your workflow the properties and outline views contain more cool features you can use to customize your workflow; they're located on the bottom and bottom right of the properties view lets you edit the current node's properties. selected or you select the workflow canvas, the properties view displays your workflow's general properties; you can edit these, too. individual node, its properties appear node properties are grouped as follows here's what the properties view looks like in developer studio figure 10.26 the properties view gives you multiple sub-tabs to help customize your workflow nodes workflows frequently become too large to view in entirety on the workflow diagram screen; the outline view is a huge asset when this happens. level view that displays your entire workflow definition, no matter how large it in addition, it highlights what you're currently viewing on your workflow diagram, giving you a picture of where you're located in the broader you can use the outline view to change your position in the workflow diagram by dragging the highlighted box where you'd like to developer studio's properties and outline views make customizing your developer studio also offers a convenient way to edit your workflow scripts, which is our next topic you can use developer studio to edit workflow scripts; it recognizes multiple script languages, so you can choose one you're comfortable with. studio provides you many script editing features so you can quickly implement business logic in your workflows developer studio supports several script languages let's dive back into our software ticket workflow definition and create a it's not guaranteed that every ticket submitted has a resolution. issue was due to a silly user error, there's no reason to change the product. such cases the developer will resolve the ticket and indicate there is no resolution in the product i.e., no modifications are were made. we'll have the developer fill out an online dynamic data list ddl form to initiate a workflow for each of her tickets. once the workflow is invoked, its associated ddl record is accessible from our workflow's context. condition node to handle the ticket based on the ddl record to set up the workflow process we described above, we'll need to add a condition node and two transitions drag and drop a condition node onto your workflow diagram. condition node menu should appear choose a script language for the condition node. see how easy it is to embed java code. in our groovy script, we'll access the ddl record to determine whether the ticket warrants a modification to if it does, we'll assign it to a developer via the developer otherwise we'll end the workflow by transitioning to the from the create new condition node menu, add two transitionsone to the developer node and the other to the endnode state. transition to the developer node first click the green plus sign and select the transition icon from its menu. entry for the transition appears in the named list of condition click the browse icon in the entry and select the developer node add a transition to the endnode state in the same manner that added the transition to the developer node in the previous step here's a snapshot of the create new condition node menu configured for the figure 10.27 when creating a condition node, you can set your preferred script language, name, and condition transitions before adding a script to our condition node, let's make some changes to our to add a transition from one node to another, do the following click the transition icon from the palette. plug indicating you are in connector mode select a node on your workflow diagram from which the transition will start. a dotted line appears with one end connected to the selected node and the other end following your pointer select a node to which the transition will end. a fixed ray with the arrow pointing to the transition's end node to exit connector mode, hit escape on your keyboard and click your pointer at empty space in your workflow diagram you may notice the error marking on the condition node. the marking, a hint indicates a script must be specified for the node open the script editor for your resolution condition node by doing one of the we set our default script language to groovy, so the javagroovy editor appears. to learn more about the groovy editor, see the groovy user if you set the script language to another language, the editor for that specific language appears. in the context of editing the specific node you selected. the script editor for this condition node is written inside the tags for the element that represents our node in our workflow definition's xml file in our case, note developer studio lets you use multiple script editors even while modifying the same workflow definition xml file the palette view is much different from when you were working in the workflow diagram; it's associated with your javagroovy script editor now and includes folders containing the following entities for your script you can expand and collapse a folder by clicking its name bar here's a snapshot of the palette with the context variables folder open figure 10.28 each script editor is associated with a palette that contains helpful snippets of code you can insert drag and drop an entity from your palette onto your javagroovy editor and code representing that entity appears in the editor. compile errors and warnings because the editor is running in the context of all of the liferay portal apis are available to you. editor you can invoke code-assist and access built in kaleo workflow variables let's get the ddl record that's being worked on in our workflow process. need the servicecontext entity, under context variables in the palette. learn more about service context and its parameters, see the service let's use designer's palette features in conjunction with our javagroovy editor drag and drop the servicecontext entity from the context variables folder in your palette onto the script editor. drag and drop the ddlrecord entity from the dynamic data lists folder in your palette onto the script editor. we get the ddlrecordid from the service context and use that id to look up the ddl record via liferay service utility ddlrecordlocalserviceutil append the following java code to the ddlrecordlocalserviceutil script we're pulling out the status from the ddl record and returning a value indicating yes to continue fixing the ticket issue or no to transition to add the following to the script's imports to finish things up now the script accurately implements the condition logic we want. all of the code was injected into our workflow's xml file within the element that represents our condition node note make sure you correctly name the transitions stemming from the the no transition should point to the endnode, while the yes transition should point to the developer. if the condition script's return values don't match the transition names, the workflow engine won't know which here's a snapshot of our current ticket process workflow after inserting the figure 10.29 the ticket process workflow after inserting the condition node we need to create a valid ddl record to invoke this workflow properly. thinking how do we set up a ddl record? or how does this ddl record thingy work?, you're on the right track. if you're jumping up and down screaming ddls soon in the configuring a ddl record section of this chapter next let's create a custom notification and write a template for it using a designer lets you leverage freemarker and velocity editors to customize templates for your workflow notifications. to edit velocity templates, you'll need to install an don't worry, developer studio makes it easy, and we'll show you how liferay developer studio comes with additional add-on support for editing velocity template notifications in the kaleo designer for java. feature go to the developer studio 1.6 customer page navigate to the add-on install velocity editor support section, and download the liferay developer studio velocity update site zip file and install it. from liferay developer studio, click help install new software browse to the downloaded update site zip file and select it click ok to close the add repository dialog expand the added repository and check the liferay developer studio uncheck the option contact all update sites click next to progress through the wizard after reading and accepting the license agreement, click finish restart liferay developer studio to complete the install when you edit a notification template set to the velocity type, the template opens in the velocity editor a small v icon is in the left side of the to access the template editors, click on the node of your choice and select the notifications sub-tab in the properties view. clicking the green plus symbol figure 10.30 when creating a notification, developer studio offers several options, like choosing a template language there are several fields to fill in for your notification click the pencil icon to open the editor associated with your notification's like the script editor, the template editor's palette view lists entities that you can drag and drop onto your workflow diagram because developer studio lets you leverage full featured template editors like freemarker or velocity, content-assist is available for you to use right away. for example, if you are using the freemarker editor, content-assist suggests freemarker functions when you are editing your notification template. addition, when you're doing a freemarker variable insertion, the editor gives you all the available variables that are a part of the kaleo workflow. visit the documentation pages for freemarker and for more information on the variables and functions available in these template note similar to the bundled script editors, developer studio lets you use freemarker and velocity template editors to customize notifications in your let's continue editing our ticket process workflow. task assignments, our project management team should be notified. notification email, we'll add a new task node that transitions from our join this new task node will hold our email notification. assign this task to a project management role and email it to the project for demonstration purposes, we'll use joe blogs as mentioned previously, you can specify an existing user that has an email or create a user with screen name joe having your email this process is similar to how we assigned our previous task nodes drag a new task node onto your workflow diagram name the new node project management and select assign to a specific now we just need to incorporate the project management node into our add a transition named passed qa from our join node to the lastly, add a transition named completed from our project management node to our endnode. here's an updated screenshot of what your workflow diagram should look like figure 10.31 our workflow diagram is busy now; but we're not finished yet! let's create our email notification for our project management task node next. click on the project management node and select notifications in the to create the email notification, follow these steps click the green plus symbol to create a new notification in the name text field, enter ticket process email select freemarker from the template language drop-down menu select on entry from the execution type drop-down menu now open the freemarker template editor by clicking the pencil icon beneath the insert freemarker code into the freemarker editor to specify your email we've provided an example email notification code snippet the snapshot below illustrates what the snippet sends to the configured email figure 10.32 this is how the email notification will appear when it's received your email notification is set up! now, when the project management task node is activated in the workflow, the specified user i.e. joe will receive the notification email, all dressed up with your freemarker template you might say it's all dressed up with somewhere to go with template editors, customizing your notification templates is easier than freemarker comes bundled with developer studio so it's obviously the simplest solution, but you can create velocity templates just as easy by using the velocity editor you installed in the next section you'll see a list of workflow and service context content you can use when creating a customized script or template a context variable provides a uniform variable to insert into your templates and when executed, a context variable is automatically deleted and replaced with the value pertaining to that key. when you create notifications for a workflow, assign liferay portal context variables for a cleaner and more with context variables, your notifications become more customizable, rather than following the same format for every recipient. context variables you declare in your notifications refer to your liferay instance and the values it holds for your declarations below you'll see tables listing numerous context variables and service context the context variables are the first table, followed by the service context content for web content, blog entries, and message board messages. separated service context content from the workflow context variables because service context keys depend on asset type, while context variables don't. note the asterisks ; they're used to flag context variables that depend on next you'll learn how to view your workflow definition xml file in developer the workflow diagram view of your workflow definition is convenient; sometimes you'll also want to edit and review your workflow definition's xml source code. selecting the source tab next to the diagram tab in the main editor view takes you to the xml, and you can easily switch contexts as you need figure 10.33 feel free to switch between diagram and source modes of your workflow editor in kaleo designer for java source mode offers you its own cool features creating new workflow definitions explains how to define workflows via xml with the source view, you can keep track of your edits while using developer studio's powerful graphical features let's save your workflow definition and publish it to your liferay server after you create a new workflow or modify an existing one, you'll have to publish it onto your liferay server before your site's members can use it. publish the ticket process workflow definition onto your liferay server to publish your ticket process workflow definition right-click the kaleo workflows folder listed under your liferay server in select upload new workflow... to bring up the workspace files browser browse for your workflow definition file and select it for publishing alternatively, you can publish your new workflow xml file by dragging it from your package explorer view onto your liferay server in your servers view note to update your kaleo workflows folder with the latest workflow versions created or modified in liferay portal using kaleo workflow designer from the kaleo forms portlet, right click kaleo workflows under your server you probably understand why it's necessary to publish new workflow definitions onto the liferay server; it might be less clear why you need to republish existing workflow definitions that you've modified. workflow, they're not immediately available in your portal; it's still using the previous version of the workflow. developer studio saves the workflow as a draft, so you can work on multiple iterations of the same version until you're once you publish, you now have a new version to for example, you might be working on version 1 of your workflow definition; as you make changes, you save them in multiple drafts. you are finished with all of your changes, you publish the workflow triggering creation of a new version version 2 of the workflow. available on the server immediately for your workflow administrators to associate with asset publications, ddls, and with kaleo forms unlike other java editors, developer studio lets you test your workflow you can also publish your workflow definition straight to liferay portal for quick and easy configuration are you ready for our kaleo designer for java finale? activate the workflow in your liferay portal, then we'll set up the ddl record let's put some finishing touches on your workflow and test drive it in liferay before you can use a workflow definition, it must be activated in your navigate to the control panel and select workflow. the definitions tab, click on the actions button and select activate a workflow definition can be associated with publication of an asset or ddl let's associate our ticket process workflow definition with a ddl record that lets a developer indicate whether she'll fix a ticket's issue. find detailed instructions for creating a ddl by visiting the section we'll demonstrate how easy it is let's associate our workflow with a dynamic data list ddl record. more about ddls, visit using web forms and dynamic data first we'll create a data definition that lets the user select a status value in liferay portal, go to control panel dynamic data lists click the manage data definitions link, then add a new data definition in the fields tab, drag and drop the select field onto the canvas figure 10.34 creating data definitions for your ddl is a snap with liferay's graphical drag and drop interface in the settings tab, double click the name property to open the property editorenter status as the value edit the options setting; give your status field option values of fix with label fix and not with label do not fix recall the code we inserted for our condition node in our code, the getfield method ingests the value of our ddl field named when the script is invoked, if the value for the status field is not, the value no is returned and our workflow transitions to our endnode otherwise, the workflow transitions to our developer task node after you create the data definition, make sure you select the ticket process workflow for our new kaleo forms process to use. now our ddl is set for use inside our ticket process workflow! kaleo forms portlet to test our new workflow definition! let's use the kaleo forms portlet to invoke our workflow from liferay portal. deploy the kaleo forms portlet to your portal and add it to a page on your site. you can learn how to use kaleo forms in the kaleo section of using liferay portal; we'll demonstrate its use here by using it with our ticket process workflow create a new process in kaleo forms; name it ticket process select the status data definition we created earlier add an initial form based on our status data definition select our ticket process workflow leave workflow task forms unassigned for our demonstration figure 10.35 to test the ticket process workflow, create a new kaleo forms process--provide a name, entry definition, and workflow after saving, select the summary tab in kaleo forms, click the submit new button, and select ticket process now you can interact with the ddl and progress throughout the ticket process remember to sign in as joe bloggs to access the tasks joe bloggs should also receive an email when the project you successfully created a workflow definition and created a workflow process you're officially a workflow master you can get your framed certification at the front desk on your way outtell them we sent you! have you noticed that there's a lot of depth to liferay ide? across difficult questions and run into very specific problems, but someone else might have already solved your issue or answered your question. don't reinvent the wheel, visit the liferay ide community on the forums page, you can look up resolutions to specific errors and ask be sure to fully describe any problems you have to ensure you get a you can even track known issues from the issue tracker page.";;
in this chapter we created layout templates, arranged their rows and columns, congratulations on mastering the fundamentals of liferay's layout templates, but be careful. if your feng shui skills become widely known, your friends may ask you to re-arrange their living room if you're up for it, let's learn how to customize core liferay portlets using;;
"in our hook that created a custom login action, we modified the this property accepts multiple values, so our value was appended to the existing url values. repeatedly modify the property from additional hooks because it accepts some portal properties only accept a single value, such as the url property, which is either true or false. modify single value properties from one hook; otherwise liferay won't know to find out which properties accept multiple values, look in the configuring note hooks support customizing a specific list of predefined properties. this list is found in liferay-hook-liferay version.dtd, in the definitions folder of the liferay source code. in addition to defining custom actions, hooks generators, and content sanitizers. if you want to customize a property that's not found in this list, you must use an ext plugin chapter 8 now let's look at overriding and adding struts actions from a hook plugin.";;
in this chapter we discussed some of the many uses of the versatile hook plugin, the preferred tool for customizing liferay. you learned how to perform custom portal actions, override and extend custom portal jsps, modify portal properties, and replace portal services. next, we'll talk about using ext plugins to make customizations that you can't make with any other liferay plugin;;
would you like to modify the search summaries, indexes, and queries available in developing an indexer post processor hook lets you do just the indexer hook implements a post processing system on top of the existing indexer to allow plugin hook developers to modify their search, index, let's run through a simple example to preview what you can accomplish with an indexer hook. for our example, we're going to add job title into the user indexer so we can search for users by their job title in your existing example-hook project, open the url file and insert the following lines before the closing tag the tag clarifies the model entity for the indexer. furthermore, the tag clarifies the implementation of the interface create a new class in the docrootweb-infsrccomliferayhookindexer directory of your example-hook named sampleindexerpostprocessor. the java source file's contents with the following lines notice the sampleindexerpostprocessor class extends liferay's enable users to search for job title amongst all the portal's users. we've added a new feature for the user indexer. navigate to the control panel users and organizations and make sure a user has a job title, which can be added in any user's my account interface. then test out the indexer hook by searching for that job title figure 10.5 in this example, searching for nose model returns one user with the matching job title in the next section, we'll explore more hooks that allow for customizing;;
since hooks are the preferred plugin type for customizing liferay's core features, the liferay team is happy to keep providing you new hooks. section is a placeholder for hooks that are available in liferay portal 6.1, but aren't yet fully documented servlet filter hook servlet filters allow you to pre-process requests going to a servlet and post-process responses coming from a servlet. requests are received that match url patterns or match servlet names specified in your servlet filter mappings, your specified servlet filters are applied. hook elements servlet-filter and servlet-filter-mapping have been added to url so you can configure your servlet filters.;;
"do you want to add a new struts action to liferay portal or override existing struts action hooks let you do just that let's consider the interfaces used for struts actions. the strutsaction interface is for regular struts actions from the portal, like the strutsportletaction interface is used for similar struts actions, but from portlets struts actions are defined as classes, and they're all connected in a a url for liferay portal running on url file links actions to specific jsp pages. performs a specific task and then returns a forward, an object containing a the forward defines what page the user goes to after the action when a user submits a form that maps to one of these actions, the action class is loaded, executed, and returns a forward a struts action hook can wrap or override existing struts actions or create a new struts path; we'll demonstrate both here. we'll override the struts actions in the url using a struts action hook to point to a custom class, then we'll create a new struts path cportalsample and first, let's override the login portlet's struts action using the example-hook we created earlier in the chapter here's the current action in your portal's url file navigate to your example-hookdocrootweb-inf folder and open insert the following code before the closing tag create a new package url in your in your new package, create a class named examplestrutsportletaction, which will wrap the login portlet struts action. create a new class named examplestrutsaction in the it will implement your new portal we've overridden the execute method of basestrutsaction, but not the executestrutsaction, method. the original struts action's execute method lps-52754 , a problem can occur when overriding struts actions with overlapping paths. overlap when one path is a substring of another path. liferay's url file shows three struts action paths. the first struts action path is a substring of each of the last two suppose you create a hook plugin to override the due to the bug mentioned above, your hook's new, custom action is triggered not only when the intended path is invoked, but also when one of the larger, containing paths e.g., documentlibraryeditfileentrydiscussion is invoked! to work around this issue, use the following steps find any struts actions with paths that contain the path of the struts if any offending paths are found, create a for them in in the class you create for each struts action, override only the processaction, render, and serveresource methods in each overridden method, simply call the original struts action's method best practice when overriding an existing struts action, it's usually best to override the method that takes the original struts action handle as a parameter and execute that original struts action. if you override the method that takes the original action handle as a parameter and don't explicitly execute it, the original action won't be executed. if you override the execute method that does not take the original action as a parameter, you are ignoring the original action and it won't be executed warning there's a classloading bug that manifests under certain conditions when executing an original struts action. fix pack for this bug, set the context classloader to the portal classloader and execute the original action in a try block. then, in a corresponding finally block, reset the classloader back to the original classloader here's an example for the temporary workaround that's it for overriding the struts actions! add portalsample to your portal's list of paths that don't require authentication by copying your existing url property assignment from your portal's url into your url file and adding portalsample to the end of the it looks similar to the assignment below your struts action hook plugin is complete! the sign in portlet, this message prints to your console when you actually log in, this message prints to your console both custom struts actions are executed via your struts action hook! try your new struts path by accessing it from your browser e.g. figure 7.6 your new struts action displays hello world! in your browser let's continue our hooks expedition by overriding a portal service.";;
"all the functionality provided by liferay is enclosed in a layer of services that are accessed by the controller layer in portlets. architecture, and it lets you change how a core portlet of liferay behaves without changing the portlet itself; you're customizing the backend services you can leverage this architecture to customize portal service behavior, and hook plugins are your tool for doing so liferay generates dummy wrapper classes for all its services. userlocalservicewrapper is created as a wrapper for userlocalservice, a service for adding, removing, and retrieving user accounts. functionality of userlocalservice from our hook, create a class that extends userlocalservicewrapper, override the methods you want to modify, and instruct liferay to use your service class instead of the original a new file called url with the following content note the wrapper class myuserlocalserviceimpl in this example will be loaded in the hook's class loader. that means it will have access to any other class included in the same war file, but not the internal classes edit url, located in the example-hookdocrootweb-inf directory, by adding the following after redeploy your hook and refresh your browser. liferay, you should see url... messages there are other liferay services that you may need to extend to meet advanced for a complete list of available services and their methods check the liferay portal 6.1 javadocs or access the javadocs for your version of liferay at now that you know how to override a portal service, let's go a bit deeper and";;
hooks let you change any of the messages displayed by liferay, to suit your to do so, create a language file for the locale of the messages you want to customize, then refer to your file from your url file. for example, to override the spanish and french message translations of portal's url file, create language files for them in the same directory, and refer to these language files in your url file, tip check the dtd of each liferay xml file you modify for the elements and attributes that can be included in the xml and the specified order for those you now know how to customize language keys.;;
now let's examine the files service builder generated for your event entity. note that the files listed under local service and remote service below are only generated for an entity that has both local-service and remote-service service builder generates services for these entities in two locations in your project. these locations use the package path that you the docrootweb-infservicecomnosesterportleteventlisting package contains utility classes and interfaces for the event listing project. classes and interfaces in the service folder are packaged in a.jar file this.jar file is generated whenever you run it's possible to place this.jar file on your application server's global classpath to make your project's services available to other this allows a portlet in different project, for example, to create, update, and delete events and locations. of course, you should consider the security implications of placing your project's service.jar file on your application server's global classpath do you really want to allow other plugins to access your project's services the docrootweb-infsrccomnosesterportleteventlisting package contains the implementation of the interfaces defined in the to the event listing project's classpath but is not available outside the event service builder generates classes and interfaces belonging to the persistence layer, service layer, and model layer in the the classes and interfaces generated for events. you won't have to customize more than three of these classes for each entity -localserviceimpl, -serviceimpl, and -modelimpl figure 4.6 service builder generates these persistence classes and interfaces. you shouldn't and won't need to customize any of these classes or interfaces local service only generated for an entity if an entity's local-service attribute is set to true in url figure 4.7 service builder generates these service classes and interfaces. only eventlocalserviceimpl allows custom methods to be added to the service layer remote service only generated for an entity if an entity's remote-service figure 4.8 service builder generates these model classes and interfaces. only eventimpl allows custom methods to be added to the service layer each file that service builder generates is assembled from an associated you can find service builder's freemarker templates in the for example, if you want to find out how a url file is generated, just look at the url of all the classes generated by service builder, only three should be manually modified eventlocalserviceimpl, eventserviceimpl and eventimpl. if you manually modify the other classes, your changes will be overwritten the next time you run service builder next, let's learn how to call core liferay services. services in your portlet is just as easy as calling your project's services that you generated via service builder.;;
you've covered a lot of ground in this chapter. your data model as entities to use in services. liferay ide's powerful editing modes to create services, relate service entities, and generate your implementation stubs. logic and re-ran service builder to generate the corresponding interfaces. found out that integrating your own sql queries in your services was easy and that model hints enable you to specify service entity data limitations and to make entity display customizations. you also briefly implemented remote services but you merely scratched the surface of this topic what better way to keep things rolling than turn our attention to your portal's overall look and feel using liferay themes!;;
you can define settings to make your theme configurable. url in the web-inf directory, with the following to define additional settings, add more elements to the file. access the settings from the theme templates using the following code let's say you want to be able to choose from two different page headers perhaps one includes more details, while the other is smaller. themes that are identical except for some changes in the header, you can create one and define a setting that lets you choose which header is displayed make sure you have a docrootdiffstemplates folder created and copy the url file into that directory. of thumb to modify files for your new theme in the diffs folder. your url template and insert the following if you're following along with this example, you'll need to create the url and url files and place them in the for this simple tutorial, you can keep these vm then, add two different entries in the url file that refer to the same theme, but have different values for the header-type alternatively, you can make your settings configurable from within liferay use configurable settings to let users turn certain theme features on or off or to allow users to provide input to a theme setting as an example, you can create an option to display a slogan next to your company's name in the footer of your site's pages insert logic into your url template to display a slogan along with your company's name e.g. nosester in the footer of your site pages note let's look more closely at two theme setting variables appearing in the display-slogan-footer variable holds a boolean value indicating whether to display the version of the footer that contains your the slogan variable holds your slogan text declare the two theme setting variables in your url, located in your theme's web-inf folder warning make sure you have an up-to-date dtd version specified for your older dtd files e.g., 6.0.0, the slogan settings are unavailable the portal administrator can enter a slogan and activate it for the portal via the look and feel section of the manage site pages panel see the creating sites and managing pages section of using liferay figure 5.5 setting the footer display slogan in the look and feel of the site's page settings when the portal administrator saves the settings, your site's pages show the new figure 5.6 the slogan displayed in the page footer note use a language properties hook to display configurable theme settings properly, like the slogan text area and footer checkbox from the previous section found in the hooks chapter of this guide next, let's customize your theme's color scheme.;;
in this chapter, you learned how to customize the look and feel of your liferay portal by creating custom themes. during this process, you created your own theme, learned about its directory structure, and discovered the value of style inheritance from a parent theme. you also learned about liferay's javascript library, alloyui, and how to make your theme configurable by adding settings that portal administrators can manage within liferay. including color schemes, and predefined settings for your theme, were discussed to round out your understanding of theme development.;;
every service provides a local interface to clients running in the same jvm as these are called by use of the - serviceutil classes. classes mask the complexity of service implementations. services that are provided as part of liferay portal were generated by the same service builder tool that we used in our project. the following jsp code snippet demonstrates how to get a list of the most recent bloggers from an organization this jsp code invokes the static method getorganizationstatsusers from the in addition to the services you create using service builder, your portlets can also access a variety of services built into liferay. for more information on these services, see the liferay portal ce javadocs at or the liferay portal ee javadocs included in the liferay portal ee documentation.zip file that you can download from the customer portal on next, you'll learn how to give liferay portal instructions, or hints, for presenting your entity models in your portlet's view.;;
"a theme without content is like an empty house. empty house, it may be difficult for prospective buyers to see its full beauty. however, staging the house with some furniture and decorations helps prospective buyers imagine what the house might look like with their belongings. resources importer application is a tool that allows a theme developer to have files and web content automatically imported into the portal when a theme is usually, the resources are imported into a site template but they can also be imported directly into a site. portal administrators can use the site or site template created by the resources importer to showcase the theme. great way for theme developers to provide a sample context that optimizes the in fact, all standalone themes that are uploaded to liferay marketplace must use the resources importer. experience for marketplace users a user can download a theme from marketplace, install it on their portal, go to sites or site templates in the control panel and immediately see their new theme in action. in this section, we discuss how to include resources with your theme liferay's welcome theme includes resources that the resources importer automatically deploys to the default site. introduced in liferay 6.1 is only applied out-of-the-box in liferay ce. welcome theme and the pages and content that it imports to the default site provide a good example of the resources importer's functionality figure 5.9 the welcome theme uses the resources importer to import pages and content to the default site of a fresh liferay if it's not already installed, you can download the resources importer application from liferay marketplace. or resources importer ee, depending on your liferay portal platform, and install and deploy the resources importer to your liferay instance the same way you would deploy any other liferay plugin or tip if you deploy a theme to your liferay portal instance and don't have the resources importer already deployed, you might see a message like this such a message appears if the resources importer is declared as a dependency in your theme's url file but is not deployed. can deploy the resources importer application to satisfy the dependency or you can remove or comment out the dependency declaration if you're not going to use the resources importer with your theme see below when you create a new theme project using the liferay plugins sdk, check your theme's url file for two entries related the resources importer. one or both of these might be commented out or missing, depending on the version of your plugins sdk the first entry, required-deployment-contextsresources-importer-web, declares your theme's dependency on the resources importer plugin. use the resources importer with your theme and don't want to deploy the resources importer, you can remove or comment out this entry. resources-importer-developer-mode-enabledtrue, is a convenience feature for with this setting enabled, if the resources are to be imported to a site template that already exists, the site template is recreated and reapplied to sites using the site template. otherwise, you have to manually delete the sites built using the resource importer's site template each time you change anything in your theme's docrootweb-infsrcresources-importer folder if you'd like to import your theme's resources directly into a site, instead of into a site template, you can specify the following in your warning if you're developing themes for liferay marketplace, don't configure your theme to import resources directly into a site. default import the resources into a site template. the resources-importer-target-class-name property. safer to deploy your theme to a production liferay instance all of the resources a theme uses with the resources importer go in the imported by your theme should be placed in the following directory structure when you create a new theme using the liferay plugins sdk liferay-plugins-sdk-6.1.1-ce-ga2-20121004092655026 or later, this folder structure is created automatically. url file is created in the web-inf folder you have two options for specifying resources to be imported with your theme. the recommended approach is to add resource files to the folders outlined above and to specify the contents of the site or site template in a url alternatively, you can use an url file to package the resources you'd like your theme to deploy. url, just export the contents of a site from liferay portal using the then place the url file in your theme's use an archive file to package all of your resources, you won't need a url file or any other files in your lar file is version-specific; it won't work on any version of liferay other than the one from which it was exported. for this reason, using a url file to specify resources is the most flexible approach. for liferay marketplace, you should use the url to specify resources the url in the docrootweb-infsrcresources-importer folder specifies the site pages, layout templates, web content, assets, and portlet configurations provided with the theme. this file describes the contents and hierarchy of the site for liferay to import as a site or site template. if you're not familiar with json, the url file is easy to understand. let's examine a sample url file the first thing you should declare in your url file is a layout template id so the target site or site template can reference the layout in the above example, this declaration is actually at the end of the file. you can also specify different layout templates to use for individual pages. you can find layout templates in your liferay installation's layouttpl folder. layouts, or pages, that your site template should use. called layouts in liferay's code. you can specify a name, title, and friendly url for a page, and you can set a page to be hidden. should be displayed on a page, simply specify an html file. portlets by specifying their portlet ids which can be found in liferay's you can also specify portlet preferences for optionally, you can create an url file in your url file defines the pages of the site or site template to be imported, along with the layout templates, portlets, and portlet preferences of these pages, the url file specifies details about the assets to be tags can be applied to any asset. abstract summaries and small images can be applied to web content articles. for example, the following url file specifies two tags for the url image, one tag for the custom url web content article, and an abstract summary and small image for the child web content url article structure now that you've learned about the directory structure for your resources, the url file for referencing your resources, and the url file for describing the assets of your resources, it's time to put resources into you can create resources from scratch andor bring in resources that you've already created in liferay. let's go over how to leverage your html basic web content, xml structures, or vm or ftl templates files from here is an outline of steps you can use in developing your theme and its docrootweb-infsrcresources-importer folder and its create a url file in your resources-importer folder. file, define the pages of the site or site template to be imported, along with the layout templates, portlets, and portlet preferences of these pages create an url file in your resources-importer folder. file, specify details of your resource assets resources-importer-web in your required-deployment-contexts property's list and set resources-importer-developer-mode-enabledtrue. resources-importer-target-value property, specify the name of the site or site template into which you are importing or comment it out to use the for the resources-importer-target-class-name property, comment it out to import to a site template or set it to url.group to import directly into a site deploy your plugin into your liferay instance view your theme, and its resources, from within liferay. portal as an administrator and check the sites or site templates section of the control panel to make sure that your resources were deployed correctly. from the control panel you can easily view your theme and its resources you can go back to any of the beginning steps in this outline to make it's just that easy to develop a theme with resources intact! to see a simple working example of the resources importer in action, visit this is just the classic liferay theme with some sample resources added. you're interested in extending the functionality of the resources-importer application, you can use the test-resources-importer-portlet to check that you aren't breaking existing functionality. the test-resources-importer-portlet is the sample resources included in the test-resources-importer-theme are the same ones included in the test-resources-importer-portlet. another example, check out the code for liferay's welcome theme note that this theme imports resources directly into the default site. typically, this won't be something you'll need to do; instead, you'll usually have your theme's resources imported into a site template. please examine the zoe themes which you can find on github here and which you can download from liferay marketplace.";;
"now that you've created your model entities and implemented your business logic to create and modify those entities, you probably have some ideas for helping for example, in the event listing project you've been working on throughout this chapter, you want users to create social events for the future, not for the past. and it would be nice to give users a nice text editor to fill in their descriptions. wouldn't it be great to specify these customizations from a single place in your portal project? service builder lets you specify this information as model hints in a single file called url in your project's liferay calls them model hints because they suggest how entities should be presented to users and can also specify the size of database columns used to store the entities model hints let you to configure how the alloyui tag library, aui, shows as liferay portal displays form fields in your application, it first checks the model hints you specified and customizes the form's input for example, if you want to limit users to selecting dates in the future, you'd set a year-range-past hint to false for it would look like the following tag let's look at the model hints file that service builder generated for the event following along in the previous sections, service builder created the url file with the following contents the root-level element is model-hints. in this are all your model entities each model element must have a name attribute specifying the fully-qualified model class name. field elements representing its model entity's columns. field element must have a name and a type. types correspond to the names and types specified for each entity's columns in service builder generates all these elements to add hints to a field, add a hint tag inside its field tag. you can add a display-width hint to specify the pixel width that should be used when displaying the field. the default pixel width is 350. string field with 50 pixels, we could nest a hint element named display-width and give it a value of 50 for 50 pixels. using the display-width hint in a field element in order to see the effect of a hint on a field, you must run service builder again and redeploy your portlet project. changing the display-width doesn't actually limit the number of characters that can be entered into the name field; it's just a way to control the width of the field in the alloyui input to configure the maximum size of a model field's database column i.e., the maximum number of characters that can be saved for the field, use the the default max-length value is 75 characters. wanted the name field to persist up to 100 characters, you'd add a remember to run service builder and redeploy your portlet project after updating so, we've mentioned a few different hints. it's about time we listed the portlet the following table describes the portlet model hints model hint values and descriptions liferay portal has its own model hints xml configuration file called url which is in liferay's portal-implclassesmeta-inf liferay's model hints configuration file contains many hint examples, so you can reference it when customizing your url file you can use the default-hints element to define a list of hints to be applied for example, adding the following element inside a model element applies a display-width of 300 to each field you can define hint-collection elements inside the model-hints root-level element to define a list of hints to be applied together. for example, liferay's url defines the you can apply a hint collection to a model field by referencing the hint like the one above in your model-hints element, you can apply it to your event model's date field by using a hint-collection element that references as always, remember to run service builder and redeploy your project after now you can use a couple of model hints in the event listing portlet and start by giving users an editor for filling since you want to apply the same hint to both the event and location entities, define it as a hint collection. reference the hint collection in them define the following hint collection just below the model-hints root element then replace the event and location description fields' entities with a reference to the hint collection, as demonstrated below the last hint is one that makes sure the user has no option to select a year replace the event entity's date field with the following date now rebuild your service using service builder, redeploy your portlet project, and add or edit an event using the portlet. the portlet displaying the input fields as we specified figure 4.9 customizing string input fields to use spacious text areas and customizing date fields to filter-out past years are just a couple examples of the many things you can do with liferay model hints well, you've learned the art of persuasion through liferay's model hints. not only can you influence how your model's input fields are displayed but also can set its database table column sizes. individual hints directly into your fields, apply a set of default hints to all of a model's fields, or define collections of hints to apply at either of those looks like you've picked up on the hints on how liferay model hints next, let's find out how to implement a remote service.";;
many default liferay services are available as web services. web services via soap and json web services. if you're running liferay locally on port 8080, visit the following url to browse liferay's default soap web to browse liferay's default json web services, visit this url these web services apis can be accessed by many different kinds of clients, including non-portlet and even non-java clients. generate similar remote services for your projects' custom entities. run service builder with the remote-service attribute set to true for an entity, all the classes, interfaces, and files required to support both soap and json web services are generated for that entity. methods that call existing services, but it's up to you to implement the methods that are exposed remotely. let's use service builder to generate remote services for the nose-ster event listing portlet example project. implement a few methods for the event listing portlet that can be called remotely via soap and json web services remember local service methods are implemented in eventlocalserviceimpl. similarly, you'll implement remote service methods in eventserviceimpl. the following methods to the eventserviceimpl class each remote service method performs security checks to determine whether the caller has permission to addupdatedelete events. and permissions system in chapter 12. to see how the event listing portlet is integrated with liferay's permissions system, browse the event listing portlet project available in the dev guide sdk at notice the calls to the eventlocalservice field's addevent, updateevent, the eventlocalservice field holds a spring bean of type eventlocalserviceimpl that's injected into eventservicebaseimpl by see eventservicebaseimpl for a complete list of the spring notice also that we modified the deleteevent method of the eventserviceimpl class passing it an event id as a parameter instead of an the method is now ready to call as a remote web service after you finish adding imports to eventserviceimpl, save the class and run liferay uses apache axis to make soap web services available. web service deployment descriptor wsdd to be generated in order to make the liferay provides a build-wsdd ant target that in liferay ide or developer studio, when viewing your url file in overview mode, there's a button in the top-right corner of the screen for calling the build wsdd target. your service's web services definition language wsdl available after you've built its wsdd and deployed your portlet project. service builder can expose your project's remote web services both via a json by default, running service builder with remote-service set to true for your entities generates a json web services api for your project. you can access your project's json-based restful services via a convenient web to view the json web services available for the event listing plugin, each entity's available operations are listed on the plugin's json web services if you've been implementing the nose-ster event listing example portlet used throughout this chapter, you'll be anxious to try out its remote you can invoke json web services directly from your browser. example, to bring up a test form for your event entity's delete-event operation, visit the above url and click on its delete-event link figure 4.10 you'll see a page displaying the name of the service method, its required parameters, its return type, possible exceptions it can throw, and a form for entering its parameters the only parameter required for the delete-event operation is an event id. since there's no ui yet for the event listing application, you probably don't have any events in your database. but if you did, you could check for an event's then you could enter the value into the eventid field in the test page's execute section and click invoke to delete liferay returns feedback from each invocation finding a portlet's web services is easy with liferay's json web service invoking a portlet's web services via liferay's json web service interface is a great way to test them. you can also examine alternate equivalent methods of calling the soap and json web services via javascript, curl, and if you'd like to learn more about how to invoke remote services from a next, we'll consider how to implement custom sql queries in your portlet, so you can easily leverage information from multiple entity types service builder can also make your project's web services available via soap after you've built your portlet project's wsdds and deployed the project as a plugin, its services are available on the portal server. easy to list your nose-ster event listing plugin's soap web services. two options you can access them in liferay ide or you can open your browser to to access your soap web services in liferay ide, right-select your portlet from under it's liferay server in the servers view. if you'd rather view your soap web services from a browser, go to the following liferay portal lists the services available for all your entities and provides clicking on the wsdl link for the event service takes you to the following url this wsdl document lists the event entity's soap web services. service's wsdl is available, any soap web service client can access it.;;
specify color schemes with a css class name, which of course also lets you choose different background images, different border colors, and more here's how you can define your color schemes in url in your diffscss folder, create a colorschemes folder and place a.css file in it for each color scheme. in the case above, we can have either one file called url, letting the default styling handle the first color scheme, or we can use both url and url to specify each scheme. the latter option here, creating both files to define our color schemes place the following lines at the bottom of your url file the color scheme css class is placed on the element, so you can use it in url, prefix all your css styles like this you can create separate thumbnail images for your color schemes. element tells liferay where to look for these images you only have to place this element in one color scheme for it to affect for our example, create the folders diffsimagescolorschemesday and diffsimagescolorschemesnight. in each folder place a url and url file, according to the specifications defined in the thumbnails let's review the predefined settings available for your theme.;;
the portal defines some settings that allow the theme to determine certain as of this writing, predefined settings are only available for portlet borders, bullet styles, and the site name, but more settings may be modify these settings from the url note to override default behavior for individual portlets, you can modify let's get on with learning about predefining settings using themes. take a look at settings for portlet borders the theme turns on portlet borders, by default. setting portlet-setup-show-borders-default to false in your theme's for example, the following setting, makes border display configurable for the portal administrator, and disables showing now that you've configured portlet borders, let's configure bullet styles liferay's navigation portlet can be configured to use any bullet styles inherited by your theme or implemented in your theme. theme uses liferay's classic theme as its base parent, you can leverage its here is the arrow bullet style's class from the you can make this bullet style, along with any bullet styles you implement, available for site administrators to use in their site's navigation portlet. just follow the naming convention as demonstrated below, substituting bullet style name, with your bullet style's name then, make the bullet-style setting configurable in your from this setting, list optional bullet styles you want available to site administrators, and set a default bullet style as your site administrators can now choose the bullet style to apply to the they select it from the site's look and feel control using css, and maybe some unobtrusive javascript, you can create a navigation menu that looks just the way you want it. next, let's take a look at how to the site name settings let site administrators decide whether to display a but, if you are using using logo, that mentions your company or site, on each site page, you may find the default site name display figure 5.7 by default, themes display the site's title on each page since the themes you create in the plugins sdk use liferay's unstyled theme as a base theme, you have the following settings available for configuring site here is how you might specify them in your url file with these settings configurable, site administrators can control site name display from the each site's look and feel control page next we'll see how liferay lets your theme inherit styling from a parent theme.;;
by default, themes are based on the styled theme, which provides only basic if you open the url file in your theme's directory using the build application configuration editor, you see the following code the url property determines the theme your theme inherits its styling in addition to the styled theme, you can choose to inherit from the unstyled theme, which contains no styling. this makes more work for you, but offers full flexibility to design your css files from scratch you can also use the default liferay theme classic as a parent theme. start with a look and feel that's already smooth and works well. much is already done for you, there's less flexibility when building your it's a compromise between creating a theme as quickly as possible versus having full control of the result. it's your choice, and another example of the want to learn how to import resources with your theme?;;
for liferay plugins, you can create a new plugin that extends an existing one. by extending a plugin, you can use all its features in your new plugin while keeping your changesextensions separate from the existing plugin's source code to create a plugin which extends another, follow these steps create a new empty plugin in the plugins sdk remove all the auto-generated files except url and the docroot copy the original war file of the plugin you'd like to extend for example, url to the root folder of your add the following line to your url inside of the tag to reference the original war file you are going to extend copy any files from the original plugin that you're overwriting to your new plugin using the same folder structure and run the ant target merge. please note that the merge target is called whenever the plugin is all you have to do is to check the ant output if the plugin that you're extending contains a service, you need to url file contains a hard-coded project for you need to change this to the name of your plugin this generates a plugin you can find the war file in the dist folder of your plugins sdk which combines the original one with your changes in summary, if localization is important for your portlets, always consider statements in a localization plan, since some portlets in your plugin and hard customer requests can make a mess in your localization files and keys. possible, reuse liferay core language keys since they're already translated for if there's no key you can use, you can create your own, as described in this liferay gives you the tools to make localization possible, and uses a web service to provide rudimentary translations.;;
you've covered a lot of ground learning liferay portlet development. a portlet project, studied its anatomy, and created the my greeting portlet. you understood the action phase and render phase, and have have passed information between them in a portlet. you've enhanced a portlet with multiple actions and have mapped a friendly url to it. lastly, you've found how easy it is to start localizing your portlets. now that you know how to create portlets, you'll need to consider a few things, such as persisting your objects to a database, maintaining separatation between your persistence layer, business logic, and presentation layer, and allowing for lastly, you'll want the ability to publish your portlet's operations as services. so how do you address all of this? probably comes to mind for persisting your data model, and spring probably comes to mind with regards to supporting implementation flexibility. liferay's service builder helps you build portlet services while hiding the complexities of using spring and hibernate we'll cover service builder next.;;
right now our portlet only has two views the default view and edit view. more views is easy, and you can link to them using the mvcpath parameter in action, like sending an email to the user you can have as many actions as you want in a portlet. method that receives two parameters an actionrequest and an actionresponse. name the method whatever you want, but note that the method name must match the let's rewrite the example from the previous section using a custom name for the action method that sets the greeting, and add a second action method for sending we no longer need to invoke the processaction method of the super class, since this name change also requires a simple change in the url so its name matches the method that is invoked to execute the action. actionurl so it looks like this now you know all the basics of portlet development, and can use your java knowledge to build portlets that get integrated in liferay. finishing touches on your portlet by first learning about an extension to liferay's portlet specification that generates more elegant urls for your;;
"service builder's finder methods facilitate searching for entities by their attributestheir column values. add the column as a parameter for the finder in your url file, run service builder, and it generates the finder method in your persistence layer and adds methods to your service layer that invoke the but what if you'd like to do more complicated searches that incorporate attributes from multiple entities for example, consider the nose-ster event listing portlet you've been developing suppose you want to find an event based on its name, description, and location name. if you recall, the event entity refers to its location by the location's id, not its name. that is, the event entity table, eventevent, refers to an event's location by its long integer id in the but you need to access the name of the event's of course, with sql you can join the event and location tables to but how would you incorporate custom sql into your and how would you invoke the sql from your service? lets you do this by specifying the sql as liferay custom sql and invoking it in your service via a custom finder method liferay custom sql is a service builder-supported method for performing complex and custom queries against the database. invoking custom sql from a finder method in your persistence layer is straightforward. you generate the interfaces to your finder method. access your finder method from your service next, you'll do exactly this to create and invoke custom sql in your event after you've tested your sql, you must specify it in a particular file for liferay's customsqlutil class looks up custom sql from a file called url in your portlet project's folder and create the url file in that custom-sql folder the url file must adhere to the following format you can add a custom-sql element for every custom sql query you'd like for your portlet, as long as each query has a unique id. using for the id value is the fully-qualified class name of the finder followed by a dot . character and the name of the finder method. finder class and finder methods is in step 2 for this example, you'll use the following id value for the query custom sql must be wrapped in character data cdata for the sql importantly, the sql must not be terminated with a semi-colon following these rules, specify the custom sql for this query by replacing the contents of the url file with the following code make sure to delete the backslash character from the end of the id so that the finder method name findbyeventnameeventdescriptionlocationname immediately follows the package path specified below now that you've specified some custom sql, the next step is to implement the the method name for the finder should match the id you just it's time to implement the finder method to invoke the custom sql query. should be done in the service's persistence layer, since it's sql invoked on a you'll rely on service builder to generate the interface but before you do that, you need to create the implementation of the the first step is to create a -finderimpl class in the service persistence create a class called eventfinderimpl in the the class extend basepersistenceimpl. should now have the following contents run service builder to generate the -finder interface and the -util class service builder generates the eventfinder interface and the eventfinderutil utility class based on the eventfinderimpl class. your eventfinderimpl class to have it implement the eventfinder interface now you can create our finder method in your eventfinderimpl class. the following finder method and static field to the eventfinderimpl class remember to import the required classes. the custom finder method opens a new hibernate session and uses liferay's url id method to get the custom sql to use for the the findbyeventnameeventdescriptonlocationname static field contains the custom sql query's id. findbyeventnameeventdescriptonlocationname string is based on the fully-qualified class name of the -finder interface eventfinder and the name of the finder method findbyeventnameeventdescriptionlocationname custom sql is in place and your finder method is implemented. you'll call the finder method from your service so far, you created a -finderimpl class and generated a -finderutil however, your portlet class should not use the finder utility class directly; only a local or remote service implementation i.e., -localserviceimpl or -serviceimpl in your plugin project should invoke the this encourages a proper separation of concerns the portlet classes invoke business logic of the services and the services in turn access the data model using the persistence layer's finder classes. add a method in the -localserviceimpl class that invokes the finder method implementation via the -finderutil class. then you'll provide the portlet and jsps access to this service method by rebuilding the service add the following method to the eventlocalserviceimpl class after you've added this method, run service builder to generate the interface and make this finder method available in the eventlocalserviceutil class now you can indirectly call the finder method from your portlet class or from a congratulations on following the 3 step process in developing a custom sql query and custom finder for your portlet! next you'll tour through the url file that service builder";;
service builder generates a url file in your project's liferay portal uses the properties in this file to alter your service's database schema and load spring configuration files to support deployment of your service. you should not modify this file, but rather make any necessary overrides in a url file in that same here are some of the properties included in the url file it's sometimes useful to override the url property from url file prevents liferay from trying automatically to apply any changes to the database model when a new version of the plugin is this is needed in projects in which it is preferred to manually manage the changes to the database or in which the sql schema has intentionally been modified manually after generation by service builder.;;
when you click the edit greeting link, you're taken to a page with a url that since liferay 6, there's a built-in feature that can easily change the ugly url the feature is called friendly url mapping. it takes unnecessary parameters out of the url and allows you to place the important parameters in the url path, rather than in the query string. to add this functionality, first edit url and add the following lines directly after and before remove the line breaks next, create the file remove the line break place the following content into the new file remove the line break after redeploy your portlet, refresh the page, and try clicking either of the links figure 3.9 friendly url for view jsp notice how much shorter and more user-friendly the url is, without even having figure 3.10 friendly url for edit jsp for more information on friendly url mapping, there's a detailed discussion in explore localization of the portlet's user interface.;;
if your portlets target an international audience, you can localize the user localizing your portlet's language is done using language keys for each language you wish to support. you can translate these manually or use a web service to translate them for you. conveniently, all existing translated messages in the portal core are accessible from plugin projects. for the presence of specific language keys in the core url file found in portal-implsrccontent. leveraging portal's core language keys saves you time, since these keys always have up to date translations for additionally, your portlet blends better into liferay's ui you can use a language key in your jsp via a tag you specify the message key corresponding to the language key in the url file you want to display. in their language, specify the message key named welcome this key maps to the of the word welcome, in your translation of it to the here is the welcome language key from liferay's let's add the welcome language key in front of our greeting in the url file of the my-greeting-portlet we created earlier. current greeting paragraph with this revisit the page to see the word welcome, from url, now note, in order to use the tag, or any of the liferay-ui tags, you must include the following line in your jsp. the tag also supports passing strings as arguments to for example, the welcome-x key expects one argument. welcome-x key from the url file it references 0, which denotes the first argument of the argument list. arbitrary number of arguments can be passed in via message tag, but only those arguments expected by the language key are used. the arguments are referenced in order as 0, 1, etc. let's pass in the user's screen name as an argument to the welcome-x language key in the my greeting portlet add the following lines near the top of the jsp, just above the the first line imports the liferay-theme the second line defines the library's objects, providing access to the user object holding the user's screen name replace the current welcome message tag and exclamation point,!, in the jsp with the following when you refesh your page, your my greeting portlet greets you by your screen figure 3.11 by passing the user's screen name as an argument to liferay's welcome-x language key, we were able to display a personalized greeting other message tags you'll want to use are the and positive feedback, marked up in a pleasant green background. tag helps you warn your users of invalid input or the error messages are marked up in an appropriate red the tag is triggered when its key value is found in the the success message by adding its key to the sessionmessages object with the following call similarly, the tag is triggered when its key value is found in the sessionerrors object. likewise, in our mygreetingportlet class, we triggered the error message by adding its key to the sessionerrors object with the following call that's all you need to do to leverage liferay's core localization keys. need to add localization keys, follow the instructions below to deliver locally tailored portlets to your customers first consider some questions that will make our life easier as we develop your we'll cover these different cases in the following sections first, let's create a resource bundle for providing textual translations of three related fictional portlets named my finances, asset ticker and portfolio all three portlets share some attributes let's explore sharing translated text between these portlets assuming you already created a plugin project and added portlets, let's create a content package in your src plugin project folder create the url file to define all the keys our portlets for each portlet, update its node in url to refer to make sure to put each resource-bundle element in its proper place in the at this point our portlets are ready to deliver a localized ui please note it's best to use the liferay naming convention for language bundles so your portlets can share properties, and the plugins sdk ant task used to build the translations works in order for a user to see a message in his own locale, the message value must be specified in a resource bundle file with a name ending in his locale's two for example, a resource bundle file named url containing a message property with key welcome must be present with a spanish translation of the word welcome. sdk provides a means for you to get translations for your default resource the plugins sdk uses the bing translator service translate all of the resources in your url file to multiple it provides a base translation for you to start with. translations using the bing translator service, you'll need to do the following signup for an azure marketplace account and register your application. sure to write down your id and secret given to you for your application edit the url file in your liferay home directory by adding the following two lines replaced with your values in developer studio, right-click on the url file if prompted, choose the option to force eclipse to accept the make sure you are connected to the when the build completes, you'll find the generated files with all of the translations, in the same folder as your url file note if you're mavenizing your portlet, make sure to copy your content folder into your portlet's srcmainwebappweb-infclasses folder by using studio's language building capability, you can keep all created translations synchronized with your default url. it any time during development. it significantly reduces the time spent on the of course, you'll want to have someone fluent in that language review the translation before deploying the translation to a now that you know how to create a shared resource bundle, let's consider a case in which you must use separate resource bundles for each portlet. localize messages used in the control panel for a control panel-enabled portlet, we'll show you how to implement them you may have noticed that your control panel-enabled portlets are missing that super-fancy must-have portlet title and description in the control panel. make your portlet look cool within the control panel, create specially tailored description and title keys in separate url files for each for demonstration purposes, let's consider a project that has one portlet named eventlisting and another portlet named locationlisting. a resource bundle for each of them to specify their localized title and note if your project only has one portlet, it's best to put your resource bundle directly in the content folder. url lets you leverage the plugins sdk's language building capabilities, via right-clicking on the url file liferay build languages in developer studio or executing ant build-lang from the terminal here's what you'd do to localize the title and description for each portlet in if you haven't done so already, configure each portlet to display in the for our example, we would display them in the content portion and give them an arbitrary weight value for determining where they're to be placed in the column with respect to the other portlets. here's a sample of how to specify this in our project's create a namespaced folder to hold each portlet's resource bundle. best practice to name each resource bundle folder based on the name of its for example, you could create a resource bundler folder contenteventlisting for the eventlisting portlet and a folder contentlocationlisting for the locationlisting portlet create a url file in the resource bundle folders you just language keyvalues in each of these url files the eventlisting portlet could have the following keyvalue pairs in its url file and the locationlisting portlet could have these keyvalue pairs specify the resource bundles for the portlets in the project's url the example url file code snippet below demonstrates specifying the resource bundles for the eventlisting and locationlisting go to the control panel and select the event locations portlet add en to your portal context in your url to interface with the portal in for example, your url would start like this portal's control panel displays your portlet's localized title and description figure 3.12 it's easy to localize titles and descriptions for multiple portlets in your project you're becoming an expert localizer! tip do you know how your portlet title is processed? doesn't define a resource bundle or url, the portal container next checks the and inner node in the if they're missing too, the node value is rendered as portlet title note be aware that using struts portlet and referring to a strutsresource bundle in your url engages a different title and description titles and long titles are pulled using two different keys now that you're comfortable localizing portlet content, you may want to learn how to make translations available throughout the portal or how to override an for instructions on doing that, refer to chapter 7 of this guide, specifically the overriding a url file section. describes how to use a hook to override existing liferay translations. share your keys with other portlets, as well as override existing liferay next, let's learn how to configure your portlets' preferences using;;
"portlet preferences are properties for storing basic portlet configuration data. preferences are often used by administrators to provide customized views of a portlet to subsets of users or even all of a portlet's users. preferences are sometimes made accessible to users themselves for configuring a portlet just the way they like it. configurable in your portlet's jsps. in this section, we'll show you how to create a default configuration jsp page and add a portlet preferences control to we'll use the location listing portlet we developed in the generating your we'll create a configuration page and add a custom option to it, allowing administrators to hide the address portion of the locations. into portlet preferences by running through an example of creating a configuration page for the location listing portlet and setting up a new portlet first, if your location listing portlet doesn't already have a setup tab in its configuration page, you'll need to follow the steps below to create one. check to see whether your portlet has a setup tab, click the portlet's options icon in the upper right corner and select configuration. setup tab, you can skip the next section. otherwise we'll show you how to create the default setup tab for your portlet's configuration page open the url file and add the element to show you where it goes in the context of your url file notice that we've listed the default configuration action class. this tag with a custom configuration class later in the exercise. redeploy your portlet and open your portlet's configuration page, you'll find but we'll add a portlet preference figure 3.13 simply by specifying liferay's default configuration action class in your portlet's url file, you provide your portlet with a setup tab for adding your portlet's configuration setup options in order to add a configurable portlet preference to the portlet, we must do the let's specify a configuration jsp file, first your portlet will need a way to display configuration options to the user. liferay checks to see if your portlet specifies a configuration jsp via a specify one for the location listing portlet open the url file and insert the following lines after the location we'll create a configuration jsp file and add javascript to let the user select for our example, we'll provide a custom option in the configuration page's setup tab, allowing administrators to show or hide in the docroothtmllocationlisting directory, create a file named url, if you don't have one already now let's begin creating our portlet preference for the configuration page's assuming that you began with a blank url file, the showlocationaddresscfg variable holds the current value of whether to show the location addresses or not. the input checkbox lets the user set the value of the showlocationaddress portlet preference key. value to be persisted, the input must follow the naming convention for our example, the input name preferences--showlocationaddress-- maps the input value to a portlet preference key named showlocationaddress you've probably noticed some jsp compile errors and warnings with respect to the we'll address them by adding directives to the url that adding the directives will allow the jsp to access the classes and taglibs we're using in your url file, add the following directives the tablib directives access the jsp standard tag library jstl, liferay's theme taglib, and liferay's portlet taglib. importing the classes we're using. tag to access implicit variables that we'll need. provides useful portlet variables such as renderrequest, portletconfig, and your url is all set to display your portlet preference options. let's implement a custom class to handle the configuration action now let's create a custom configuration action class for accessing the portlet create a package named url in the in the new package, create a class named configurationactionimpl, and specify replace the contents of url with the following code notice we've extended the defaultconfigurationaction class and added a new the super-class's processaction method is responsible for reading the portlet preferences from the configuration form and usually, you'd add appropriate validation logic for the parameters received from the form. demonstrates accessing the preferences from the action request another common method to include in a custom configuration action class is a the render method is invoked when the user clicks the for this example, we'll stick with the original render method from the defaultconfigurationaction class we're extending note you won't need to store portlet preferences by calling url since they're automatically stored in the defaultconfigurationaction class, which your configuration class extends lastly, let's specify our new custom configuration class in the here's a snippet to show you where it goes in the context of the since your configuration action implementation is ready to process your portlet preference, let's update the view jsp to respond to the portlet preference let's add logic in our url to showhide the location addresses based on the value of our portlet preference key showlocationaddress in the url file, we'll get the value of the showlocationaddress portlet if its value is true, we'll display all of the location fields, including the address fields; otherwise, we'll hide the address fields below are the contents of the entire url file. that handles the portlet preference, after this code listing let's breakdown the above code. we start by getting the value of the showlocationaddress portlet preference key and assigning it to a boolean variable showlocationaddressview if no showlocationaddress key is found, the value will default to true based on the stringpool.true default value we pass to the method then, we wrap the street address, city, state, and country column text elements in a conditional code block using... tags if showlocationaddressview is true, all of the location's fields are if it is false, then the address fields are omitted you've created a custom configuration page and added a portlet let's see the configuration page and portlet navigate to your location listing portlet's you now have the show-location-address checkbox figure 3.14 your new portlet preference is available in the configuration page each time you click save after modifying the show-location-address checkbox, configurationactionimpl class prints out the value of the by unchecking the checkbox, the location addresses are hidden from view in the figure 3.15 liferay portal makes it easy to customize a portlet ui. privileged users can adjust the preference settings within the portlet's configuration page now you know how to use liferay's portlet preferences in the portlets next, let's use the plugins sdk to create a plugin that extends another plugin.";;
to see a very simple example of the script console in action, log into the portal as an administrator and navigate to the control panel server change the script type to groovy and replace the code in the scripting console with the following click the execute button and check the scripting console or the log for the now let's implement a more realistic example. information from the database, make some changes and then update the database our company has updated the terms of use and requires that everyone be presented with the updated terms of use on the next log in. users agree to the terms of use, a boolean attribute called agreedtotermsofuse as long as the boolean is true, liferay will not present the user with the terms of use. however, if we set this flag to false for everyone, all users will have to agree to it again to use the site we'll again use groovy, so ensure that the script type is set to groovy and execute the following code to check the status of the agreedtotermsofuse the code above just prints the value of the agreedtotermsofuse attribute for next, we'll actually update each user in the system to set his or her agreedtotermsofuse attribute to false. we'll be sure to skip the default user as the default user is not required to agree to the terms of use. also skip the admin user that's currently logged in and running the script. you're logged in as someone other than email, be sure to update the following script before running it to verify the script has updated the records, run the first script again and you should see that all users except the default user and your user have been that's all that's needed to run scripts and to access the liferay service layer. there are, however, some things to keep in mind when working with the script when using local services, no permissions checking is enforced scripts are executed synchronously, so be careful with scripts that might take for these reasons, you should use the script console with care. test run your scripts on non-production systems before running them on of course, liferay's script engine has uses beyond the script let's learn how to leverage liferay's script engine for designing;;
liferay's kaleo workflow engine provides a robust system for reviewing and approving content in an enterprise environment. custom scripts, it's a powerful and robust workflow solution. scripts takes it to the next level examine the default single approver workflow definition included with kaleo for an overview of how the feature works. the final step in the workflow runs a script that makes content available for use. below, it uses javascript to access the java class associated with the workflow to set the status of the content to approved at virtually any point in a workflow, you can use liferay's scripting engine to access workflow apis or other apis outside of workflow. different ways you could use this. of course, before you try any of this, you need to know the appropriate syntax for inserting a script into a workflow. in an xml workflow definition, a script can be used in any xml type that can contain an actions tag those types are,, and. inside of one of those types, format here's an example of a workflow script created in groovy. to be used with a condition statement in kaleo. framework to determine the category of an asset in the workflow. the category to automatically determine the correct approval process. category legal has been applied to the asset, the asset is sent to the legal review task upon submission. otherwise, the asset is sent to the default review task within a workflow, the next task or state is chosen based on the return value. for a complete example a workflow script that uses the above groovy script, please see the url file in the user guide's code folder the combination of liferay's scripting and workflow engines is incredibly however, since it provides users with the ability to execute code, it when configuring your permissions, be aware of the potential consequences of poorly, or maliciously, written scripts inside of a workflow for more information on creating workflow definitions with kaleo;;
in this chapter, we saw how liferay's script engine opens up many exciting possibilities for working with liferay. you can write and execute scripts from liferay's script console in the control panel using in a variety of languages including beanshell, javascript, groovy, python, and ruby. can leverage liferay's services oriented architecture soa from any of the popular scripting languages that liferay supports. could be used to simplify administrative tasks by leveraging the script console. next, we discovered how you could enhance workflow by using the power of lastly, we saw how you could overcome some of the limitations of running scripts in liferay by creating custom java utilities that could be executed from within your scripts as you can see, liferay's script engine opens up many exciting possibilities for working with liferay regardless of your language of choice.;;
note the following lcs features have been deprecated and removed in march 2020 page analytics, fix pack management, and portal properties. to learn more about how you can prepare for these upcoming changes liferay connected services lcs is a set of online tools and services that lets you manage and monitor your liferay portal instances. fix packs, monitor your instances' performance, activate your instances, and help you manage your liferay portal subscriptions. butler for the mansion that is liferay portal. even better, the features of lcs work regardless of whether your instance is on a single discreet server or it's like having a single butler that can serve you can find more information about lcs on its before going any further, you should make sure that your liferay portal instances meet the requirements for lcsyou must be running liferay portal 6.2 also, you should take note of a few key terms used throughout this guide as you go through this guide, you'll cover the following sections on lcs you'll get started with the configuration steps required to use lcs with liferay;;
note the following lcs features have been deprecated and removed in march 2020 page analytics, fix pack management, and portal properties. to learn more about how you can prepare for these upcoming changes to take full advantage of liferay connected services lcs, you must first before doing so, however, there are a few things the sections in this guide walk you through these steps in this guide shows you how to upgrade the lcs client app once your server is we highly recommend that you upgrade the app whenever liferay first, you'll download the lcs client app to connect to lcs, you must first purchase and download the latest version of the lcs client app for liferay portal 6.2 ee. note even though liferay marketplace and this guide use the term purchase, the lcs client app is free of charge. free app in liferay marketplace adds the app to your liferay project, much like downloading a free app in a mobile app store adds the app to your account use these steps to purchase and download the app if you've already purchased the app, you can skip to step 3 to download it the lcs client app in liferay marketplace. sign in to marketplace, then click the the lcs client app's free button figure 4.1 click the app's free button to begin the purchase process select the project you want to associate the app with, accept the license agreement, and then click the purchase button. figure 4.2 liferay marketplace displays your receipt for the lcs client app on the receipt, click see purchased. this takes you to the page where you can download the lcs client app. to download the app, click the app button next to the version of the app you want to download note if you need to download the lcs client app later, such as when select purchased apps from the user menu at the top-right of liferay on the purchased apps screen, select the project you associated with the lcs client app and then select the app. downloads page shown in the screenshot figure 4.3 click the app button next to the version of the app you want to download you've successfully downloaded the lcs client app. however, there are a few additional preconfiguration steps you should complete. the following sections of this guide walk you through these, and then show you note if your server connects to the internet through a proxy, you must configure either your server or the lcs client app before deploying the app. the following section contains instructions on this. connect through a proxy, you can skip this section if your server connects to the internet through a proxy, you must set some properties in either your server or the lcs client app before deploying the there are therefore two ways to set these properties, depending on whether you set them in your server or the lcs client app set these properties to the appropriate values note that the user, password, and properties are only needed if your note if you use jvm app server arguments as instructed in this step, then you don't need to preconfigure the lcs client app to connect through to set the properties inside the lcs client app's war file, you must first extract it from the app's lpkg file the app downloads from liferay expand the lpkg file, then locate and expand the client's war file lcs-portlet-version.war you must set the properties in the war's url file. in the lcs client's war file, create the file add the following properties at the end of url and set them to the appropriate values for your proxy if your proxy requires authentication, you should also add the following properties and set them to the appropriate values for your proxy if your proxy requires ntlm authentication, you must also add the be sure to set url and url to the appropriate note that you can leave url blank repackage the lcs client war with the modified url file, then repackage the lpkg file with the lcs client war. repackaged lpkg file has the same name as the original lpkg file downloaded from liferay marketplace next, you'll learn how to ensure that the lcs client can access lcs for the lcs client app to work, it must be able to access the following dns if your server is behind a proxy andor a firewall, then you must open as an added security measure, you can also restrict traffic to the next section discusses ntp server synchronization for lcs to work properly, the application server running liferay portal should be synchronized with a time server. if it's not, you may get log errors similar for information on how to synchronize your application server with a time server, see your application server's documentation next, you'll learn how to configure liferay portal's patching tool lcs uses liferay portal's patching tool to apply updates. ee bundles, the patching tool is pre-installed. if you're not running a bundle, once installed, there are a few steps you must complete before lcs can use the note that the commands below apply to linux, unix, and mac. you're running windows, drop the.sh from each command that has it navigate to the patching-tool directory on the command line. liferay home is usually the parent folder of the application to let the patching tool discover your liferay portal installation, run this to configure the patching tool, run this command on server startup, the patching tool agent installs the patches downloaded for the agent to start with your server, you must set the javaagent property in the jvm options to point to your patching tool if your patching tool is installed in a location other than the liferay home folder, you must also specify the patching-tool folder's path as an app do this with the url property there are also a few other things to consider when using the agent. loading issues, the agent starts in a separate jvm. you may also experience issues on windows if the user starting the app server doesn't have administrator privileges. here are some examples of the errors you to solve this, set the url system property as follows in the the agent also has some flags you can set to control how it behaves you can specify these as follows once you've addressed the above preconfiguration steps, you're ready to install follow these steps to install the app shut down your liferay portal instance if it's running place the lcs client app in the liferayhomedeploy folder create this deploy folder if it doesn't exist. is usually the parent folder of the application server's folder now you're all set to connect your liferay portal instance with lcs. the next section shows you how to upgrade the lcs client app. recommend that you do this whenever liferay releases a new version of the app your server should always be running the latest version of the lcs client app. there are two ways to upgrade the app, depending on the exact lcs this method if you don't need to configure the lcs client app e.g., to connect through a proxy before it deploys note if you choose this method and have a clustered environment, you must perform the upgrade separately on each node in your cluster. you may prefer to upgrade manually as detailed in step 2 to ensure that all your nodes are running the exact same version of the lcs client app to perform the upgrade, first navigate to admin control panel apps needing an update are listed first. click update next to the lcs client app. note that you may need to restart your server for the upgrade to complete manually, after downloading the lcs client app's lpkg file to your machine. use this method if you need to preconfigure the lcs client app to connect note if you used jvm app server arguments to configure your server to connect through a proxy, then you don't need to preconfigure the lcs client app to connect through the same proxy to update the lcs client app manually, follow the previous sections in this guide for downloading and preconfiguring the app. liferay homedeploy as you would any other app contact liferay support if you need additional assistance with the upgrade;;
note the following lcs features have been deprecated and removed in march 2020 page analytics, fix pack management, and portal properties. to learn more about how you can prepare for these upcoming changes follow these steps to connect your liferay portal server to lcs ensure that you've completed the this takes you to your company's lcs project. projects, select the one you want to register this server under from the menu to the right of the dashboard tab figure 4.4 select your lcs project from the menu highlighted by the red box in this screenshot select or create the environment to connect your server to. activating your server with lcs, your server will consume an activation key from the subscription type assigned to the environment. subscription type can only be assigned to an environment when creating the if you have sufficient permissions in your company's project, figure 4.5 to connect to lcs, you must register your liferay portal server in an lcs environment. the red box in this screenshot highlights environments select the environment's registration tab. which you'll use to connect servers to the environment in the registration tab's services section, change the lcs service note that if you change the lcs service selections and there are servers already connected to the environment, then you must regenerate the token file and use it to reconnect those servers to lcs. you'll regenerate andor download the token in the next step the selected services are enabled for all servers that connect to this portal analytics, fix pack management, and portal property analysis are selected by default. if portal property analysis is selected, you can prevent lcs from analyzing specific properties. box that appears when you select show blacklisted properties. lcs doesn't access security sensitive properties figure 1 an environment's registration tab lets you manage the token file used to connect your server to the environment what you do now depends on what you did in the previous step place the token file in your server's liferay homedata folder. is usually the parent folder of the application server's folder. server is running, it should connect to lcs in about 1 minute. server isn't running, it connects to lcs on startup. if you're activating your server with lcs, your server consumes an activation key from the environment's subscription type. you should see this in your lcs project's subscriptions tab your liferay portal server is connected to lcs note you may be wondering what happens if lcs goes offline. this won't cause a rift in the space-time continuum. cloud infrastructure set up for automatic failure recovery. in the event of an outage, however, registered servers maintain a local copy of their uptime information to transmit to lcs if you're using lcs for activation, active subscriptions have a 30-day grace period to re-establish connectivity and remain this is ample time for lcs to come back online. outage occur, liferay support can provide activation keys that don't require in your liferay portal instance, you can view your lcs connection status in the access the client by clicking control panel apps here's a full description of what a connected lcs client app displays figure 4.6 the server is connected to lcs the next article shows you how to do this.;;
note the following lcs features have been deprecated and removed in march 2020 page analytics, fix pack management, and portal properties. to learn more about how you can prepare for these upcoming changes once your liferay portal server is connected to lcs, you can get down to the business that lcs is designed formanaging and monitoring your servers. you're not already there, log in with your account on this is where you'll apply updates, view server metrics, manage environments, this article's following sections each detail one or more of the features what lcs stores about your liferay portal servers for lcs to work, the lcs servers must store certain information about your sensitive data, however, isn't stored on the lcs servers. section describes the data that lcs does and doesn't store managing lcs users in your project learn how to manage your lcs project's users by assigning them roles learn how to manage projects, environments, and servers in lcs. includes applying fix packs, monitoring server status, viewing server lcs displays web notifications that you can view by clicking the bell icon next to the user menu in the dockbar. learn how to manage your lcs account. this includes configuring lcs to send you notification emails when specific events occur in your lcs projects, and learn how to view and manage your liferay ee subscriptions for the servers learn about the environment tokens that you use to connect your servers to at this point, you might be wondering what information about your servers is only stores system-specific data. lcs doesn't gather or store data on your to offer the best service possible, lcs stores the following information sensitive data is any key-value pair that contains usernames or passwords. example, lcs doesn't store the following properties because they contain lcs also doesn't store properties that end in.password, besides the following lcs also lets you prevent it from analyzing specific properties of your for more information on this, see the section on using environment tokens now that you know what information is stored on the lcs servers, you're ready to learn how to manage your lcs projects. this includes renaming projects and requesting membership to projects you don't administer. manage the users in your lcs project and assign them to the correct lcs roles the users section of lcs is where you manage the lcs users that are part of your it's here that you can grant or revoke lcs roles. first click the users tab just below the dashboard tab on the upper-left of note you can't add users to your project via the lcs ui or the lcs client to add users to your project, you must contact liferay support figure 4.7 the users tab lets you manage the lcs users in your project the users tab displays a list of the users in your project. each user's name, email, image, lcs roles, and a manage roles button. user must have an assigned role. the following roles are available you should note that each of these lcs roles assume that the user already has the lcs user role in their url account. automatically the first time the user enters their lcs account. can be performed by each of the lcs roles are detailed in the below permissions now that you know what roles are available in an lcs project, and what they do, you're ready to learn how to manage them follow these steps to manage a user's lcs roles click the user's manage roles button to revoke a role, click revoke role for that role to assign a role, choose the role and environment, if applicable and click note a user can't have an environment role e.g., lcs environment manager, lcs environment viewer and the lcs administrator role at the same time figure 4.8 you can assign or revoke a user's lcs roles now you know how to manage users and roles in your lcs projects. time to get to the heart of lcs the dashboard the lcs dashboard lets you view and manage a project's environments and servers. if you're not already at the dashboard, click it near the upper left-hand corner clicking dashboard takes you to the project view. there, you can get to the environment view and the server view. views gives you a different look into certain aspects of your lcs project. you'll start with the project view you can get to the project view at any time by clicking the dashboard tab near the upper left-hand corner of your lcs site. the project is listed to the right of this tab, with a drop-down arrow that lets you switch between projects if you you can also switch between projects from the user menu at the project view contains a status table that lists any status messages for each server in your project. message appears for a server when the server is offline. appear for servers when fix packs are available, monitoring is unavailable, the patching tool is unavailable, or other events occur that relate to lcs figure 4.9 the lcs project view shows an overview of your lcs project lcs lists the environments in your project on the left side of the screen. can also create new environments here by clicking the add environment tab to view an environment's settings, click the you can also get more information about a specific this takes you to the environment view. that each environment's icon indicates the environment's type and status now you'll learn how to create an environment you can create an environment by clicking the add environment tab from the this opens the new environment popup note when creating an environment, make your selections carefully for the subscription type, cluster, and elastic fields. complete these fields to create your environment when you're finished with your selections, click create environment figure 4.10 the new environment popup next, you'll learn how to manage your environments clicking an environment on the left-hand side of the project view takes you to the environment view lets you manage an environment in the ui is segmented into three tabs fix packs lets you view and apply fix packs for the environment's this tab only appears if a server is registered in the environment. a table displays the following information for each fix pack once a fix pack downloads, lcs prompts you to restart your server, which installs any downloaded fix packs. note that you must start your server with the privileges required to write to the disk location where patches are stored and processed the patching-tool folder. packs across a cluster, follow the same procedure. installs fix packs simultaneously across all nodesyou don't have to handle registration lets you generate and download that connect your servers to lcs environment settings lets you change the environment's name, location, you can also see if the environment allows clustered servers, and view the environment's subscription type. button to save any changes you make in the environment settings tab. also delete the environment by clicking delete environment figure 4.11 the lcs environment view shows an overview of an lcs environment regardless of the tab you're in, the left side of the screen displays a list of to view a server's settings, click the server's gear clicking on a server takes you to its server view the server view provides detailed information about a server, including statistics and performance metrics. to protect your users' privacy, lcs doesn't gather, store, or analyze user data. you can get to the server view by clicking a server in the environment view, or by clicking a server in the fix packs or server view is segmented into six tabs note lcs doesn't support snapshot metrics for servers running on jboss or in this scenario, you may see a console message indicating that lcs doesn't support server metrics for your application server. benign nullpointerexception for the lcs taskschedulerserviceimpl and page analytics is displayed by default when you enter server view. analytics shows page views and load times for the selected site and time period. by default, all sites are selected. you can select a specific site from the you can also select a different time period in the the arrows next to the ending at field move the selected time period up or down, respectively, by one period. if you select one hour in the period field, then pressing the right arrow next to ending at moves the selected time period up by one hour. the beginning of the current time period, it can take up to 15 minutes for data also note that data is available for three months from the by default, load times and page views for all pages are plotted against time in below these graphs, a table displays summary statistics of these data over the same time period, for each page. table, the graphs change to plot the data for just that page. find the page you're looking for, you can search for it in the search box at to plot data for all pages again, click the all pages load times are also color coded to indicate speed. background is red for values above 3,000 ms, orange for values from 2,000 to 3,000 ms, and green for values less than 2,000 ms. all load times greater than 3,000 ms in red text figure 4.12 the page analytics interface in the lcs server view to view other metrics and statistics of your server's performance, click the snapshot metrics tab near the top of the page. into three main categories application, jvm, and server. selected by default when you click the snapshot metrics button the application category also has three other categories pages, portlets, pages lists the frequency that specific pages load, along with portlets lists the same statistics, but for specific the cache category lists liferay single vm metrics and the following screenshot shows the statistics in the portlets figure 4.13 the lcs application metrics show portlet performance statistics, like frequency of use and average load time the jvm category, as its name indicates, shows statistics about the jvm running this includes data on the garbage collector and memory. number of runs, total time, and average time are listed for each garbage the memory metrics are presented in a bar chart that shows the usage of the ps survivor space, ps old gen, ps eden space, code cache, and ps figure 4.14 the lcs jvm metrics show performance data for memory and the garbage collector server is the third category in snapshot metrics. additional information about how your server is running. horizontal bar graph shows the number of current threads running on your server. similarly, horizontal bar graphs are used to represent the jdbc connection figure 4.15 the lcs server metrics show current threads and jdbc connection pools note that in snapshot metrics, the application and garbage collector metrics are based on data collected by lcs from server registration to the present. and server metrics, however, show only the current state to view your server's fix packs, click the fix packs tab near the top of the the available and installed fix packs appear in separate tables. available fix packs table functions exactly like the fix packs table in environment view for downloading and installing fix packs figure 4.16 the fix packs tab displays your server's available and installed fix packs the portal properties tab lets you view your portal's property values in a this gives you a convenient display for seeing exactly what your portal properties are set to. the properties in this table are organized default values the default values for your portal's properties custom values any custom values you've set for your portal's properties. this includes any property values you change via a url dynamic properties any property values set at runtime. folder's location depends on your configuration. when setting any properties that require it, you can use url instead of an absolute directory path you can display any combination of these categories by selecting the corresponding checkboxes from the gear icon next to the search box at the for example, by checking the show default values and show custom values checkboxes, the table shows your portal's default and to show only the custom values, select only show custom figure 4.17 click the gear icon to select the type of portal properties to show in the table the details tab shows general information about your server. tabs under details software, java, and hardware. respectively, about your liferay portal installation, java installation, and this information is useful to the liferay support team in the event figure 4.18 the details tab shows information about your server lastly, the server settings tab lets you view and edit your server's name, you can also unregister your server from lcs figure 1 you can use the server settings tab to give your server a fun name as you can see, the lcs dashboard is a powerful tool that greatly simplifies the update process and also gives you extensive information on how your servers next, you'll learn how to use lcs web notifications lcs also displays web notifications that you can view by clicking the bell icon a red badge on this icon shows your unread notification count. lcs and liferay support send these notifications. notifications when a server shuts down or some other event requiring your to mark a notification as read, click the small x icon next to mark all notifications as read, click the mark all as read button. to mark notifications as unread again, click the undo button that appears. see your notification history, click the notifications history button. also access your notification history by selecting my account from the user figure 4.19 web notifications let you know what's happening in your lcs projects next, you'll learn how to manage your lcs account to manage your lcs account, select my account from the user menu in the this takes you to a ui that contains three tabs email notifications configure lcs to send you emails when specific events occur in your lcs projects. you do this by adding rules that define what events trigger a notification. first specify the project, environment, and server for the notification. note that you have the option of selecting all environments and servers in a then check the checkbox for each event that you want to trigger an for example, if you create a notification rule with the server unexpectedly shuts down selected for all servers and environments in your project, then lcs sends you an email when any server in your project goes offline without a normal shut down event. defining the notification rule. it then appears in a table along with any each has an actions button that lets you edit or figure 4.20 you can add rules to determine the events that trigger notifications notification history displays your web notification history in a you can also select the date range from which to display change your account's language, time zone, and default lcs project. default lcs project is the one shown each time you log in to lcs figure 4.21 you can change your lcs account's general preferences now you know how to manage your lcs account. use lcs to work with your liferay ee subscriptions lcs lets you use and view your liferay portal ee subscriptions. you assign its subscription type. registering an unactivated server in that environment consumes an activation key from that subscription type. view your project's available subscriptions and see how they're being used depending on your subscription agreement, lcs also lets you register servers via elastic subscriptions let you register an unlimited this is invaluable in auto-scaling environments, where servers are automatically created and destroyed in response to load you can access these features from the subscriptions tab on the upper-left of this tab contains two other tabs details and elastic figure 4.22 lcs lets you view and manage your subscriptions there are four tables in the details tab subscriptions shows a list of the available subscriptions in your lcs for each subscription, this table shows the following information note that processor cores allowed shows the number of processor cores that the subscription allows for each server subscriptions summary shows how your subscriptions are currently used for each subscription type, this table shows the number of servers allowed, used, and available project environments shows your project's environments and their each environment must have a subscription type project servers shows the environment and subscription type for each if any of the information in these tables is missing or incorrect, contact note if you try to register a server that exceeds the number of processor cores that your subscription allows per server, the registration fails and the a console error also indicates the server's core count. you can compare this with your subscription's processor cores allowed in lcs's to register the server, you can either reduce the number of cores it uses e.g., by deploying to different server hardware, or reducing the number of virtual processors in a vm or container, or contact liferay sales to increase the number of processor cores that your subscription allows per server if you activate servers with lcs, it's important to know how decommissioning those servers frees their activation keys for reuse. server and free its activation key for reuse, select the server's environment on the left and then select the server. in the server's server settings tab, also note that when you shut down an lcs-activated server normally, its activation key is immediately freed for reuse. crashes or its shutdown is forced e.g., kill, its activation key is freed for next, you'll learn how to use elastic subscriptions with lcs elastic subscriptions let you activate an unlimited number of servers. crucial for auto-scaling environments in which servers are created and destroyed you can view data on your elastic servers from the subscriptions tab's elastic subscriptions tab note to register elastic servers in an environment, that environment must be set as elastic when it's created. documentation on creating environments figure 4.23 the elastic subscriptions tab shows details about your project's elastic servers the elastic subscriptions tab displays the number of elastic servers online and the uptime details for each. a graph shows the number of elastic servers online each day, while a table lists each elastic server's start time, end time, the total duration for servers is below the table. report of the table's data, click download report. environment and month selectors above the graph to select the environment and month to show data from, respectively. the data in both the graph and the table reflect your selections here the next section shows you how to use environment tokens to register servers to connect a server in an environment, you must use that environment's token lcs administrators and environment managers can generate and distribute it contains all the information the lcs client app needs to register when the server starts up, it uses the token to if the server is unactivated, it consumes an activation key from the environment's subscription. this lets you register servers in lcs automaticallyno interaction is required note for instructions on using and managing your environment tokens, see there are a few things to keep in mind when using environment tokens each environment can have only one token file. servers using the old file are disconnected from lcs and can't reconnect if such a server was activated with lcs and is running version 4.0.2 or later of the lcs client app, the server enters a 30-day grace period during which it functions normally. administrator time to use the new token file to reconnect to lcs. running earlier versions of the lcs client app present users with an error page until the administrator reconnects with the new token use caution when distributing the token file, as anyone can use it to connect to your environment and consume an activation key in your minimal information server name, location, etc... is used to register a you can change this information from using an environment token overrides if lcs administrators or environment managers have never registered servers in lcs, the first time they do so an oauth authorization entry is created in lcs. if they've previously registered servers in lcs, their existing credentials are used when they create a token if the credentials of the lcs user who generated the token become invalid, you must generate a new token and use it to reconnect to lcs. credentials become invalid if the user leaves the lcs project or becomes an lcs environment manager or lcs environment viewer in a different so why bother with environment tokens at all? connection process, environment tokens are valuable in auto-scaling environments where algorithms create and destroy servers automatically. having clients that activate and configure themselves is crucial note if your auto-scaling environment creates new server nodes from a server in a system image, that server can't require human interaction during when creating such an image, you must change any portal property settings you must therefore set the url property to false if you want your auto-scaling environment to create new nodes from the as you've now seen, lcs is a powerful tool that helps you manage your liferay in addition to activating your servers, lcs lets you apply fix packs and monitor your servers' performance next, you'll learn about liferay portal clustering.;;
a content delivery network cdn is an interconnected system of servers deployed in multiple data centers that use geographical proximity as a criteria to deliver content across the internet. for more information on cdns and their general use cases and technical details, visit the following first, you'll discover the perks of using a cdn in liferay and learn about general guidelines for using a cdn in your liferay portal instance. learn the steps to configure a cdn for your portal. liferay content around the world! a cdn serves web resources to users of a liferay portal instance. resources images, css files, javascript files, etc. from the portal are stored on multiple servers around the world. when requested, the resources are retrieved from the server nearest to the user the cdn functions as a caching proxy. this means that once static content is copied to a local server, it is stored in a cache for quick and easy retrieval. this drastically improves latency time, because browsers can download static resources from a local server down the street instead of halfway around the a user's request to the cdn for content is directed to a server machine that algorithm attempts to use a server closest to the user. the figure below shows a visual representation of using geographical proximity figure 5.7 the red lines on the map represent the required distances traveled by requests from a server to the user. using cdn allows a user to request static resources from a much closer local server, improving download times because of the reduced wait time for requests and reduced load on your application server, a cdn is a great option to improve your portal's using a cdn with liferay, however, has some restrictions liferay only works with cdns that can dynamically retrieve requested resources dynamic resources are resources which change over time or via interaction with end users and thus cannot be cached. should check with your cdn provider to make sure you don't have to manually upload anything in order for the cdn to work. a liferay-compatible cdn must work like a transparent proxy a request first if the cdn doesn't have the requested resource, the cdn makes an identical request back to the origin, caches the resource, then serves the once you've configured liferay to use a cdn see below, the cdn not only serves portal resources but also plugin resources e.g., theme resources or javascript files referenced from a plugin's url file. serves resources that are actually included in a plugin. resources that are dynamically loaded from external sources to get the cdn url for a resource, developers can simply replace the portal host in the resource path with url. developers should prefix resources with the cdn host name. manually upload any resources to the cdn or put anything on the cdn which requires permission checking or complex policy access there are several properties in liferay that enable you to configure your cdn and tweak it to suite your portal's needs. you'll learn how to do this next now that you have a general understanding of what a cdn accomplishes and how it's used in liferay, it's time to set one up for yourself. and its properties using two different methods to configure your cdn via properties file, you need to create a url file in your liferay home directory and set the you can view the cdn properties and their descriptions by visiting the content delivery network section of the url html document once you configure your cdn host, static assets automatically get uploaded to the cdn, and liferay generates urls to them that replace the old host with your to configure your cdn in the control panel, navigate to control panel in the main configuration, you'll notice three fields related figure 5.8 the control panel lets you configure your portal's cdn these properties are exactly the same as the ones you can specify in your make sure to visit the cdn section of the properties document referenced previously if you don't know how to fill in the cdn fields. once you're finished, click save and your old host is replaced with your new as you can see, configuring a cdn is extremely easy, and can drastically reduce latency time and improve your portal's performance.;;
the recommended way of setting up your liferay database also happens to be the liferay portal takes care of just about everything. need to do is create a blank database encoded for character set utf-8. reason for this is that liferay is a multilingual application, and needs utf-8 encoding to display all the character sets it supports next, create an id for accessing this database and grant it all rightsincluding the rights to create and drop tablesto the blank liferay this is the id you'll use to connect to the liferay database, and you'll configure it later either in your application server or in liferay's properties file so that liferay can connect to it one of the first things liferay portal does when you bring it up for the first time is create the tables it needs in the database you just created. this automatically, complete with indexes if you create your database and grant a user id full access to it, liferay can use that user id to create its indexes and tables automatically. recommended way to set up liferay, as it allows you to take advantage of liferay's ability to maintain its database automatically during upgrades or through various plugin installs that create tables of their own. the best way to set up your liferay installation if you'll be setting up liferay's database with the recommended permissions, you note the below instructions are not the recommended set up for liferay installations, but the procedure is documented here so enterprises with more restrictive standards can install liferay with liferay recommends that you use the automatic method as documented above instead of the procedure outlined below even though liferay can create its database automatically, some enterprises prefer not to allow the user id configured in an application server to have the permissions over the database necessary for liferay and its plugins to for these organizations, select, insert, update and delete are the only permissions allowed so we will go over how to set up the if your organization is willing to grant the liferay user id permissions to create and drop tables in the databaseand this is the recommended configurationby all means, use the recommended configuration creating the database is simple grant the id liferay uses to access the database full rights to do anything to the database. once the database is created, remove the permissions for creating tables and dropping tables from the user id there are some caveats to running liferay like this. new tables when they're deployed. in addition to this, liferay has an automatic database upgrade function that runs when liferay is upgraded. that accesses the database doesn't have enough rights to createmodifydrop tables in the database, you must grant those rights to the id before you deploy one of these plugins or start your upgraded liferay for the first time. tables are created or the upgrade is complete, you can remove those rights until additionally, your developers may create plugins that need to create their own tables. these are just like liferay's plugins that do the same thing, and they cannot be installed if liferay can't create these if you wish to install these plugins, you will need to grant rights to create tables in the database before you attempt to install once you have your database ready, you can install liferay on your server.;;
the liferay marketplace is an integral part of the liferay portal experience. starting with liferay portal 6.2, the marketplace plugin is required to be installed alongside liferay portal. the marketplace plugin enables a host of features that extend beyond just access to the online liferay marketplace. of the key features the marketplace plugin enables are the portal installation process attempts to deploy and register the marketplace if your environment supportsallows 1 hot deploy and 2 full database rights, the automatic deploy process takes care of itself. many companies especially in a production environment, however, limit automated processes andor database access. additionally, certain application servers eg., websphere do not support hot deploy, so you may need to deploy the marketplace plugin manually. depending on your environment's restrictions, you may need to follow one or more of the steps below to install the marketplace plugin properly your server may be behind a firewall that prevents access to the internet, or your security policy may not allow direct download and installation from the in these cases, you have 2 options from an internet-enabled computer, download the marketplace plugin from then allow liferay to auto deploy it by dropping the downloaded.lpkg file into from an internet-enabled computer, download the marketplace plugin. the liferay app manager to deploy the plugin detailed instructions can be found under installing plugins manually if your application server does not support hot deploy, you can't leverage you can, however, manually deploy the use liferay's tools to pre-deploy the file then use your app server's tools to do the actual deployment this is because liferay makes deployment-time modifications to the plugins right before they are actually deployed to the application server. instructions can be found under deploy issues for specific containers some production environments do not have the necessary database permissions for liferay and its plugins to maintain their tables. grant the id liferay uses to access the database temporary full rights to the install liferay and have it create the database once the database is created, remove the permissions for creating tables and dropping tables from the user id detailed instructions are available it should be noted that most sophisticated liferay appsnot just the marketplace pluginrequire new tables when deployed. restricts database access, you may need to repeat the above steps whenever you deploy a new app to the liferay portal.;;
in this chapter, you'll find several advanced features of liferay portal, including portal maintenance, backup, and logging. access liferay's web services remotely. it's generally not much more complicated to maintain a running liferay instance than it is to maintain the application server upon which it's running. however, liferay provides tools for logging, patching, and upgrading liferay that you should know how to use. important to follow secure backup procedures to protect your liferay instance's source code, database, and properties files we'll discuss the following topics in this section first, you'll learn how to back up a liferay installation.;;
"liferay upgrades are fairly straightforward. a consistent set of steps is all you need to follow to upgrade a standard liferay installation. more complicated if your organization has used ext plugins to customize liferay. it's possible that api changes in the new version will break your existing code. this, however, is usually pretty easy for your developers to fix. plugins which use liferay apis should be reviewed and their services rebuilt theme plugins may require some modifications to take advantage of new features, and if they're using liferay apis, they should be much effort has been made to make upgrades as painless as possible; however, this is not a guarantee everything will work without modification. plugins are the most complicating factor in an upgrade, so it is important to prior to liferay 6.1 sp2, you could upgrade only from one major release to the for example, you could upgrade directly from liferay 5.2.x to 6.0.x, but not from 5.1.x to 6.0.x. if you needed to upgrade over several major releases, you needed to run the upgrade procedure for each major release until you reached the release you want. this doesn't mean you needed to run the procedure for every point release or service pack; you only needed to run the procedure for the major releases. a good practice was to use the latest version of each major release to upgrade your system liferay introduced the seamless upgrade feature with liferay 6.1. upgrades allow liferay to be upgraded more easily. latest version of liferay to the database of the older version is enough. course, before upgrading, you should test the upgrade in a non-production you should also always back up your database and other important information and make all the other appropriate preparations that we'll discuss now that we've discussed the general philosophy of upgrading, let's outline the procedure for upgrading to liferay 6.2 before you begin upgrading liferay to a new version, consider your current if you're running liferay ee, is it patched to the most if not, refer to the section on patching liferay before you upgrade; the upgrade process is designed to occur on a fully patched if you're running liferay ce, make sure you have the latest ga now that liferay is updated to the latest release of its current version, the first upgrade task is to size up your situation. yourself a few questions from the chart below. was the first version you installed? if it was 6.0 or 6.1, there are fewer steps, because you won't have to worry about migrating your permission if, however, you never upgraded to permissions algorithm 6 or you're still running a 5.x liferay, you need to migrate to algorithm 6 before attempting to upgrade to liferay 6.2 next, if you've used liferay's web content management system, it's possible that you have structure with elements in them that have the same name. to fix this, you'll have to identify the offending liferay provides a script to help you with that if you're upgrading from a version of liferay older than 6.1, you must migrate your image gallery over to documents and media. every plugin must be updated to run on the current this is easy to do with marketplace after you bring up liferay 6.2, install from marketplace any of the plugins you had installed previously. custom plugins, have your development team update them to run on the new version figure 2.3 use this flowchart to determine the steps to take for your upgrade the flowchart illustrates the procedure described above. your course of action for the upgrade. each step is described fully below so that you can perform your upgrade as efficiently as possible. the upgrade in a non-production environment before upgrading your production note in liferay 6.2, the global repository that was used to store web content and documents and media is now its own site with the reserved friendly url global; upgrading to liferay 6.2 will fail if any sites are using the before upgrading to liferay 6.2, make sure no current friendly url let's look at the preparatory tasks you should perform one by one if your liferay installation has existed for a while, you might be on a different permission algorithm than the one that's available in liferay portal permission algorithms 1-5 were deprecated in liferay portal 6.0 and were removed in 6.1, which means you must migrate before you upgrade important before upgrading a liferay instance that's using one of permissions algorithms 1-5, you must migrate to permissions algorithm 6 before attempting to upgrade to liferay 6.2. use the seamless upgrade feature to upgrade directly to 6.2 because liferay's permissions migration tool is not included with liferay 6.2. instructions in this section to migrate to permissions algorithm 6 before if you're on liferay 5.2 or below, you must upgrade to the latest available please follow the instructions in the liferay we will assume for the rest of this section that you have upgraded to liferay 6.0 but that's it's configured to use an older algorithm than the first thing you need to do, if this is not done already, is to upgrade your liferay installation to algorithm 5. if you've already done that, great! skip the rest of this paragraph. if not, shut down your server, edit your url file, and modifyadd the following property so that it as liferay starts, it upgrades your permissions algorithm review your system to make sure that your permissions configuration is working properly it should be next, log in as an administrator and navigate to the control panel. server administration and select data migration from the menu along the top a section entitled legacy permissions migration appears at the figure 2.4 update your permissions algorithm by clicking the execute button algorithms 5 and 6 do not support adding permissions at the user level. have permissions set for individual users, the converter can simulate this for to do this, it auto-generates roles for each individual permission, and then assigns those roles to the users who have individualized permissions. you have a lot of these, you'll likely want to go through and clean them up to generate these roles, check the generate if you do not generate the roles, all custom permissions set for individual users are discarded click execute to convert all existing users and roles to algorithm 6. process completes, shut down your server. and modify the algorithm property to show that you're now using algorithm 6 you've successfully migrated your installation to use the latest, highest performing permissions algorithm. you'll find out if you have any web content structures to fix before upgrading if you make use of the web content management system, you've probably created a library of structures and templates to help you manage your content. versions of liferay, it was possible to create structures that had multiple because this is no longer supported in liferay 6.2 ee as of fixpack 50 or ce as of 6.2.4 ga5, these structures must be changed so none of their fields have duplicate names. if you try to upgrade and you have duplicated field names in your structures, the upgrade will fail to identify these structures, liferay has provided groovy scripts you can run in to execute the script, go to the control panel server administration make sure groovy is the selected language and paste in the script for your version of liferay. the script produces output in the server log. your best possible result would be this means you have no offending web content structures! if you're still reading, you saw something different in your logs, something the script reports to you the total number of offending structures and the templates that need to be fixed manually. it does this by reporting the ids primary keys of the offending objects since you're not a computer, it's highly likely that you won't recognize these groups or templates by their ids, so you'll have to go back to the script console and call the relevant liferay apis to figure out what they are. are called via utility classes in the url package for example, group ids are children of company ids. group ids are back-end labels for sites, among if you have a lot of sites with structures and templates, you'll need to query liferay in the script console to find the ones the script identified that needed to be fixed. to find the name of a group reported in the script by its id, you can query for it in the script console running something like this can help you identify the group or site in which the offending template resides. to find the template name, you can run something use these techniques to identify the templates and then open them in the ui to see if they used fields the script renamed. for example, the script output above says that two fields, name and content, were renamed to namerev1 and you need to open the affected templates and check to see if they if they did, you must modify them to use the new go through each template the script identified and modify them to use the new field names if you do not complete this step and perform the upgrade anyway, you'll get the following stack trace the first time your upgraded system starts at this point, you'll have to roll back to your most recent backup and perform next, you might need to explicitly set your image gallery storage option liferay 6.1 introduced a major change to how liferay handles files. and previous versions had a separate document library and image gallery. liferay 6.1 and 6.2, these are combined into the documents and media repository. if you were using liferay's image gallery to store images, these can be migrated over during an upgrade, but you'll have to take some extra steps first in liferay 6.0, you had three ways you could store images in the image gallery. you could use the databasehook and store them as blobs in the database; you could use the dlhook to store them in the document library, or you could use the filesystemhook to store them in a folder on your server's file system. before you upgrade, you'll need to set whichever property you were using in your 6.0 url file, because by default, none of them are enabled setting one of the properties triggers the migration during the upgrade below are the three properties; you'll need to set only one of them by default, liferay 6.0 used the filesystemhook. property for your installation, you'd use the filesystemhook property above. if you customized the property, you should know which one you used, and it is likely already in your url file if you're using the filesystemhook, you should also specify the image root filesystemhook to allow data migration from other hooks. the third thing you need to do to prepare for your upgrade is to review the new the next thing you'll need to look at are the defaults that have changed between your old liferay instance's version and liferay 6.2. portal-legacy-version.properties file in liferay's web-infclasses folder and in the portal-implsrc folder of liferay's source code. are some 6.1 legacy properties default values of some properties have changed and some new properties have been please refer to the 6.1 and 6.2 versions of liferay's url file for explanations of each of these properties. this file can be found in the your please also note the following changes in behavior by default, liferay 6.1 used the des encryption algorithm with a 56 bit key size for the company level encryption algorithm by default, liferay 6.2 uses the much stronger aes encryption algorithm with a 128 bit key size for the company level encryption algorithm. believed to be secure, is fast, and is a standard for symmetric key however, the upgrade for the url property is only performed if the value for this properties was not customized, i.e., if it the upgrade doesn't make any changes if a different algorithm was explicitly selected. note that this does not affect password encryption which a different property handles by default, liferay 6.1 used the sha algorithm for password encryption by default, liferay 6.2 uses a stronger algorithm, pbkdf2withhmacsha1160128000, for password encryption. password-based key derivation function 2 is a key derivation function that's part of rsa's pkcs public-key cryptography standards series pkcs, version 2.0. it's also described in the ietf's rfc pbkdf2withhmacsha1160128000 algorithm uses a keyed-hash message authentication code using sha-1 and generates 160-bit hashes using 128,000 one round is a single iteration of the key derivation function performance is affected by password encryption during sign-in and password in 2012, owasp, the open web application security project, recommended to use 64,000 rounds and to double the number if using pbkdf2 with 128,000 rounds is too expensive for the hardware on which you're running liferay, you can downgrade your security algorithm to improve performance by choosing a smaller number. example, you set the following if you'd like your upgrade to migrate your password encryption algorithm, you need to specify the legacy password encryption algorithm from which for example, if you were using the 6.1 default before your upgrade, you'd set the following property set this property before performing an upgrade so that both existing users' and new users' passwords are re-encrypted with the new algorithm after upgrading from liferay 6.1 to liferay 6.2, users must sign back in to the portal even if they were using the remember me feature of the sign in after the upgrade, the remember me feature works correctly users can log in to the portal, close their browser, open a new browser window, navigate to the portal, and still be logged in if you don't like the 6.2 default properties, you can change them back in one shot by adding a system property to your jvm's startup. in tomcat, you'd modify url url and append the option -dexternal-propertiesportal-legacy-version.properties to the the scripts url or url are not delivered with default tomcat, but do exist in the bundles. tomcat uses them in the startup process, so it's a nice way to separate your own settings from tomcat's default shell scripts. alternatively, of course, you can override some or all of them in your url along with your if you're not using tomcat, check your application server's documentation to see how to modify runtime properties. your final task is to catalog all the plugins you have installed, so you can install the new versions in your upgraded system finally, you need to take note of any plugins you have installed. plugins are usually version-specific, so you'll need to obtain new versions of them for the new release of liferay. if you have custom plugins created by your development team, they'll need to build, test, and optionally modify them to work with the new release of liferay. don't attempt an upgrade without collecting all the plugins you'll need first for liferay 6.2, the web content list portlet is deprecated. deprecation period, the code will still be part of the product, but will be to enable web content list, you'll need to modify the url file by setting the false tag to however, all the functionality of this portlet is provided by the asset the web content list portlet is expected to be removed in the once you've upgraded your permissions algorithm, reviewed your properties, and collected all the plugins you'll need, you're ready to follow the upgrade remember to back up your system before you begin there are two different procedures to upgrade liferay. a liferay bundle, is the most common. the second procedure is for manually upgrading a liferay installation on an application server. in both cases, liferay auto-detects whether the database requires an upgrade the first time the new version is started. when liferay does this, it upgrades the database to the format required by the new version. liferay must be accessing the database with a database user account that can create, drop and modify tables. make sure you have granted these permissions to the database user account before you attempt to upgrade liferay. we'll run the risk of overly repeating ourselves back up your database let's look at upgrading a bundle, which is the easiest upgrade path if you're running a liferay bundle, the best way to do the upgrade is to follow the new liferay is installed in a newer version of your bundle for example, the liferay bundle for 6.1 uses a different version of tomcat than the liferay bundle for 6.2. we generally recommend you use the latest version of your runtime bundle, as it will be supported the longest unzip the bundle to an appropriate location on your copy your url file and your data folder to the new review your url file as described above. you're using permissions algorithm 6. if you were using the image gallery, make the necessary modifications so your files are migrated to documents and review the new defaults and decide whether you want to use them. any other modifications you've made watch the console as liferay starts it upgrades the database automatically when the upgrade completes, install any plugins you were using in your old make sure you use the versions of those plugins that if you have your own plugins, your development team will need to migrate the code in these ahead of time and browse around in your new installation and verify everything is working. have your qa team test everything. if all looks good, you can delete the old application server with the old release of liferay in it from the you have a backup of it anyway, right as you can see, upgrading a bundle is generally pretty simple. can use bundles sometimes, specific application servers or application server versions are mandated by the environment you're in or by management. reason, liferay also ships as an installable.war file that can be used on any running a manual upgrade is almost as easy as upgrading a bundle verify that your application server is supported by liferay. this by viewing the appropriate document on the customer portal ee, in the deployment documentation if there are installation instructions for your app server, then it's supported, or on if your application server isn't supported by liferay you'll need to upgrade or switch to a supported obtain the liferay portal.war file and the dependency.jars archive copy your customized url file to a safe place and review it as described above, making all the appropriate changes undeploy the old version of liferay and shut down your application server copy the new versions of liferay's dependency.jars to a location on your server's class path, overwriting the ones you already have for the old this location is documented in the deployment documentation, in the section that deploy the new liferay.war file to your application server. deployment instructions in the appropriate section of the start or, if your app server has a console from which you've installed starts it should upgrade the database automatically. is operating normally, and then install any plugins you were using in your make sure you use the versions of those plugins if you have your own plugins, your development team will need to migrate the code in these ahead of time and provide.war if all looks good, you're finished most everything is handled by liferay's upgrade note as stated above, if you have to upgrade over several liferay versions, you will need to repeat these steps for each major release after upgrading to liferay 6.2, you should reindex your portal's search indexes. liferay 6.2 indexes new information in many places, including documents and media, web content, and bookmarks. the control panel server administration and click on reindex all this invokes each of your portal's indexer classes, ensuring that your search indexes contain the updated data that 6.2 indexes if guest users can't see images after upgrading your portal to liferay 6.2 or higher from liferay 6.1 and below, please, check that the guest role has view permissions for the root folder in your document libraries. not needed in previous liferay versions. this issue affects all images if the property url is set to true default value do you have some troublesome required portlets running in your portal? it be great if you could isolate them so they wouldn't affect the overall health we'll show you how to use liferay's sandboxing feature to pen up";;
the performance, health, and stability of a portal deployment is heavily dependent upon the portlet modules deployed to it. or is extremely slow, your entire portal can crash due to a dreaded outofmemoryerror or can slow to a crawl liferay portal 6.2 introduces a sandboxing feature that enables you to run troublesome portlets in their own container or sandbox, reducing any adverse impact they may have on the health and stability of your portal. available in liferay's sandbox app. the app lets you create sandboxes to run portlets in separate jvms, freeing your portal's jvm from the resource we refer to the portal's jvm instance as the master portal instance mpi and the sandbox jvms as slave portal since spis run on the same host as the mpi, communication the fact that sandboxed portlets are running in spis portal users continue to use these portlets as as a portal administrator, you'll be pleased to know that the app not only gives you the ability to section off plugins into spis, but also gives you the the liferay sandbox app comes with a spi administration ui that lets you create, start, stop, and restart spis. configure options to restart spis that terminate unexpectedly, automatically the sandboxing feature has two limitations. plugins can be deployed on an spi. second, the portal ignores spi portlet implementation classes that are not remote-safe. implementation classes such as asset renderers and pollers that register with the portal fall into this category and are ignored by the portal. therefore, the sooner you test and resolve any performance issues in such spi portlets, the sooner you can deploy them back onto the master portal instance to leverage such implementation the liferay sandbox app is available on the liferay and deploy the app as described in this guide's chapter on leveraging the liferay marketplace before creating and using sandboxes, we must enable the portal's resiliency functionality and optimize the database connection settings for your sandboxes the two types of portal properties you must modify for your portal to use sandboxing are the portal resiliency properties and database connection you can set these in your url you must enable portal resiliency by setting the url in addition, you can optionally enable the portal to show special footers in sandboxed portlets. the footers display at the bottom of each sandboxed portlet, indicating the sandbox that is servicing the request. footer helps you verify that a portlet is sandboxed and which sandbox it's in. to enable both of these resiliency properties, specify the following entries in if you hadn't previously configured your database connection pools using your portal properties, you must do so in order to use the sandboxing feature. you've been using jndi to configure data sources on your app server, please convert to using liferay's built-in data source by specifying it via or start a sandbox while having incorrect jdbc settings, the sandbox administration console displays a warning after you've configured your portal for sandboxing and restarted it, deploy the then navigate to the control panel to see the spi administration link displayed in the configuration section figure 2.5 the sandboxing app comes with an spi administration ui that's accessible from the portal's control panel click the spi administration link to start creating spis for running new or you can create and administer spis from the spi administration page accessible in the configuration section of the control panel to add a new spi, simply click on the add spi button figure 2.6 click the add spi button to define a new sandbox spi the add spi panel divides the spi's fields into general, spi configurations, and advanced configurations sections figure 2.7 you can name your spi, describe it, and configure it from the add spi panel in the general section, you must provide a unique name for the spi and describe the spi configurations contains some of the most important settings for the spi. it is broken into 4 sections spi runtime, spi applications, java runtime, figure 2.8 from the spi runtime section of your spi, you can set its maximum number of working threads based the number of threads available to your portal that you'd like to designate for the spi. you must also set a unique connector port for the spi let's set the spi's runtime options first maximum worker threads enter the maximum number of worker threads that the spi can use to process requests. this value, however, according to the number of threads allocated in the application server hosting your portal. this parameter functions similarly to the settings in most jee application servers connector port enter the port number on which the spi listens for requests each spi runs on an embedded apache tomcat server instance. each of the portal's spis must use a unique port and you must ensure that no other processes are using that port note the spis and mpi serialize parameters and return values passed between them. the sandboxing feature uses an ipc to support communication between the mpi and spis next, we'll pull those troublesome apps into the spi the spi applications panel provides a way to select applications to be hosted all requests that call these applications are processed by the figure 2.9 all the portlets and web plugins that you've installed on your portal are available for moving into a spi the panel lists non-core portlets and web plugins that have been installed on since theme, layout template, hook, and liferay ext plugins are not supported in the sandbox, they're excluded from this list. following applications are explicitly excluded next, we'll set the java runtime resources for the spi's jvm the jvm arguments panel allows you to specify arguments to be passed to the java virtual machine jvm running the spi. debugger options, etc. if you do not specify any values, the system automatically uses these values consider the jvm's performance tuning recommendations when setting these you can also consult the liferay deployment checklist for guidance on setting the jvm arguments in development, you may also choose to add debug settings to the jvm arguments figure 2.10 you can specify java runtime options optimal for your spi's apps in the event that the spi terminates unexpectedly, you may want to consider automatically restarting it and having the sandboxing app send notifications to the sandboxing app lets you configure email notifications for when an spi crashes and lets you configure for the app to automatically restart the spi figure 2.11 you can have the spi notify you and others if the spi's apps crash it. and you can configure the maximum number of times to automatically revive the spi, before requiring manual intervention use default notification options select this checkbox to use the globally otherwise the notification options specified in notification recipients enter a set of comma-delimited email addresses of people to be notified in the event that the spi fails. if the use default notification options checkbox is selected use default restart options select this checkbox to use the globally otherwise the restart options specified in this panel maximum restart attempts enter the maximum number of times to attempt restarting the spi in the event that the spi fails. maximum number of restart attempts for the spi, it refrains from restarting the at that point, manual operator intervention is required to restart it. this option is disabled if the use default restart options checkbox is the advanced configurations section contains a series of optional parameters java executable enter the path to your jvm, specifically the path to your java executable file i.e., the java or url file. not modify this value, assuming your java executable is in your system's path spi ping interval enter the number of milliseconds to wait between pings that the spi sends to the portal to ensure the portal is alive. portal prevents spis from becoming zombie processes, in the event that the spi register timeout enter the number of milliseconds allotted for the spi the default value is 300000 milliseconds 300 seconds. should be ample time for a spi to start. however, if you have a large number of applications in the sandbox, or the server has an insufficient cpu or insufficient memory resources, you may need to increase the amount of time spi shutdown timeout enter the maximum amount of time in milliseconds that the spi should need to gracefully shutdown. timeout, this value may need to be increased on slower or overloaded machines you may also choose to allocate certain embedded liferay functions e.g., blogs, this is generally not recommended, but is made possible by the sandboxing app. the spi core applications panel lets you drag apps onto the spi in the same way you can with the spi applications panel now that you know how to add a spi and configure it properly, let's learn how to the portal automatically starts spis on startup. new spi, you must start it manually figure 2.12 when you first create a spi, you'll need to start it manually. you can edit and delete spis that are not running once successfully started, you can stop or restart a spi. you can edit an spi's configuration too. configuration changes made to a running spi take effect after it's restarted figure 2.13 spi configuration modifications only take affect after the spi has been restarted as you can see, operating spis is straightforward and easy to do if you have multiple spis, you may want to use global settings to configure the let's consider how to configure global settings for the spi administration console allows you to configure a series of global you can access them by clicking on the configuration gear icon as figure 2.14 click on the global settings gear icon, in the upper right corner of the spi administration console, to set default configuration options for all of the portal's spis once you've opened the configuration panel, the spi administration console enables you to configure global notification and set restart options for your note that option values explicitly configured in an spi take precedence over the global settings with respect to that spi figure 2.15 you can set default notification and restart options for all of the portal's spis let's look at the global notification options first the notification options allow you to configure both the notfication email content and specify the recipients of the notification email. figure 2.16 via the spi administration's global configuration panel, you can set specific email notification options, including the sender's address, the sender's name, default recipients, a default email subject template, and a default email body template notification email from address enter a default origin email address to use for notification emails sent from the spis notification email from name enter a default name to use for the sender of notification recipients enter a default comma-delimited list of email addresses to receive the notification emails notification email subject enter a subject template for the notification notification email body enter a body template for the notification emails let's take a look at the restart options too the restart options section allows you to configure how many times each spi is restarted in the event that it terminates unexpectedly. below, all spis are restarted 3 times before requiring administrator figure 2.17 you can set default restart options for your spis from the spi administration's global configuration panel let's recap what liferay's sandboxing app does for you. portlets and web plugins that are known troublemakers or that you are simply you put them in their own sandbox jvm or spi, so they can still be used in your portal but are kept out of your portal's jvm. administrator, you can group plugins into spis and configure each spi's runtime, notification, and recovery options. in addition, you can configure global default settings for your portal's spis. with the sandboxing app, you can ensure your portal's resiliency while leveraging all the portlets even leaky ones liferay portal can serve portlets that are installed on the system, or it can serve portlets installed on another portal server. have you ever wondered how to use wsrp in liferay?;;
in the previous chapter, we learned how to use the control panel for user we learned how to manage users, organizations, user group, roles, we also learned about user monitoring. we'll look at portal and server configuration options for liferay. have been navigating in the control panel, you should be pretty familiar with the control panel is organized in four main areas users, sites, the options in the configuration section of the control panel category include configuration options which control how the portal operates and integrates with other systems you may have. chapter, we'll cover the following topics portal settings, such as user authentication options, mail host names, email notifications, identification settings, and display settings server administration options, including options for resources, log levels, properties, captcha, data migration, file uploads, mail, external services, after you have created users, user groups, organizations, roles, sites, and teams your portal will be ready to host content and applications. configure liferay's portal settings to fit your environment and your particular it's easy to adjust configuration settings using the portlet-driven user interface of liferay' control panel. examining liferay's portal settings.;;
custom fields appear beneath portal settings under the configuration heading of custom fields are a way to add attributes to many types of assets and resources in the portal. to create a site for rating books, you might create a custom field called favorite books for user resource. if you're using the wiki for book reviews, you might add fields called book title and book author it's possible to add custom fields to following kinds of portal resources the ability to add custom fields to any of these resources affords flexibility for example, suppose you'd like to define a limitation on the number of users that can be assigned to certain roles. administrator can create a custom field called max-users for the role then a portal developer can create a hook plugin that checks this field upon user assignment to roles to make sure that there aren't too many to add a custom field, click on the custom fields link in the control panel. then choose a resource, click on the edit link next to it and select add figure 17.6 you can add custom fields to these portal resources from here you need to add the custom field key. the key appears as the label for for some portal resources like the user, custom fields are a separate section of the form. for others, as can be seen above, custom fields are integrated with the default fields on the form. developers can access custom fields programatically through the figure 17.7 the book-author and book-title custom fields are integrated with the rest of the form for editing a wiki page you can create fields of many different types text fields indexed or secret, integers, selection of multiple values and more. however, you can delete custom fields and create new next, let's look at how to apply server configurations.;;
liferay ships in two editions one for the community and one for enterprise the community edition is the same liferay portal that has been available for years frequently updated and bursting with the latest features, the community edition of liferay portal is offered for free under the lesser gnu public license, a free software license with one important exception. license gives you the flexibility to link liferay with your own code in your portlet, theme, hook, layout, ext or web plugins, no matter what license you use if, however, you modify liferay directly, those modifications need to be released as free software under the terms of the license. way, of course, to do this is to contribute it back to the liferay community. this is really the best of both worlds you have the freedom use any license or no license if you use plugins, but if you modify liferay directly, the community receives the benefits of any enhancements that you've made liferay for enterprise subscribers is a supported version of liferay portal for the subscription and support package allows organizations to build their portals on a stable version of the product that is offered over an it's the best wayfor you to develop, deploy, and now let's learn how to get a copy of liferay portal.;;
"the liferay community can download liferay portal from our web site at the top of the page, and you'll see multiple options for getting a copy of liferay, including our convenient bundles or a.war package for installation on your application server of choice liferay enterprise subscribers can download liferay from the customer portal. you have a choice of the same open source app server bundles as community members, plus a few commercial alternatives, in addition to the.war package a bundle is an application server with liferay this is the most convenient way to install liferay. bundled with a number of application servers; all you need to do is choose the if you don't currently have an application server, you may want to start with the tomcat bundle, as tomcat is one of the smallest and most straightforward bundles to configure. source application server preference, choose the server you prefer from the all the bundles ship with a java runtime environment for windows; if you are using a different operating system, you must have a jdk java development kit installed prior to launching liferay portal please note that liferay is not able to provide application server bundles for proprietary application servers such as weblogic or websphere, because the licenses for these servers don't allow for redistribution. however, runs just as well on these application servers as it does on the a.war file and dependency.jar s are provided for proprietary application servers, and you'll need to follow a procedure to install liferay on once you have liferay, you can then plan out your installation. two-step process first, determine if you need liferay portal security turned on, and second, install liferay portal, by using a bundle or by installing it manually on your existing app server. next, we'll go over the steps it takes to";;
there are two ways to access the marketplace via the website using your favorite browser, you can navigate to the via liferay if you have a liferay portal up and running, you can use the apps section of the control panel to access marketplace content no matter which method you choose, you will see the same content and apps if you are new to the marketplace, the easiest way to access it is by using your figure 15.1 you can access and browse the marketplace home page without a url account but you need an account in order to purchase and download apps in the center of the page, you will see a number of icons. an individual app, and apps are organized by category new and interesting the latest apps added to the marketplace featured apps liferay features a different set of apps each month most viewed the top 10 most viewed apps if you click on the title of an app, you can access details about the app, including a description, the author's name, screenshots, price, latest version, number of downloads, a link to the developer's website, a link to the license agreement for the app, a link to report abuse, and a purchase button. also be able to view version history, read reviews left by other users, or write figure 15.2 click on a marketplace app to view details, ratings, and reviews of the app if you click on the purchase button, you'll be prompted to choose a purchase you can purchase an app for your personal account or for your company. your company has already been registered, select it in the drop-down list. your company hasn't been registered, click the register your company link to register your company with liferay marketplace. company section below for details the left side of each page in the this menu contains links to various categories of apps available from marketplace. clicking on the individual categories allows you to browse the apps in that category. to view all the apps on marketplace at once, click the apps link and then the see all link in the apps portlet figure 15.3 click on the apps link in the menu on the left side of the liferay marketplace homepage and then on the see all link in the apps portlet to browse all the marketplace apps at once below the navigation menu is the search bar. this search checks the titles and descriptions of apps against your search terms you do not need a url account in order to browse the marketplace. however, if you wish to purchase and download an app, you need to establish a url account and agree to the marketplace terms of use. click sign in, then create account, and sign up! you can fully utilize the marketplace to find and use marketplace apps if you are a developer and wish to create and upload new apps, you must also register as a developer in marketplace. become a developer from the marketplace menu figure 15.4 click on the become a developer link in the menu on the left side of the liferay marketplace homepage to register a developer's account, either as an individual or a company once you register as a developer, your url homepage will have links for adding your apps to marketplace, and managing them after they're once you register a developer account with your url account, your existing url home page will contain a new section in the left you now have two apps links one under the main navigation menu and one in the development section. under your name is where you go when you want to vies and download yuor purchased apps from the marketplace. the apps link under the development menu will let you manage existing apps and add new apps to the marketplace. see information on your app's performance, use the metrics link in the if you submit an app, it will be reviewed before appearing on your url home page is a private page. it's distinct from your public url profile page the develoment menu in your url home page is where you'll go to manage and monitor your own marketplace apps, and the apps link in your main navigation menu lets you view and download apps you purchased from the the apps link in the menu under your name lists your purchased apps. screen, you can find information about the authors of the apps you have purchased and download or re-download the app for example, if you lost your copy or have re-installed liferay and wish to re-deploy the app. is also useful for downloading apps and deploying them to offline instances of liferay that do not have direct access to url figure 15.5 on your url home page, the apps link in the left navigation menu lets you view and download your purchased apps if possible, it's best to log into your portal instance and install purchased applications through the store link in the control panel's apps section. this will provide your portal instance with automatic update notices should if you download applications this way, they can be the development menu is where developers go to manage their marketplace apps. the apps link lists apps you have authored and uploaded, and gives you an add new app link that let's you submit an app to be added to the marketplace. metrics link will show you details such as the number of downloads, the current price and other relevant information. marketplace chapter of the developer guide figure 15.6 this is part of the form you need to submit when submitting an app to liferay marketplace clicking on add an app allows you to upload a new app and make it available in please see the marketplace chapter of the developer guide for more detail on authoring your own app to create and register a company with liferay marketplace, click the become a developer link in the left-hand navigation menu of the marketplace home page. you can create an individual or a company developer account. create an account on behalf of your company, your first step is to see if your company already exists on liferay marketplace. enter your company name into the search box and check if it's already been registered. company has already created a company account on liferay marketplace, you can click the request to join this company button. notification to your company's marketplace admin the one who created your company's marketplace account. your company's marketplace admin will then be able to add you to the company. if the company name you'd like to use is available, click the register your company button to move on to the next step figure 15.7 you can upload apps as an individual or on behalf of your company your second step is to fill out your company's information. information you must provide includes a company logo, the company name, a company description, a company email address and a homepage url. information you must provide includes a company address, your company's country, region, city, postal code and phone number. required for validation includes a company email address and a legal tax once your company's marketplace registration has been approved, you will be your company's marketplace admin! this means you'll be responsible for handling marketplace users' requests to join your company. don't have to be stuck with this responsibility. to your company, you can promote some of them to be company marketplace admins;;
once you've found an app you wish to download and install, click on the name of the app to display its detailed information screen figure 15.11 click on an app to read a description and view additional details this screen offers a number of items to help you learn more about the app. can find the primary information about the app on the left side of the screen, in the center display, you see a set of screenshots along beneath the screenshots, you can find a below that, you can read reviews and view the version each app provides at least the following information author the creator of the app. this can be either an individual or a company rating the average rating of the app on a scale from zero to five stars. number of ratings is also shown latest version the latest released version of this app total downloads the number of times the app has been downloaded supported by who to contact if you need support for this app developer website a link to the developer's own website purchasefree the button to click on to purchase the app. an app before you can download it in the lower section, you will find reviews and version history tabs for this check this area to find out what other people are saying about this app. addition, on a separate tab, you will find the history of versions for this app, where you can download other versions for example, if you are using an older version of the liferay platform, you may need to download a specific version of this app that is compatible with the version of the liferay platform you are you've chosen an app, read the reviews and want to download and use the app! there are two ways to install the app. ultimately, both methods result in the same outcome the app you've chosen is installed onto your local running liferay apps on the liferay marketplace consist of individual liferay plugins for example a portlet, a hook, or a collection of multiple plugins. these apps must be installed on a running liferay instance before they can be deploying an app to a running liferay instance is automatically done through the process of hot deploy. when using your liferay portal's control panel to install apps from the marketplace, when you click purchase or install to download and use a given app, it will be downloaded and hot deployed to your local running liferay instance for some liferay installations, the hot deploy mechanism is disabled, in order for the site administrator to manage or prevent the deployment of plugins. this case, the app will still be downloaded and stored in the hot deploy directory with a.lpkg extension in its filename, but must be manually deployed using the custom process used for deploying other plugins please see the later section installing plugins manually to learn more about hot deploy, its behavior on various app servers, and how to manually deploy marketplace apps in situations where hot deploy cannot be used the easiest way to install an app is to do so from your liferay control panel. this requires that you have already installed liferay on your local machine and that you can log in as an administrator. administrator, click the admin menu from the dockbar and choose control figure 15.12 as an administrator, you can access the marketplace interface from the control panel of a running liferay portal click on either the store or the purchased links beneath the apps heading. before you can access marketplace via the control panel, you need to associate your url login credentials with your local administrator account. enter your url email address and password so your liferay installation can connect to the url marketplace figure 15.13 before you can access marketplace via the control panel you need to link your url credentials with your liferay instance's administrator account tip any local user with administrative privileges can use the marketplace to browse and install apps from the marketplace, by entering their url credentials in the above login screen. this allows multiple administrators to manage the apps installed on the local liferay instance. established between a local administrator account and a url account, there is no way to undo this, short of re-installing liferay once you've successfully linked the accounts, you will be presented with the same marketplace screens that you'd see if you were accessing the marketplace you will be able to browse, search, and install apps click on the store link under the apps heading in the control panel to browse the apps available from the url browse to the app you wish to install, click on the purchase or free button, and then click on the appropriate button to confirm your purchase the app will be downloaded and deployed to your local you can view and manage all the apps you've purchased by clicking on the purchased link under the apps heading in the control panel. purchased link shows you a list of those apps which you've downloaded in the past, including apps you may have purchaseddownloaded while using other liferay the apps which you downloaded and installed on the currently running instance of liferay are listed as installed. apps which you have previously downloaded or purchased on other liferay instances that are incompatible with the current one you need to re-downloadre-install the appropriate version of these apps if you wish to use them on your running instance of the second way to install an app is to download it first, then in a separate step, deploy it to your running liferay instance. situations where you do not wish to deploy the app directly to your production environment, or in cases where the target liferay instance that is to receive the app is behind a corporate firewall or otherwise does not have direct access in this case, using your browser, you will find the app on the liferay purchase or free button when viewing the individual app. the app to be placed in your purchased list on your personal home page. navigate to your home page and click on apps. the one you just purchased, or whatever app you want to download. list of app versions and liferay versions. choose the version of the app you want, making sure the liferay version corresponds to the version of the liferay installation where you'll install the app. downloaded to your local machine in the same way any other file would be this file can then be hot-deployed to liferay by copying it to;;
creating apps for the liferay marketplace is very easy and intuitive. out more information about creating your own liferay apps, visit the liferay marketplace developer guide and get started creating apps today! differences between the various types of liferay plugins and show how to manually deploy plugins to liferay.;;