text;
stringlengths 5
32.6k
|
---|
you know how all these retailers advertise themselves as a one stop shop for the idea is they have so much stuff that chances are whatever liferay's control panel is something like this. you want to create users, organizations, sites, configure permissions and plugins and pretty much anything else, you can do it from the control panel. when signed in to liferay as an administrator, you can access the control panel from the dockbar by clicking admin control panel the control panel is organized into four main areas users, sites, apps, and the users section lets you create and manage users, organizations, user groups, roles, and password policies. enabled for your portal, you can also view all of the live portal sessions of your users from this area of the control panel. installed from liferay marketplace, the in this chapter, you'll learn everything having to do with managing users, and you'll see examples of some of the user management concepts discussed earlier let's begin examining liferay's control panel by looking at how to manage users;;
|
roles are used to collect permissions that define a particular function within the portal, according to a particular scope. roles can be granted permissions to various functions within portlet applications. collection of permissions that defines a function, such as message board a role with that name is likely to have permissions relevant to the specific message board portlets delegated to it. this role will inherit these permissions if you navigate to the control panel and click on roles, you'll find a single interface which lets you create roles, assign permissions to them, and assign roles can be scoped by portal, site, or organization. create a role, click the roles link and then click the add button. choose a regular, site or organization role. a regular role is a portal-scoped make a selection and then type a name for your role, a title and a the name field is required but the title and description are if you enter a name and a title, the title will be displayed in the list of roles on the roles page of the control panel. title, the name will be displayed. when you have finished, click save in addition to regular roles, site roles, and organization roles, there are also teams can be created by site administrators within a specific site. permissions granted to a team are defined and applied only within the team's the permissions defined by regular, site, and organization roles, by contrast, are defined at the portal level, although they are applied to the differences between the four types of roles can be regular role permissions are defined at the portal level and are applied at site role permissions are defined at the portal level and are applied to organization role permissions are defined at the portal level and are applied to one specific organization team permissions are defined within a specific site and are assigned within note some permissions cannot be handled from the control panel. asset-level permissions for instance, permission to edit an individual blog post, or view a folder in the documents and media library are managed from the figure 16.9 to examine all the roles defined for your portal, navigate to the control panel and click on roles after you save, liferay redirects you to the list of roles. functions you can perform on your new role, click the actions button edit lets you change the name, title or description of the role permissions allows you to define which users, user groups or roles have define permissions defines what permissions this role grants. assign members lets you search and select users in the portal to be these users will inherit any permissions that have been view users allows you to view the users who have been assigned to this delete permanently removes a role from the portal next, let's learn about the difference between the portalsiteorganization administrator and owner roles that liferay provides out-of-the-box if you navigate to the control panel and click on roles, you'll see a list of all the roles that have been created in your portal. that liferay provides out-of-the-box and any additional custom roles. some of liferay's out-of-the-box roles tip it's easy to overlook the differences between site and organization owners and site and organization administrators. that site and organization administrators cannot delete the membership of or remove the administrator or owner role from any other administrator or owner. they also cannot appoint other users as site or organization administrators site and organization owners can delete the membership of or remove the administrator or owner roles from other site or organization they can appoint other users as site or organization next, let's examine how to configure the permissions granted by different roles roles serve as repositories of permissions. when a roles is assigned to a user, the user receives all the permissions defined by the role. you need to assign members to it and define the permissions you want to grant to figure 16.10 when defining permissions on a role, the summary view provides a list of permissions that have already been defined for the role. the area on the left side of the screen lets you drill down through various categories of portal permissions when you click on the actions button for a portal-scoped role and select define permissions, you'll see a list of all the permissions that have been to add permissions to a role, drill down through the categories of permissions on the left side of the screen and click on a specific category such as site administration pages site pages. in the center of the screen, you'll see the permissions that belong to that flag the checkboxes next to the permissions that you'd like to add the for non-portal scoped roles, you need to click on the options link on individual portlets, then configuration, then permissions to assign permissions within the site that owns the portlet portal permissions cover portal-wide activities that comprise several categories, such as site, organization, location, password policy, etc. this allows you to create a role that, for example, can create new sites within the this would allow you to grant users that particular permission without making them overall portal administrators for liferay 6.2, the permissions fall into the following hierarchy of the three basic categories of permissions are control panel, site administration, and my account. by default, any portal user can manage their user account via the permissions belonging to the my account category. administrators can access the site administration tools belonging to the site and portal administrators can access the entire control for custom roles, you can mix and match permissions from as many the permissions in the site administration applications categories govern the content that can be created by core portlets such as the wiki and message if you pick one of the portlets from this list, you'll get options for defining permissions on its content. you'll see permissions for creating categories and threads or deleting and site application permissions affect the application as a whole. message boards as an example, an application permission might define who can add the message boards portlet to a page the control panel permissions affect how the control panel appears to the user the control panel appears differently to different users, depending on their permissions. some control panel portlets have a configuration button and you can define who gets to see that. you can also fine-tune who gets to see various applications in the control panel figure 16.11 you can fine-tune which actions are defined for a role within a specific application like the message boards each possible action to which permissions can be granted is listed. permission, flag the checkbox next to it. if you want to change the scope of a permission, click the change link next to the gear icon next to the permission after you finish defining permissions for a role, for a portal-scoped message boards administrator role, you might want to grant content permissions for every message boards action listed. you click save, you'll see a list of all permissions currently granted to the from the summary view, you can add more permissions or go back by clicking the list of permissions that you can define for a role may seem overwhelming. however, these permissions ensure that you can customize exactly which areas of your portal you'd like different collections of users to be able to access. sometimes you might find that a certain permission grants more or less access than what you expectedalways test your permissions configurations! for example, suppose that you need to create a role called user group manager. like to define the permissions for the user group manager role so that users assigned to this role can add users to or remove users from any user group. do this, you can take the following steps figure 16.12 make sure to test the permissions you grant to custom roles you might expect that these permissions would be enough to allow users assigned to the user group manager role to add or remove any users to or from any user after all, we've granted user group managers permissions to view user groups and assign members and we've granted them access to user groups in the however, we're forgetting an important permission. that's right we haven't granted the user group manager role although user group managers can assign members to user groups, they don't have permission to view users at the portal level. means that if they click assign members for a user group and click on the available tab, they'll see an empty list figure 16.13 users assigned to the user group manager role can't find any users to add! to fix this, log in as an administrator and click admin control panel then click on roles and then on actions define permissions next to the user group manager role. control panel users users and organizations category and flag the view permission under the resource permissions user once you've saved your permissions configuration, users who've been assigned to the user group manager role will be able to browse the portal's entire list of users when assigning users to a user roles are very powerful and allow portal administrators to define various permissions in whatever combinations they like. flexibility as possible to build the site you have designed as of liferay 6.2, there's a permission that allows site administrators to delegate responsibility for configuring social activities to other users. assign this permission to a role, first navigate to the control panel and click if you'd like to add a new role, do so. the role to which you'd like to add social activities configuration permissions next, drill down to the site administration of the permissions and then click save once these permissions have been assigned to the chosen role, any users assigned to the role will be able to manage your site's social activities configuration liferay portal contains many types of portal resources upon which permissions these include both assets and asset containers. refers to any kind of content in liferay such as a web content article, blog entry, wiki article, message board post, or documents and media document. containers are portal resources used for grouping specific kinds of assets. example, web content folders, wiki nodes, message board categories, and documents and media folders are asset containers when configuring permissions for assets and asset containers, it's important to note that the permission to delete an asset container includes the permission to indirectly delete any assets in the container. permission to delete an asset container, the user can delete all of the assets in that container even the user lacks permission to delete any of the assets in granting permission to delete a folder but not any of the contained assets is not a common use case. to note that assets in a container can be indirectly deleted if their asset prior to liferay 6.0, the default configurations of many liferay portlets allowed power users, but not regular users, to access them. subsequent versions grant the same default permissions to both power users and this way, portal administrators are not forced to use the power however, liferay encourages those who do to create their own custom note prior to liferay version 6.0, power users and users did not have the so if are using liferay 5.2 or a previous version, it's dangerous to remove the power users role from the default user associations this could remove certain permissions you expect to apply to all if you decide to remove the power users role from the default user associations anyway, you will probably want to modify the permissions on certain portlets to make them accessible to all users. now that we've seen how to use organizations and user groups to manage users and how to use roles to define permissions, let's learn how to configure portal password policies can enhance the security of your portal. requirements on password strength, frequency of password expiration, user additionally, you can apply different password policies to different sets of portal users. user authentication to an ldap server if you are viewing a page other than the control panel, click on admin control panel from the dockbar. next, click on the password policies link you'll see that there's already a default password you can edit this in the same manner as you edit other resources in the portal click actions and then click edit 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 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.;;
|
the last link in the users section of the control panel is for monitoring. can use the monitoring page to view all of the live sessions in the portal. performance reasons, this setting is usually turned off in production another way of seeing what users are doing is to install the audit plugin from;;
|
in the last chapter, you saw the elements that comprise a workflow definition and learned how to create a workflow definition. you'll learn about the kaleo forms admin application for liferay ee. application lets you create workflow definitions using an intuitive ui. the workflow designer saves you the time and trouble of having to deal directly developers who are used to working with xml can create workflow definitions with other users may not be so comfortable with it. skilled developers can make mistakes that break a definition and require time to to help streamline the creation of workflow definitions and empower more users to create custom workflows, liferay provides the kaleo forms there are two pieces to the workflow designer kaleo forms admin and kaleo these two portlets are included in the kaleo forms app and can be downloaded from liferay marketplace. kaleo forms admin contains a wizard that guides you through each step in the creation of a workflow process. includes a drag and drop interface for creating new workflow definitions without kaleo forms display allows you to work with a process in in other words, kaleo forms admin is for creating workflow processes, while kaleo forms display is for using them let's look at kaleo forms admin first.;;
|
"you can access kaleo forms admin from the dockbar by clicking admin site administration content and then clicking kaleo the portlet then appears with a listing of the processes that if you're coming here for the first time, however, there won't the first step in the new process wizard. for this example, give your process the name lunar resort news content, add a description, and then click next figure 13.1 the first step of the new process wizard the second step in the new process wizard lets you define the fields that to the right of the to do field, click the actions now that you've chosen a field definition for your forms, you can move on to the next step in the wizard to add or define a figure 13.2 the second step of the new process wizard. this is where you define and choose the fields for your forms the third step in the new process wizard is really where the meat and potatoes this is where you choose or define a workflow to use the single approver workflow is included by default. look at how it's defined, click actions and then edit. interface for editing or defining a workflow appears below the details section of the single approver edit screen figure 13.3 the graphical view for editing or defining a workflow this graphical view is where kaleo forms admin can help you build a workflow without having to write any xml. there are eight types of nodes you can add to a the node types are condition, end, fork, join, join xor, start, state, and task. aren't node types we've previously discussed; that's because they're actually just state nodes, with certain fields pre-filled to help streamline the creation since every workflow has a start and end state, you'd have to do this each node you add has a pop-up menu letting you edit or delete the node. you hover your mouse over the edges of a node, notice your mouse pointer changes the cross indicates you can connect the current node to another hold down your mouse button and drag the mouse to start drawing your if you stop before reaching the edge of the next node, a pop-up displays node types you can create and connect to on-the-fly. connect with an existing node, continue dragging the connector to that node figure 13.4 create transitions to existing or new nodes. the connector pop-up let's you create and connect to new nodes on-the-fly to get a feel for how the designer works, go ahead and use the workflow designer to duplicate the default workflow definition. go back to the previous step and when you choose this option, it creates a blank workflow definition with start and end nodes. to make this work, you'll add two tasks, fill in the relevant information, assign the tasks properly, and create the first add two tasks, then use the edit icon to name them review and update figure 13.5 edit a node by clicking on its node icon and modifying its settings next, connect the nodes so review has four nodes, as follows one receiving the transition from startnode, one sending a transition to update, one receiving a transition from update, and one sending a transition to figure 13.6 your workflow should look something like this next, you want to add the correct assignments and notifications. the box on the left shows all the properties of the review node. the assignments category, set the assignment type to role type, the role type to regular, and the role name to portal content reviewer figure 13.7 assignment settings for the review node double-click on notifications and create a notification with the notification type set to user notification and the execution type set to on assignment figure 13.8 notification settings for the review node together, the assignment and notification settings specify that a user receives a notification in their dockbar when assigned a form in this workflow. to the update node and assign it to the content creator role with its own user next, go through all the transitions and make sure they're named correctly. workflow transitions connect one node to another. exiting the first node, processing continues to the node pointed to by the every time you created an arrow from one node to another, kaleo by default, these transitions get system generated names, so we'll rename them all to something more human-readable. first, click on the arrow going from the start node to the review node and set the name to submit and set default to trueyou'll leave all the others as set the name of the review to update transition to reject and the update to review transition to resubmit. lastly, set the name of the review to figure 13.9 your completed workflow should look like this it should look a lot like the default workflow, only a tiny bit messier, as the nodes are written in the order they were created, not in the logical order that happens when a human writes the code. once you're finished, click publish. your workflow is now ready to use! back on the third step of the new process wizard, click actions choose next to the workflow you just created. the fourth and final step of the new process wizard is for creating or assigning a form to each task you've defined in the workflow. with its form if it has been assigned one and a button that lets you assign a therefore, you have create, update, and review listed as your figure 13.10 the fourth step in the new process wizard lets you assign a form to each task go ahead and click on the assign form button next to the created task. next page, click the add form button. the screen that appears lets you create first, give the form the name initial form, since it's the first next, take a look at the available fields. review task so you won't need all the fields that are in the form by default. delete a field, mouse over it and click the trash icon that appears. and delete all but the assigned to, severity, start date, status, and your form should now look like the one in the screenshot here figure 13.11 basic form creation if you delete a field by accident or simply want to add another field to your form, you can do so by dragging and dropping its icon from the fields tab on the left to the form itself on the right. fields already on the form that can appear on it only once are grayed out. you can also edit the settings of a field in the form by mousing over it and clicking the wrench icon. settings for the assigned to field are shown in this screenshot figure 13.12 settings available for a field in a form since you don't need to change any of the field settings in this form, go ahead on the next screen, choose your new form from the actions now that you're familiar with the basics of form creation and assignment, create a form titled second form to use for the update and review make sure you choose the new form for your update and review tasks. done assigning forms to tasks, click save. your new process is complete, and is listed in the kaleo forms admin portlet. figure 13.13 once created, your process is listed in kaleo forms admin now it's time to look at how to use workflow processes in the kaleo forms";;
|
the kaleo forms display portlet makes use of the workflow processes that you create in the kaleo forms admin portlet. add the kaleo forms display portlet to a page if you haven't done so yet. any forms available for processing through the workflow can be initiated through the submit new button, as the below figure 13.14 the kaleo forms display portlet to initiate a process in the workflow, click submit new lunar resort the portlet now displays the form you assigned to the first task fill out the form and click save figure 13.15 submitting a new process the workflow now automatically guides the form on to the next step. if you submit a new process using the single approver process created in the section above, it is assigned automatically to the portal content reviewer role. if you are a portal content reviewer, the task then appears in the assigned to my roles section of the kaleo forms display portlet, and you receive a notification in your dockbar. you can then assign it to yourself using the portlet and complete the task figure 13.16 the workflow automatically assigns the task to a specific role.;;
|
as you can see, liferay portal and the kaleo workflow engine combine to create a robust environment for web content management. allow you to manage all available workflows in the portal. portal's workflows by using kaleo forms admin's drag and drop interface. workflows can be managed using the default configuration and gui tools, while more complex workflows can be created to meet the workflow management needs of through this chapter and the previous one, you've taken a look at the various elements of a workflow and been shown how to use those elements to create your own custom workflows. you've also seen how properly to use the various elements of a workflow like assignments and notifications, as well as newer and more advanced features like parallel workflows, timers, and it's not enough to understand each individual step of the workflow process one of the keys to using kaleo workflow is to understand how each step interacts if you understand these relationships, you can figure out which features will work best for your organization. information we've covered on workflows to craft suitable processes for your;;
|
"liferay's reports portlet allows administrators to create reports and schedule in order to work, the reports portlet needs to be combined with an appropriate implementation such as the jasperreports web you can use liferay's reports portlet to create professional reports containing charts, images, subreports, etc. when a report is generated, data is dynamically pulled from liferay's database into a template. into jasper reports via jdbc and jasper reports can be exported to many different file formats including pdf, html, xls, rtf, csv, or xml. and jasperreports plugins are available as apps on liferay marketplace. purchase, download, and install the reports and jasperreports apps directly from your liferay instance's control panel interface or you can navigate to browser, purchase and download the apps, and copy the.lpkg files to your liferay instance's deploy folder once you've installed the reports and jasper reports ee applications, log in to your portal as an administrator and navigate to site administration. applications have been successfully deployed, you'll find a reports admin entry in the configuration section on the left menu figure 14.22 to check that the reports ee and jasper reports ee applications have been successfully deployed to your liferay server, look for the reports admin entry in the configuration section of your site administration page the reports admin portlet has three tabs the reports tab shows a list of all generated reports. the most important features of a report definition are the data source, which determines where to find the data to be displayed in a report, and the template, which determines which information to display and the sources tab allows you to add new data sources which can be selected by report definitions. note your portal's database is automatically set up as a default data source called portal. not appear on the sources tab but is selectable on the form for addingediting a figure 14.23 use the sources tab of the reports admin portlet to define data sources for report definitions. use the definitions tab to define report definitions, generate reports, and schedule reports for generation. use the reports tab to browse through and download generated reports in order to generate a report, you need to a have one or more report definitions to create a report definition, you need a data source and a report if you'd like to use your portal's database as your report definition's data source, use the default data source called portal. like to use a different data source, navigate to the sources tab of the reports admin portlet and click on the add source button. new data source and enter the jdbc connection information for example, to connect to a mysql database called datasource installed on the liferay server, you could use the following credentials click on the test database connection button to make sure that you've entered the connection information correctly. liferay will respond with a success or error message depending on whether or not it was able to connect to the data from the reports admin portlet's sources tab, you can see a list of all the data sources that have been added. permissions to customize who can edit them and you can delete data sources that once your data source has been saved, make sure that your report template is if you're using jasper and need to create a jasper template, consider using a tool like ireport designer or jaspersoft studio to create your template. ireport is built on top of netbeans ide while jaspersoft studio is once you've created a jasper template .jrxml file, you're ready to create a report definition. liferay handles compiling the template, populating the template with data, and exporting the report. information on using ireport designer and on the jasper report lifecycle, please to add a report definition, navigate to the definitions tab of the reports admin portlet and click add report definition. remember that you can use your portal's database as your database by selecting then select a jasper template .jrxml file optionally, you can add report parameters and values to your report definition and they'll be injected into the template at runtime lastly, you can configure the permissions of your by default, new reports, report definitions, and data for this reason, new report definitions are set to be when you've completed your new report definition, now you're ready to use your report definition to generate reports manually or from the report admin portlet's definitions tab, click actions add report next to your report definition. choose any of the following reports formats you can configure email notifications or specific email recipients. notifications just inform users that a report has been generated and provide a link to the report's location in the portal. email recipients actually receive copies of the report as email attachments. you can customize the account from which report notifications and deliveries are sent as well as the messages themselves from the configuration window of the reports admin portlet. generating a report, you can also configure the permissions of the report to be by default, generated reports are site-scoped and are viewable by to configure reports to be generated on a schedule, click actions add schedule next to your report definition from the report admin portlet's you can select a start date and, optionally, an end date. can also select how often to repeat the report generation event as on the add report form, you can select a report format, configure email notifications and email recipients, and configure the permissions of the reports when you're done setting up your report generation schedule, now your reports will automatically be generated on the you can create multiple reports from a single report you can also edit a report definition, configure a report definition's permissions, or delete a report definition from the report admin once one or more reports have been generated, they'll appear in the reports to edit a report's permissions or to delete a report, use the actions button next to the report's name. about a report, click on its name. from the details view of a report, you can download the report by clicking actions download next to the report you can also deliver the report by clicking actions deliver report, choosing an email recipient, and clicking deliver. report file, click actions delete to configure the reports admin portlet, navigate to the reports admin portlet in the control panel, click on the wrench icon at the top right corner of the portlet, and select configuration. the email from tab allows you to customize the name and email address of the account that sends report notifications within your portal. could set the name to reports admin and the email address to the delivery email tab allows you to customize the email message that's sent when a report is delivered to a portal user. is delivered to a portal user, it's included as an attachment to this email finally, the notifications email tab allows you to customize the message that's sent when a report notification is sent to a portal user. case, the report is not included as an attachment; the email message just provides a link to the report's location in the portal installing the reports ee and jasperreports ee apps not only adds the reports admin portlet to the control panel but also makes the reports display portlet the reports display portlet provides the same functionality as the reports tab of the reports admin portlet. the reports display portlet allows users to download or deliver reports but not to add, edit, or delete report figure 14.24 here, the reports display portlet shows only a single report the reports display portlet is intended to be placed within a site's private pages to allow site members to access site-scoped reports. in this case, reports will only be displayed to users that have permission to view the reports. for example, if a guest views a site's public page to which the reports display portlet has been added, site-scoped reports will not be visible; only reports for which the view permission has been added to the guest role will appear in the reports display to create a sample jasper report in liferay, follow this section's instructions. we'll use your portal's database as our report definition's data source and we'll use a simple jasper template that was created using ireport designer save the following jasper template to a file named url somewhere on your machine's file system log in to your portal as an administrator, navigate to site administration, and navigate to the reports admin portlet navigate to the definitions tab and click add report definition for the definition name, enter jasper test leave the data source selection as the default portal browse to and select the url template that you created in step 1, then click save to create your report definition click actions add report next to your jasper test report definition, choose the pdf report format, and click generate navigate to the reports admin portlet's reports tab and click on the report click actions download next to the url file this report should list all of your portal's users, displaying the userid, screenname, emailaddress, createdate, and modifieddate of each user figure 14.25 this reports lists all portal users by userid, screenname, emailaddress, createdate, and modifieddate now that we understand how to generate jasper reports in liferay, let's see what the knowledge base application has to offer.";;
|
"liferay's knowledge base application provides a way to create and organize for example, it can be used to display professional product documentation or form complete books or guides. article source files written in markdown. so you can require articles to be approved before they are published. additionally, the knowledge base application lets administrators create article templates that help users follow a common structure and include consistent kinds here's what the knowledge base can do the knowledge base application is available for purchase on the liferay marketplace. the app, the knowledge base portlet is available in the site administration content section and the following portlets are available at article, knowledge base search, and knowledge base section to navigate to the knowledge base portlet admin portlet page, go to site everything administrators and authors need to create, update, and manage it has three tabs one for managing articles, one for managing templates, and one for managing article suggestions. managing all the articles and article folders in the knowledge base. templates tab is for managing all the article templates. for managing user-submitted feedback figure 14.26 you can manage knowledge base articles, folders, templates, and suggestions from the knowledge base portlet the add selector shows you all the options for adding articles. folder, a basic article, an article based on a template, or you can import selecting basic article or the name of an available template brings up the new article window. article's title in this window, a url-safe version of the title is added to the end of the article's friendly url. the value is displayed and editable in the you create the article's content using the wysiwyg editor. click the source button in the editor to view the html source, or use this view to write html yourself figure 14.27 you can create and modify a knowledge base article's content using the wysiwyg editor you can also add attachments and tags, specify related assets, and set by default, view permission is granted to the guest role, meaning at any time, you can save the article as a draft to continue working on it later, or you can submit it for publication. workflow is enabled for the knowledge base, your article must be approved before the permissions button is next to the add selector in the admin portlet. clicking this button lets you define permissions for the knowledge base application the roles that can adddelete articles, folders, and templates, the roles that can change general knowledge base permissions, the roles that can subscribe to articles, and the roles that can view templates and suggestions note to be able to access the knowledge base admin portlet, a role must have the permission knowledge base access in site administration. be able to add or act on articles, folders, or suggestions, the site administrator must grant the appropriate permissions using the permissions window in the knowledge base admin portlet the interface for adding folders is straightforward. description, and permissions for the folder as you add folders and articles to your knowledge base, notice the actions you can perform on them edit change the folder's name and description move relocate the folder under a new parent folder delete remove the folder and its articles from the knowledge base permissions grant or revoke the following permissions add an article to the folder, add a sub-folder to the folder, delete the folder, move the folder, set permissions on the folder, edit update the folder, and view the folder articles can be created or moved to several places in the knowledge base to the root of the knowledge base, to folders, and they can become children of other here are the actions you can perform on an article edit change the article's title and content and manage its attachments, categorization, and its related assets add child article add a new child article to the article permissions configure the permissions on the article subscribe choose to be notified of any updates to the article. subscribed to an article, the unsubscribe action appears, letting you unsubscribe from the article's notifications move move the article to a different folder or change an article's position in the hierarchy by choosing a new parent article for it delete remove the article from the knowledge base you can also assign new priority values to articles. in the knowledge base display portlet, navigation arranges them priority 1 is the highest priority; think priority 1 the higher an article's priority, the higher it is shown in the to assign new priorities, select the checkbox for each article you want to re-prioritize, enter a new priority value, and select actions note in the articles tab, the actions drop-down is only displayed when one or more article checkboxes are selected. the actions drop-down lets you save changes i.e., priority values to selected articles or delete selected articles the admin portlet's templates tab is for managing templates. you can create templates with default headers or other content to give your articles a starting outline users can work from. templates help foster consistent formatting and content organization for to create a new template, click the add template button in the figure 14.28 as an administrator, you can add a new template to your knowledge base from the knowledge base portlet from the templates tab, you can perform the following actions on a template from here, you can print the template, use it to create an article, edit the template, modify the permissions on the template, or edit change the template's title and content permissions configure the permissions on the template. a role can change permissions, update, view, or delete the template delete remove the template from the knowledge base the admin portlet's suggestions tab shows user feedback and lets you mark progress on addressing the feedback figure 14.29 the suggestions tab in the knowledge base portlet helps you monitor article feedback and mark progress in addressing feedback each suggestion entry provides the link to the associated article, the user's feedback, the user's name linked to the user's home page, the feedback's time stamp, and the progress on addressing the suggestion. entry between new, in progress, and resolved states note to view article suggestions, the role must be granted the knowledge to move suggestions between the new, in progress, and resolved states, the role must be granted the knowledge base knowledge base article users assigned to that role can also view and update the state of article suggestions from any of the other knowledge base application's so far, you've learned how to create, edit, and organize articles. seen how the suggestions feature lets you and your users collaborate on your the next topic for discussion is the knowledge base application's portlets that display articles, their navigation, how to aggregate articles for viewing, and finding articles. the markdown source file importer the knowledge base display portlet is how you publish articles. the portlet's configuration menu by clicking the gear icon in the top right corner of the portlet and selecting configuration. box's setup tab, there's a general sub-tab that has an article folder clicking the select button lets you choose an existing article or folder of articles to display in the portlet. a folder of articles to display and click save, the navigation in the left side of the portlet displays links to all of the folder's articles, and the viewing area in the right side of the portlet displays the folder's leading article the priority one article figure 14.30 the knowledge base display portlet's navigation and viewing area facilitates viewing article hierarchies the display portlet can display hierarchies of articles. link in the navigation displays the article in the view area. to an article that has child articles expands the navigation tree to show the expanded nodes naturally collapse when you click on a different top level article. below the article content are links to navigate to the next or previous article. would expect, highlighting the link of the article you're viewing, and the tree nodes expand and collapse appropriately links at the top of the portlet let users subscribe to an rss feed of the knowledge base, subscribe to the current article, view its history, or print it if your portal administrator enables the knowledge base application's source url feature and an article has an assigned source url, an button appears to the right of the article's title; it gives users access to the article's online this feature can be used to encourage users to contribute fixes if you're interested in using this feature, you can direct your portal administrator to follow instructions in advanced configuration below the article's content is the rating interface, showing thumbs up and users can also click the link do you have suggestions? and submit suggestions or comments for the article. suggestions and mark progress using statuses in progress and resolved administrators can perform the following actions on articles edit change the article's title and content, or manage its attachments, move relocate the article to a different folder or change the article's position in the hierarchy by choosing a new parent article for it the display portlet provides common liferay application configuration options, including ones for look and feel, exportimport, permissions, scope, as an administrator, say that you've used folders to aggregate similar articles, and you want to provide an easy way for users to switch between these sets of the content folder feature lets you add a selector to the top of the display portlet's navigation that lets users switch between sets of here's what you do to set up content folders a content selector appears at the top of the knowledge base display its values reflect the names of your content folders figure 14.31 the knowledge base display portlet's content folder feature lets users switch between different sets of articles example content folder and article structure you can also add a common prefix to the content names shown in the selector. enter a common prefix, bring up the display portlet's configuration dialog box, navigate to the setup display settings tab, enter the prefix into the content root prefix field, and click save. for the example folder and article structure listed above, you could apply a common prefix lunar rover to produce content selector values as shown in figure 14.13. you like as a root content prefix or you can leave it blank this is how the knowledge base display portlet publishes articles. learn how to use the knowledge base article portlet to show articles the knowledge base article portlet can be placed on a page to show a single the article portlet even shows abstracts of an you can add any number of article portlets to a page and each one can display a different article. when you first place this portlet on a page, it shows the link please configure this portlet to make it visible click the link and click select article to choose an article to pick an article and then click save. displays the article in the portlet figure 14.32 the knowledge base article portlet is great at individually displaying articles the knowledge base article portlet allows users to rate and comment on the links at the top of the portlet let users subscribe to an rss feed of the knowledge base, subscribe to the current article, view its the knowledge base section portlet lets you selectively show articles associated with a specific topic section. for example, a news site might have a world section, a politics section, a business section and an entertainment multi-select boxes in the add article and edit article screens let you define sections articles belong to. you can add any number of section portlets to a page and each one can display articles from any number of sections. sections, a portal administrator must configure the feature in the knowledge base once the feature is enabled, he or she must specify in the properties file any section names you want to use. section explains how to configure the sections feature in the portlet figure 14.33 here's an image of knowledge base section portlets being displayed on a page the knowledge base section portlet can be configured with different display additionally you can define an article window state maximized or normal, how to order the articles, how many articles to display per page, and whether or not to show pagination wikis often have deeply nested articles that can be hard to find by browsing. the knowledge base's ability to show the structure of articles makes it but this often isn't enough, and that's where enter the knowledge base search portlet figure 14.34 the knowledge base search portlet helps you search the knowledge base for keywords the search portlet helps you find articles that match keywords you specify next you'll learn how to create new articles and update existing articles by importing them from markdown source files as has already been stated, the knowledge base application can import articles this lets you have an offline process where articles are prepared ahead of time before they are published. the file format for the articles is markdown markdown is a text-only file format that is designed to be easy to read, yet support all the things you'd need to do to format your articles. something of a standard there's github flavored markdown, forums that support markdown reddit, stackexchange, and others, markdown editors, and an ietf draft for making it an official internet media type why is there so much interest in markdown even if you don't know markdown, you can read it without having to filter out the syntax you don't have to worry about mousing to various icons to change text into a heading or create bulleted lists. there are tools to convert it to many other formats, though it was designed if your articles are in markdown, it's straightforward to publish them to the web, mobile formats kindle, epub, and print since it's only text, you can use existing tools to collaborate on that using services like github, people can contribute to your articles, and you can see all the changes that have been made to them the knowledge base supports a markdown dialect known as extends the original markdown with features like table formatting, image for the knowledge base to import your markdown articles, they must adhere to below is markdown source text for a simple example article in the first line above, notice the header's id assignment on import, the id value becomes the url title of the also note that the referenced image file url resides in a folder called images when you're finished editing markdown files that you want to import, zip them up with their accompanying image files markdown files can be specified anywhere in the zip file's directory structure. they can be nested in any number of folders. no other kinds of references are supportednot even in addition to the source files and images, you can pass to the importer a base source url property that specifies your source file's online repository each article's edit on github button if enabled takes the user to the importer prefixes each file's path with the base source url to construct a url to the article's repository source location; it looks here's an example base source url the source url constructed from the above base url and article source file url from the example basic zip file would be this you specify the base source url in a file called.metadata in the zip file's the importer treats the.metadata file as a standard java properties file and uses the base source url to construct the source url for all of the zip file's resulting articles. to use the source url feature, your portal administrator must enable it via the knowledge base application's portlet the importer also supports a two level hierarchy of articles and can assign article priorities based on numerical file prefixes. example showing a zip file structure that leverages these features advanced zip file structure example to designate an article to be the parent of all other articles in the same source folder, end its file name with url. using this convention, the above zip file specifies url as the parent of its neighboring markdown to designate an article's priority using its source file, add a numeric prefix this prefix must be greater than zero. priorities for articles imported from files named url and when importing, keep the checkbox labeled apply numerical prefixes of article files as priorities selected. file doesn't have a prefix, its article gets the next available priority i.e., the highest current priority, plus one. advanced example's resulting relationships and priorities in the above advanced zip file structure example, notice that the url files have the prefix 00. with 00 so that they're listed at the top of the folder's file listing on your the real trick is that the importer uses the prefix of such a file's folder as its knowledge base article priority. here's the underlying logic if a file has prefix 00, the importer assigns the resulting article's priority to a top-level intro file, however, gets special treatment if its prefix is less than 1.0, the importer checks the intro file's folders for a prefix of it then sets the intro article's priority to the first folder prefix found that is 1.0 or greater. this convention lets you specify priorities for top-level non-child articles in your hierarchy once you have your article zip file, it's time to import it. click on add import to bring up the importer page. location of your file, and in most cases leave the checkbox for the article priorities checked, and then click save. importer converts each source file's markdown text to html, applying the html to any image files that are included in the zip file and that are referenced in an article source file are imported as attachments to the figure 14.35 selecting add import in the knowledge base portlet brings up the interface for selecting a zip file of markdown source files and images to produce and update articles in your knowledge base what happens when i import an existing article? if the source file's leading header id e.g., some heading idsome-heading matches the url title of any existing article in the knowledge base folder. match is found, the importer replaces the article's content with the incoming content converted from the source file. if no match is found, a new article is do i need to import all of a knowledge base folder's articles, even if i only want to create a new article or update a subset of the folder's current you can import as many or as few new articles and modified does the importer remove articles? it doesn't delete any existing articles. you must manually do so via knowledge base portlets can i update an article's priority? prefix convention and re-import the article to update its priority if i change an article's title, should i also change it's header id? depends on whether you've already published your article. published, then there are no public links to it, so it's fine to change the header if the article is already published, you must decide whether it's worth breaking existing links to the article and worth having search engines rediscover and re-rank your article based on its new friendly url, which is congratulations on mastering the art of creating and importing markdown files to next, portal administrators can learn how to override the knowledge base portlet application's portlet properties to enable and configure some advanced, but the knowledge base application has several optional features that are disabled these include source url, import file conventions, new article priority increment, and sections. here you'll learn how to configure these features by overriding the knowledge base app's portlet properties. configuration should only be performed by a portal administrator, as the person modifying the configuration must have access to the downloaded knowledge base application and be comfortable with repackaging applications and installing the modified knowledge base app using the control panel important advanced configuration of the knowledge base application should only be performed by a portal administrator next, you'll learn about the knowledge base app's portlet properties, how to override the default values, and how to deploy the result to your portal to start, create a file called url to hold the settings for the property values that you want to override. url file open in an editor so you can add values as you go source url properties defines the source location of importable markdown this is intended to point to an online source repository where the files github is assumed as the default. once defined, the knowledge base displays a button default label is edit on github above each displayed users can click the button to navigate to an article's source location. to enable this feature, specify the following property setting to override the button's default label edit on github, specify a new label as practice is to specify the value as a language key. you could specify that language key as the button's new label you can alternatively specify that label explicitly like this importer file convention properties these properties define the supported file extensions, the suffix for parent files, and the image folder's path within you can modify the supported file extensions you can change the article parent file suffix you can modify the image folder path the importer looks for in the zip file new article priority increment property by default the priority for new articles is incremented by 1.0. to disable this increment so that articles get a flat value of 1.0, specify the following setting section names property the section names property lets you specify names of arbitrary topics to attribute to articles. sections portlet, you can display one or more sections groups of articles. to make section names available, you must specify them in a comma-separated specify them as a list of values for the property this creates the sections business, politics, and world next you'll learn how to deploy your customized properties your custom properties must be deployed with the knowledge base application. do this, you'll have to extract the application, place your file in the proper location, re-package the application, and then deploy it don't worry; that's much easier than it sounds the knowledge base from liferay marketplace. extract the.lpkg file any utility that handles zip files works. extracted contents include the app's.war file extract the.war file to access the application's files add your url file to the portlet project folder repackage e.g., using the jar executable or a zip tool the portlet project's folders and files into a.war file in your portal, navigate to control panel apps app select file upload, select your.war file, and click install to deploy your deployed application now uses the settings you specified in your congratulations on deploying your advanced you've learned the benefits of publishing articles using the knowledge base you've seen how easy it is to create, organize, and manage articles, and you've learned various ways to present articles in the knowledge base display, knowledge base article, and knowledge base section portlets. can consider yourself to be truly knowledgeable of liferay's knowledge base";;
|
liferay portal also provides integration with twitter via the twitter app on twitter username with the app, your tweets are shown in your activities portlet make sure that you get the appropriate version of the app for your liferay instance. the twitter ce app is intended for liferay portal ce, while the twitter ee app is intended for liferay portal ee there are two ways to register your twitter username with the app after you the first is through the twitter portlet after you add it to a page. click the link in the portlet and then enter your twitter username in the alternatively, from the dockbar select user my account social network and then enter your twitter username in the twitter figure 10.29 register your twitter account it's important to note that your tweets are displayed only in an activities if you want your tweets to show up on a page, there must be an also, you need to wait a few minutes after registering your twitter username for your tweets to show up. activities portlet shows your tweets in order according to the date and time therefore, if you haven't tweeted in a while, then your tweets might be pushed off the activities feed by more recent you can change the number of items shown in the activities feed in the figure 10.30 your tweets are displayed in an activities portlet.;;
|
"when creating custom lists and data definitions, you can control not only how the input form appears to your users but also how the list itself displays. eventually you may realize you need to create another sign-up sheet but you don't need the same level of detail provided by the volunteer sign-up data liferay empowers you to customize both the input and output of your lists to unlimited levels. dynamic data lists provide two areas to customize form templates and display templates. lists form templates , as well as the display of the list contents display the default data entry form is the entire data model you created in a data definition, including required and optional fields. using a data definition will see every item in that definition on the input what if, however, you want a quick sign-up form to find out who's coming using a form template you can customize the form's display you can limit the fields displayed for entry or change the to access and create new templates, go to the dockbar and data definitions, then click on the actions button next to your data definition of choice and select manage templates. template, you're presented with the same kind of graphical, drag-and-drop interface used for creating the data definition. unwanted fields from view and save when ready note form templates were called detail note that data definitions can have multiple templates. template you want to use for display in either a dynamic data list display or a dynamic data list form portlet see below. you should create as many templates as you might need, and you can prototype them in the portlets to see how each now your friends and enemies alike will be impressed with your url skills. it may look to the untrained eye like you've single-handedly created three or four different data types for your lists but you know better. that form templates provide, using one data model that encompasses the maximum information you might need like preferred activity, favorite color and ideal then you quickly churned out four different form templates with a now that you have such a vast amount of data collection options, how will you display them? however you want, as you're about to find for every data definition, you have an unlimited number of displays you can if you created a special thanksgiving dinner sign-up list using your volunteer sign-up definition, you wouldn't want to confuse fellow listies by displaying data fields you never asked for. preferred task? a friend might say, i don't remember seeing that on the sign-up form! embarrassing situations, you should create a custom display to match that list. taking it even further, you could provide a fancy, javascript-driven image carousel preview of all the attendees of the party. other displays and be another bragging right on url. give you the power to do all this and more note display templates were called list just like form templates, display templates are found in the manage templates with display templates you can customize the display of a list in precisely the same way as you can customize web content. display templates can be written in freemarker or velocity, pulling data from the data definition in the same way that web content templates pull data from also similar to web content templates, display templates can be embedded in other display templates. this allows for reusable code, js library imports, or macros which will be imported by velocity or freemarker embedding display templates provides a more efficient process when you have a multitude of similar data definitions. embedded display template and work off of it for your new display template. we'll look at a simple example, but for more information on using template scripts to pull data from a backing structure, see web content templates in the first thing we need to do is create a new display template for our as with many other features in liferay, there are multiple ways to do this, depending on your context from the dynamic data list display portlet navigate to the page with your ddl display portlet and make sure your list is selected in the portlet's configuration find the add display template icon on the bottom-left corner of the portlet window and click it to create a new template. if you don't see the icon, sign in as a user with permission to create templates from the dockbarcontrol panel navigate to dynamic data lists manage data definitions find your data definition in the list, then click actions manage now you can click on add display template to create a new template fill out the form with a name and a description. just like web content templates, you can choose between freemarker or there is no functional difference between the two. script language, you can upload a template file or use the display template editor to type in a script manually. inside the editor, you have access to a palette featuring common variables related to your selected template language. additionally, you can hover your pointer over a variable in the palette for a to place a variable into the display template code, position your cursor where you want it placed, and click the variable name in another useful tool in the display template editor is the in a freemarker template, it can be invoked by typing which opens a drop-down menu of common variables. variables, the editor inserts the variable into your display template code we want to write a freemarker template to give us a summary of who is helping on to do that, we need to access the records for the list and pull out the name and task for each volunteer. access to a number of helper variables to find out what records we have access inside a template, these variables give us the id for the record set that contains all of the volunteers in our list, as well as the name, description we can easily retrieve all the records through a service to gain access to this service, we need to use a helper utility called servicelocator that retrieves an instance of the once we have the service, we can retrieve the list of records accessing the service with the servicelocator can be done with the following line of code to use the servicelocator variable, you must enable it. liferay portal restricts the servicelocator, along with the objectutil, staticutil, and utillocator variables, in the url file. here are the default property values to use the servicelocator variable in freemarker templates, for example, you must remove it from the url property value list, save to a custom portal properties file e.g., url , and restart the server. now that all that is taken care of, we store a handle to our service in ddlrecordlocalservice so we can use the service to retrieve our list of volunteers now that we have our records, we can iterate through the list and display the data from each record that we want to show. to access a field from a record entry such as the volunteer's name, we call the getfieldvalue method and each dynamic data list record has a number of other similar methods see the url.ddlrecord but you'll probably use getfieldvalue most often. now all we have to do is set the results in some appealing way. we've made it very simple by using an unordered list for the results . here is the complete source for the template once you've typed the template's source into the editor window, click save to with the display template selected, your list display can now be a summary of tasks as shown below figure 11.7 this display template provides a list of users who've volunteered along with the tasks for which they volunteered all the knowledge you have accrued through building out your award-winning content can be brought to bear in display templates. freemarker or velocity templates at your fingertips, you have easy access to all the data in the list, as well as the full complement of helper methods and the alloy ui javascript library to make easy work of dynamic displays if you're not a listie and you happen to be deploying custom lists in an environment that requires approval from other users, then it's not enough to just create the list and display a form. what you need is a real integration workflow integrates smoothly with dynamic data lists liferay integrates the powerful features of workflow and the data capabilities of dynamic data lists in kaleo forms. workflow is not enabled in the dynamic data list portlets by default, so you can focus on the core task of building custom forms backed by a data list. after this is done, you can deploy custom workflows to the form and its data. though kaleo forms is only available in liferay ee, you can still apply a workflow to a list when creating it in liferay if you don't have a workflow engine installed, you need install the kaleo web this plugin is included in the kaleo workflow ce and kaleo workflow ee apps which are available from liferay marketplace. kaleo workflow plugin, just copy the plugin.war file to the deploy folder of once workflow is installed, you have a new option when figure 11.8 once the workflow plugin has been installed, you can choose a workflow when creating a new dynamic data list choose the workflow you'd like to use. this requires that every record must pass now if you need to preview or edit entries as they're coming in, it's easy to integrate it into your daily workflow kaleo forms ee is an app that provides you with greater control over the list the kaleo forms ee app is available from liferay it includes both the kaleo designer portlet and the kaleo forms the kaleo designer portlet provides an easy-to-use ui that helps streamline the creation of workflow definitions. you create web forms and basic applications. these applications together, you can create workflows that govern the processing for lists to appeal to companies all over the world and make your new site not just a resounding success but attract profitable businesses, business users must be able to control the workflow of list entry and review those entries when there should also be a cool dashboard you make all of your changes. kaleo forms, users can create lists that follow a workflow, called a process, or create new entries in a process. creating a new process is easy, defining processes that must be followed in data collection and entry is a historically, this hasn't been fun or easy but kaleo forms makes it as easy as possible. a process is just another way to describe a workflow that's imposed on a list. portlet on a page, you are presented with a dashboard with two tabs summary the summary view shows an inbox view which shows tasks that are assigned to you and tasks that are assigned to your roles. lets you view your pending requests and your completed requests. definitions have been defined, you can submit records to a list from the summary the processes view allows you to add process definitions and manage ones to build a list in kaleo forms with a workflow add the kaleo forms portlet to a page within the kaleo forms portlet, click on the processes tab click on add process and a form appears enter a name and, optionally, a description. your users understand the purpose of this process select the appropriate list, workflow and forms you want to use in this click save to save your process figure 11.9 when using the kaleo forms portlet to create a new workflow process, you need to complete this form while the form looks complicated, it's easy to complete. that make up a process and when you click on one, you can browse a list and select the appropriate piece to insert the first part of a new kaleo process is also the simplest one the entry this is just another way to refer to a data definition. available data definitions can be chosen, including our awesome volunteer just as with normal data lists, you can always create a new entry definition from the list view by clicking add one of the advantages of using kaleo forms to present your list as a process is that it grants you complete control over the form template. default template, which displays all the fields from your entry definition. you can also, however, create multiple form templates for use in different when you create a form template, you can specify what create create mode gives a display for creating the initial entry. first stage of any workflow requires you to create a new entry, so the initial form template must be a create mode form. all fields marked required must be edit edit mode is used for any stage of the workflow process. instance, you might want to separate information that need not be saved from other stages in the workflow could be a great place to required fields can be absent from once you have chosen an initial display template it must be a create mode template, not an edit template, all that's left to do is configure the workflow you can now select a workflow to apply to your new list-defined process. the available workflows can be chosen. you can also create new ones from the simply choose add workflow and a workflow designer screen appears allowing you to define a new workflow by dragging elements in a flow figure 11.10 you'll see this form when editing or creating a new workflow with kaleo designer we'll keep ours simple; just choose single approver definition. a starting point entry creation and a review task, which we can use to add additional information in a secondary form many workflows offer the option of having multiple editorial and review stages. during these stages, you might want to offer different forms that allow the user to add more information to the entry. kaleo forms offers you the opportunity to fine-tune the stages of workflow to use different forms from the view to assign forms to tasks choose the workflow task by clicking on it. in the details pane on the left-hand side there is a property called forms. start typing the name of a form template and it appears click save to save the form assignment figure 11.11 when creating or editing a kaleo process, click assign under workflow task forms. then click on a task, such as review, from the graphical view. look for the forms property in the settings tab; you can use this property to assign a form template to a task you can assign forms to as many tasks as you need until you're satisfied with after this stage, save the process and it's ready to be used in once you have a new kaleo form process, you can add new entries through the once the form is filled out and submitted, it enters the workflow you selected for the process figure 11.12 when adding a new entry to a process, you're presented with the process's configured form template for the initial display after you have created an entry, depending on the configured workflow the next task in the workflow may have an additional form to complete. next to the entry in progress, click the actions button after the new entry has worked its way through the entire workflow, it is added the owner of that data set who created the kaleo process can view and edit the entries collected if you are a listie, or a url developer, you're now prepared to show your that is, in fact, the reason you created url in the";;
|
liferay's kaleo workflow engine can be installed for both ce and ee versions of the web plugin's name is kaleo-web and is bundled in the kaleo forms ee and kaleo workflow ce apps on liferay marketplace, which you can access through the apps section of the control panel. adds a workflow option under the configuration section of your control the kaleo-web plugin comes bundled with one worfklow called the single this workflow requires one approval before an asset can be one of the conveniences of using liferay's workflow engine is that any roles specified in the workflow definition are created automatically when this provides a level of integration with the portal that third party engines cannot match. contains three roles, each with different scopes. each role by its name site content reviewer, organization content reviewer and let's jump right in and create a workflow process definition.;;
|
"all your global workflow configuration can be done via the control panel. everything you need to do in the portal can be done through simple gui figure 12.3 adding a workflow definition you can find the workflow section under the configuration heading in the there are three tabs under workflow which are used to configure workflow in the portal definitions, default configuration and these tabs let you upload definitions, enable workflow for your portal's resources, and the default workflow behavior you specify here will apply throughout your liferay portal from the definitions tab you can see the currently available workflow definitions and add newly created workflow definitions you'd like to use in the clicking upload definition allows you to enter a title for a new workflow definition, browse to your local xml file, and upload it to your once you add a file here, it's added to the portal and is under default configuration, you can set the workflow behavior for all workflow-enabled actions in the portal; available resources include page you can also add a custom potlet to this list by you can choose from two default workflow options in default configuration no workflow or single approver, which we looked at in detail earlier in the chapter when you set the default workflow configuration of a resource, any new action on that resource defaults to that configuration, throughout the portal. administrator can edit the workflow behavior for each site's resources individually through the workflow configuration section of a particular site's site administration section. the interface for making changes at the site level is similar to that of the control panel interface; the only difference is that you are in the site administration section and the changes you specify are only applicable to the scope you have selected here in the submissions tab you can see any currently pending assets or any assets let's learn more about configuring workflows for both the portal and individual after you have uploaded workflow definitions and set the default workflow behavior you can go up to default configuration and enable workflow for specified actions in your portal figure 12.4 the workflow configuration page by setting default workflow configuration behavior from the control panel, your specified settings are implemented at the global portal scope. set the workflow configuration for a specific site, you can do so from the you can get there from the control panel by clicking sites, clicking on a site from the list, and opening the the workflow configuration option lets you modify workflow behavior for the sleected site's resources that can be workflow my workflow tasks is a personalized version of the workflow tasks and it's found in the user's my account section. here you'll find specific tasks which were assigned to you or assigned to a role of which you are a member. view your completed tasks by opening the completed tab figure 12.5 my workflow tasks page workflow administrative users review and approve content from their my worfklow by clicking the link to the asset, you can view it, and the actions dropdown lets you approve, reject, or reassign assets assigned to you. for assets assigned to your roles, you can assign the listed assets to be reviewed by yourself or another user. whether or not an asset is assigned to you or to your role, you can update the due date as well my submissions is found in your user's my account section of the portal. this screen you can view any assets you have submitted for review. currently under review are listed under the pending tab and those that have been reviewed are listed under the completed tab figure 12.6 the my submissions page besides viewing your work, you can also withdraw a submission from the review process by clicking on withdraw submission from the pending tab before workflow can be used, you must define which types of assets on the portal if you have created additional definitions, you must also choose the workflow definition to use for each asset that is workflow-enabled figure 12.7 you can select which site to work on by using the drop-down menu in the site administration section of the portal to demonstrate how this works, we'll create a press release. should be posted in the newsroom section of the web site, so before setting specific workflow configuration options or creating content, create the when you click save, you'll be redirected to the site administration section of the portal where you can work on the newsroom site under configration, in workflow configuration, set web content to use next, create two users, a content creator and a content reviewer. creator logs in and creates a new press release for the lunar resort and clicks this triggers the workflow process and notifies the when the content reviewer logs in, he or she can assign the workflow task to him- or herself and approve the content figure 12.8 before a content reviewer can approve content, he must assign it to himself or have an administrator assign it to him once the content is approved, it can be posted on the press releases page in a ee customers get extra features that enable them to create workflows without having to deal with xml.";;
|
above we saw an example of using workflow with liferay web content. is the same for all resources that are workflow-enabled. configuring your resources to use workflow in the default configuration tab of the workflow section, you may have noticed a note that the workflows for the following resources can be configured within their respective portlets. resources listed are documents and dynamic data lists records. configuration is more specifically enabled for documents and media folders and dynamic data lists i.e., each individaul list to see how this works for a documents and media folder, create a new page in the default site called documents and media and add the documents and media then click add folder, enter the name my mouse over your new my documents folder, click on the black arrow that appears at the top right corner of the folder, and select figure 12.9 workflow for documents and media must be enabled at the folder level. edit a folder to select a workflow by default, the use document type restrictions and workflow of the parent to enable workflow for this folder, select the define specific document type restrictions and workflow for this folder after you've selected this button, a default workflow for all document by default, you can select no workflow or any custom workflows that you added also appear in this you can add custom workflows through the workflow page in the portal section of the control panel figure 12.10 you can use the document type restrictions and workflow of the parent folder or you can define specific document type restrictions and workflow for this folder after you've selected the single approver workflow and clicked save, workflow takes effect for the my documents folder. your my documents foldernotice that the publish button now says submit for publication since workflow is enabled. any users assigned to the portal, organization, or site content reviewer roles can see that your document has been submitted for publication by navigating to my account and clicking on my ordinarily, the same user who submitted a document for publication wouldn't also approve it but we'll do this to demonstrate how the like with documents and media folders, workflow is configured for a dynamic that is, when you add a new list for users, you can enable workflow for that particular list. setting, but you can select the single approver definition or any definition you uploaded to use in the portal. when a user submits an item to a list that was configured to use a workflow, they'll see the item's status as pending. once the list item has been approved by an administrative user, the status navigate to the my account and click on my workflow tasks. lists that you submitted for publication appear under assigned to my roles click actions assign to me next to then click actions approve next to the document or list when it appears in the assigned to me category. resources have passed through the workflow!;;
|
"as of liferay 6.2, liferay no longer includes the core calendar portlet that was included in liferay 6.1 and previous versions. instead, liferay provides a new the new calendar portlet upgrades several features of the old calendar portlet and adds additional features. features you're used to from the old calendar portlet are still available. can add events and configure email notifications. portlet as a shared calendar for an entire site or as a personal calendar. content created through the old calendar is imported automatically by the some of the new features include an improved look and feel, more configuration options, the ability to assign multiple calendars to a site or user, the concept of calendar resources, and event invitations once you've added the new calendar portlet to a page, open its configuration dialog box by clicking on the gear icon in the portlet's title bar and the setup tab provides two sub-tabs of configurable settings user settings and rss figure 9.8 the setup user settings tab provides several new configuration options that weren't available from the old calendar portlet user settings on this screen, you can customize your calendar's default you can set the time format to ampm or to 24 hour. ampm is the default; with this time format, times such as 8am or 11pm are with the 24 hour time format, these times are displayed as 0800 default duration refers to event duration. to the calendar, the time you set here specifies how long events last by you can set the default view to day, week, or month. set week starts on to sunday, monday, or saturday. can either specify a particular time zone like pacific standard time or china standard time or you can check the use global time zone box. use global time zone, the time displayed by the calendar portlet depends on whether it's being viewed by a guest or a logged in user -if a user is logged in to the portal, the calendar portlet displays events using the time zone set for the user in my account display settings time zone. -if the calendar portlet is viewed by a guest, or by a user who is not logged in, the calendar portlet displays events using the time zone set by the portal next, let's look at how to use the new calendar portlet the first thing you'll notice about liferay's new calendar portlet is its there's a monthly mini-calendar which provides you with an overview of upcoming events. there's also a larger, more detailed calendar you can set the large calendar area to display a day, week, or month the day view displays a day as a single column, divided into hours and the week view is similar but displays seven days as seven columns, divided into hours and half-hours. the month view displays a traditional calendar view with days represented as boxes. in the previous section, we saw how to configure the default display view of the calendar you can add new personal or site calendars from the default view of the new calendar portlet and choose which calendar's events to display. personal or site calendar, mouse over my calendars or current site calendars, click on the arrow icon, and select add calendar. personal or site calendars, navigate to the same drop-down menu and select all users can manage their personal calendars. only site administrators can manage site calendars on the manage calendars screen, you can click add calendar to create a new as usual, you can enter a name and description for the calendar and flag the default calendar checkbox if you'd like the new calendar to be the default calendar. sites, have a default calendar. when a calendar is first visited, the events from the default calendar are displayed. you can customize the events that appear in the main area of the calendar portlet by clicking on the colored boxes corresponding to the calendars. when you click on a colored box, its color disappears and the events of that calendar are no longer displayed. uncolored box to view the events of the corresponding calendar figure 9.9 you have options to add or manage calendars. also, you can toggle the colored boxes beside your calendars to showhide your planned events when adding a calendar, you can also specify whether or not to enable comments and ratings for your calendar's events. enableddisabled on a per calendar basis. additionally, you can specify a color for your calendar. new calendar will default to the color you choose you can edit a calendar to change its name, description, or color. change the calendar's default calendar status and flag or unflag the enable comments and enable ratings checkboxes to enable or disable comments and ratings for a calendar's events it's very easy to add events to a calendar just click on any day of the calendar and you'll see an event creation popup appear. day or month view, you can click on the specific time when your event figure 9.10 when you click anywhere on the calendar, you'll see the event creation popup appear. click edit to specify details for your event in the new event popup, you can select the calendar in which you'd like to this is useful since sites and users can have multiple you can click save to create the event right away or you can click edit to specify more event information figure 9.11 you can specify event details such as the event title, start date, end date, description, location, and more the title you enter determines the name of the event as it's displayed on the the start date and end date times determine when your event takes you can click on the date text box to change the day and you can specify times by selecting a particular hour and minute of the day. the day and week views of the calendar break days into hours and half-hours and display events in these time-slots, that's just for convenience. to specify whatever start times and end times you like, such as 1137am and check the all day box if your event lasts for an entire day. the repeat box if your event takes place over multiple days. figure 9.12 the repeat box allows you to specify whether an events repeats daily, weekly, monthly, or yearly, how often it repeats, and when or if it ends in the details collapsible section, you can specify four pieces of information. under calendar, you can select the calendar to which you'd like to add your remember that sites and users can have multiple calendars. description, you can explain the purpose of your event and add any details that you think might be useful. use the location field to specify where your lastly, the viewable by field lets you set the permissions for more advanced permissions options, select the more options link. roles for which you can permission appears in the left column. represent permissions which can be configured for the event discussions refers to comments on the event. discussion, and update discussion permissions determine whether a role can add, delete, or update a comment on an event. the permissions permission determines whether a role can update an event's permissions in the invitations collapsible section, you can invite users, sites, or other calendar resources to an event. to invite a user, site, or resource, start typing the name of the entity you'd like to invite and a list of matches select the one you want or hit enter if the entity you'd like to invite is at the top of the list. all the entities you've invited to your event appear as a list under the pending heading, which shows how many pending if you accidentally invited the wrong entity, mouse over its name in the pending list, click on the arrow icon that appears, and click if you'd just like to check the status of a resource, click on check when you click on check availability for a calendar resource, its schedule is displayed in this calendar view. overview the availability of all the invited entities, just click on resources figure 9.13 you can invite users, organizations, or other calendar resources to your event and can check their availability in a calendar view the reminders collapsible section lets you specify up to two times when event reminder notifications will be sent via email. might like event notifications to be send one day and one hour before your email is currently the only supported event notification type. confusion, the event time in notification emails is shown in the user's time zone, and the time zone is also displayed. calculate this properly if both the portal's and the user's time zones are set users should set this for themselves when they create accounts. set the portal's time zone, see the section the categorization and related assets collapsible sections let you tag the event and select related assets, respectively. by tagging your event, it will come up in searches related to that specified tag. in addition, related assets including blogs, message boards, web content, calendar, bookmarks, wikis, and documents can be selected to include with your calendar event. liferay's calendar portlet supports social activities. is added or updated, a corresponding social activity notification is created. the event was added or updated in a calendar that the current user has permission to view, the social activity will be viewable in the activities if the social networking portlets have been installed they're available as an app on liferay marketplace; search for social networking ce or social networking ee , the social networking notifications will also appear in all the appropriate portlets, such as the friends' activities or members' calendar administrators can customize the email notification templates for event invitation and event reminder emails. open the calendar's calendar settings window by clicking on the small arrow next to the calendar's name in the default view of the calendar portlet and selecting by default, the general tab of the calendar settings appears, where you can edit the calendar's name, description, color, default calendar status, and whether or not calendar events and ratings are enabled or click on notification templates at the top of the screen to view a then click on either invite email or reminder email to customize event invitation or event reminder emails. you can customize the name that appears on the sent emails, the address from which to send the email, the subject, and the body of the email. as with liferay's other other email notification templates e.g., the message boards' notification email templates, a definition of terms appears below the email body editor. terms list specifies variables that you can you can use when customizing the for example, eventlocation represents the event location, eventstartdate represents the event start date, and eventtitle figure 9.14 the calendar settings notification templates tab lets you customize the email templates for emails that are automatically sent out to remind users of upcoming events or invite users to new events to respond to an event invitation, you can click accept, maybe, or decline when viewing the event in the calendar portlet. notification emails contain links to their corresponding events. users easy access to events in the calendar portlet so they can respond to event you might be wondering, it makes sense to invite users and organizations to an event, but what about other calendar resources? calendar resources can represent just about anything that you think might be important to an event. department might have a limited number of rooms and projectors to use for you can add the various rooms and projectors as calendar resources and add them to events. this way, when new events are added, the event organizer can check the availability of important resources against events that so, how can you add new calendar resources? have noticed that the new calendar portlet has two tabs in the main portlet window calendar and resources. click on the resources tab of the portlet to view, edit, add, or delete resources figure 9.15 click on the resources tab of the portlet to view, edit, add, or delete resources click on the add resource button to add a new calendar resource. able to enter a name and description for your resource, specify whether or not it should be active, apply tags and categories, and configure its permissions once you've created a calendar resource, you can click on the actions button next to it and select one of the following four options edit, permissions, the view calendars option exists since calendar resources, like sites and users, can have more than one calendar associated with click actions view calendars and then click on add calendar to add a new calendar in which the selected calendar resource appears figure 9.16 click on add calendar to add a new calendar in which the selected calendar resource appears liferay's new calendar portlet provides an easy-to-use scheduling tool. and users can have multiple calendars, calendar events can include calendar resources and calendar resources have their own schedules of availability. hope this flexible system meets the needs of your organization liferay's calendar portlet allows data to be exported or imported as lar files. both calendar events and resources can be exported or imported. files, data can only be imported into a version of liferay that's the same as the one from which it was exported. to access the interface for exporting or importing calendar data, click on the gear icon in the portlet header and by default, the export tab appears which allows you to define a new export process or use an existing one to export calendar data. you'd like to import data, click on import. import process by selecting an existing lar file or by using an existing import to define a new export process, you first have to choose a name for the lar file url is an example of a typical notice that by default, a timestamp is included first you have the option of including the configuration of next, you have to define a data range. select all to export calendar data regardless of when it was created or last alternatively, you can specify a data range. calendar data which was created or modified at or after the start date and before the end date will be exported. next, you can choose which kinds of calendar data to export calendar events, resources, or both. kind of calendar data, you can choose to export associated comments, ratings, or finally, you can choose whether or not to export the permissions defined for the specific calendar portlet window from which you're exporting data. export to export your data into a lar file. you should see a message stating your request completed successfully and you'll be able to click on the lar to define a new import process, click on import from the export import then either drop a lar file into the box outlined by the dashed lines or click on the button to browse to and select the lar file to import. selected, you'll be able to choose whether to import calendar events, resources, or both and whether to import the comments and ratings associated with these you'll also be able to choose whether or not to import the permissions for the calendar portlet window from the lar file. you've made these selections, click continue and you'll be able to choose a you must also specify an option for assigning ownership of the imported data in liferay 6.1 and previous versions, an older version of the calendar portlet was included as one of the core portlets. if you're upgrading from liferay 6.1 or a previous version to liferay 6.2 or a later version, all the calendar events that existed prior to 6.2 will still be available after your upgrade. steps for upgrading liferay, all you need to do to access previously added events is deploy the new calendar portlet. calendar to confirm that the upgrade succeeded you should be able to view and edit calendar events that were added via the old calendar portlet the old calendar portlet included certain calendar event types such as appointments, birthdays, holidays, and meetings. doesn't include this explicit notion of event types. categories, the upgrade process preserves the functionality provided by the old calendar portlet's notion of event types. when upgrading, the old calendar event types are migrated to categories. the upgrade creates a vocabulary called calendar event types and adds the old event types as categories in this upon upgrading, any calendar events that had one of the old event types receive the corresponding category from the calendar event types next, let's look at one of the most widely used applications provided by";;
|
liferay's audience targeting app allows you to divide your audience into user segments, target specific content to different user segments, and create campaigns for different user segments. it also allows you to quickly measure the effectiveness of your campaigns. user segments allow you to configure your website to display different assets to different users. display specific content to different user segments for fixed periods of time. they also allow you to measure the interaction of the targeted user segments suppose you'd like to display advertisements to users of your website. like to display one set of advertisements to one user segment and another set of advertisements to another user segment. maybe this should dynamically change every week based on your marketing goals. or maybe you have created several sets of news articles for your website that would be interesting to different user you'd like to display news articles to users based on all the user liferay's audience targeting app, available from liferay marketplace, allows you to create multiple user segments which are defined by multiple rules based on session attributes, profile attributes, behavior, and information from developers can easily create additional rules and rule types the audience targeting app also allows you to create campaigns that target a specific user segment. periods of time and each campaign has a priority. campaigns on your website at the same time, the priority field determines which campaigns allow you to configure different assets to be displayed at different periods of time to the targeted user segment the audience targeting app adds an audience targeting section to the configuration section of the site administration area of the control panel and an audience targeting simulator to the dockbar. the following three applications are also included with the audience targeting app you can add these applications to any portal page. explain how to use the audience targeting section of the configuration section of the site administration area of the control panel to manage user segments and then we'll explain how to use each of audience targeting applications and the audience targeting simulator.;;
|
the easiest way to install the audience targeting app is via the correct version of the app. if you're running liferay on jboss, make sure to have your url file configured correctly. if you're running liferay on weblogic, note that the audience targeting app requires liferay 6.2 ee sp10 and above to work properly if you're running liferay on websphere, note that the audience targeting app requires liferay 6.2 ee sp11 and above to work properly. liferay on websphere, you must have the servlet filters configured to initialize installing liferay on websphere 8.5 if you can't uninstall the audience targeting app via marketplace or you want to manually uninstall it, follow these steps delete your liferay homedataosgi folder delete your app server's work and temp directories. you're running liferay on tomcat, delete your liferay hometomcat-versionwork and liferay hometomcat-versiontemp delete the analytics-hook, portal-6-2-x-compat-hook, and simulator-hook files located in the liferay hometomcat-versionwebapps folder;;
|
the audience targeting section of the configuration section of the site administration area of the control panel allows you to manage user segments and figure 7.1 click on site administration configuration audience targeting to manage user segments and campaigns for a site a user segment represents a subset of the total group of portal users logged in a user segment is defined by one or more rules that users have to match in order to belong to that user segment. all the rules that have been deployed appear under the rules drag a rule to the right to apply the rule to the user segment. rule has been applied, you can adjust the rule's parameters. the gender rule has been applied, you can select male or female. age rule has been applied, you can select an older than value and a younger for example, you could define a women over 30 user segment by applying the gender rule and selecting female, and applying the age rule and setting the older than attribute to 30. once you've customized the rules for the new user segment, entered a name and, optionally, a description, click save to actually create the user segment figure 7.2 drag a rule to the right to create a user segment to configure permissions for creating, editing, and deleting user segments, visit the roles section of the control panel. define permissions button corresponding to the role you'd like to configure permissions for, and search for audience targeting resources both user segments and campaigns are inherited in your site hierarchy. therefore, user segments and campaigns defined in the global scope will be user segments and campaigns created in a site will be available to all of its child sites custom rules can be created by developers and deployed as osgi plugins. creating new audience targeting rule types these are some of the rules that are included with the app by default the score points rule assigns 1 point to a user each time the user views a page or content that's been categorized under the user segment to which the rule has once a user exceeds the configured threshold, the user matches for example, suppose that your website is about sports and you have pages and content about basketball, tennis, and soccer. your audience into three user segments basketball fans, tennis fans, and soccer fans in order to display the most relevant content to them on your site's front after creating these three user segments using the score points rule with a threshold of, say, 20, you should appropriately categorize the content which would be most relevant to each user segment. for example, apply the basketball fans user segment to content about basketball, apply the tennis fans user segment to content about tennis, etc. now, every time a user even a guest user visits a page or views a piece of content categorized for a user segment to which the score points rule has been applied, the user will start accumulating once the user has accumulated enough points, the user will belong to the after a user has visited more than 20 pages or pieces of content related to basketball, the user will belong to the basketball fans user segment. once the user belongs to a user segment, you can use that information to direct more relevant information to the user in your website using the user segment each new user segment that's created can be used to categorize pages or content note page categorization is a feature added by the audience targeting app. in a regular liferay portal 6.2 instance without the audience targeting app installed, pages cannot be categorized the audience targeting app adds two select buttons to the categorization section of pages and assets user segment and user segment global. allow you to assign one or more site-scoped or global user segments to the this categorization has mainly two purposes figure 7.3 pages and content can be categorized for user segments you don't have to create categories for each of your user segments. segments are distinct from regular vocabularies. pages and assets contains distinct select buttons for user segments and regular when managing user segments, you can click actions reports next to a user segment to see the list of reports available for each user segment. actions view report to view the report or actions update report to generate a new report. reports display a summary of interesting information related to each user segment. for example, the content views report shows the asset that's been most viewed by users that belong to the user segment figure 7.4 the content views report shows the asset that's been most viewed by users that belong to a user segment additional reports can be created by developers and deployed as osgi plugins. see the reporting user behavior with audience targeting reports are generated daily by default. to generate a new report when currently viewing a report, click on the update report button in the top right corner.;;
|
a campaign represents an effort to expose a certain user segment to a certain set of assets within a specific period of time. to manage campaigns for a site, to create a new campaign, you need to select a user segment to target, a start date and an end date, and a priority, as well as a name and, optionally, a description. you also have to indicate whether or not the campaign you create should be active or inactive. required information, click save. the user segment you select when creating a campaign represents the portal users targeted by the campaign. dates together specify the duration of the campaign. campaigns active at the same time that target the same user segment. situations, the priority attribute of the campaigns determines which campaign finally, you can activate or deactivate a campaign via the active attribute of a campaign. deactivating a campaign disables the effect of the campaign within the portal. deactivating a campaign is like deleting the campaign except that a deactivated campaign can be reactivated later. useful to deactivate a campaign if a problem is found with the way content is once the problem has been corrected, the campaign can be for example, suppose you wanted the ability to display certain content for example, advertisements about your new android app to female baseball fans during the months leading up to the world series. the gender rule configured to female, the device rule configured for android devices, and the score points rule to define a user segment called female the score points rule assigns 1 point to a user each time the user visits a page or views an asset categorized under the user segment female when a user accumulates a certain number of points specified by the value of the score points rule's score points threshold attribute, the after creating this user segment, you would create a new campaign targeting this segment, select start and end dates, choose a priority, choose active, and then click save. to actually present content to the users belonging to the female baseball fans user segment, you need to use the to configure permissions for creating, editing, and deleting user segments, visit the roles section of the control panel. define permissions button corresponding to the role you'd like to configure permissions for, and search for audience targeting resources the priority of your campaigns becomes important when multiple campaigns are running at the same time on your website. application can be configured to display content based on the campaign your when a user matches multiple campaigns, the one with the highest if you have several campaign content display applications around your website configured to display different content per campaign, changing the priority of one campaign automatically affects all the campaign content display similarly, if a campaign is deactivated or if a campaign's date range is exceeded, all of the campaign content display applications on your one of the most interesting features of campaigns is that they allow you to measure the effectiveness of a campaign. this provides your marketing team with when creating a campaign, you can define the user actions that you want to track. the audience targeting app can display reports of how often those actions are triggered. for example, suppose you want to run a campaign for an event that your company is hosting next month. imagine that you have created a main page for the event which contains a youtube video and a banner which says register now. imagine also that you have a blog entry about the event displayed on several different pages of your website and a register page which contains the form to pay for the event. your goal is to get as many people to register as possible. probably be interested in tracking the following information to see if there is something not working as your team expected figure 7.6 drag and drop tracking actions to the right to configure a campaign you could drag and drop tracking actions from the palette to track all the more types of tracking actions can be created by developers and deployed as osgi plugins. tracking user actions with audience targeting the tracking actions use an analytics engine called audience targeting analytics that can be configured per site or per portal instance. the analytics engine per site, go to site administration site to configure it per portal instance, go to control panel tracking all the actions of all your users even guest users can be a very heavy load for your server. therefore, it's best to disable the tracking of any actions about which you don't need information reports are available for campaigns. you can click actions reports next to a campaign to see the list of reports available. created by developers and deployed as osgi plugins. reporting user behavior with audience targeting the content views report shows the number of times that different assets have been viewed via the campaign content display application by users in the context for example, if you configured five campaign content display applications around your website to display content for a campaign, the content view report for the campaign would show how many times was that content the tracking actions report shows the number of times that the actions tracked by the campaign have been triggered by users. introduced earlier in the section on tracking actions you've created a campaign for an event that your company will host soon. for this event, you have created a main page for the event which contains a youtube video and a banner which says you also have created a blog post about the event which is displayed on several different pages of your website. the tracking actions report would show you how many users visited the event page, how many watched the video, how many clicked on the banner, how many viewed the blog post about the event, how many started filling the registration form, etc. this information helps you measure the effectiveness of you can use this information to evaluate whether or not the users are following the engagement path you had prepared.;;
|
the audience targeting app not only adds the audience targeting application to the site administration area of the control panel, it also includes the following instanceable applications which can be added to any portal page all of these applications support application display templates adts so that site administrators can customize the look and feel of the application. liferay portal's out-of-the-box asset publisher adts can actually be re-used for these audience targeting applications the user segment content display application allows administrators to specify exactly which content to display to a user based on the user segments that the you can specify multiple rules according to the following you can specify any number of if clauses when configuring the user segment content display application's rules. however, an otherwise clause always follows the last if clause so that the application knows what to display if the user doesn't match any user segments. don't display anything is an option for the figure 7.7 you can configure the user segment content display application to display content according to rules that you define in the application's configuration window for example, you can add a user segment content display application to a page and configure the following rules for it once a user segment content display application has been added to a page and been configured this way, users even guest users will see a different image based on the user segment to which they belong. the application won't even be visible to a user if the user doesn't belong to any of the configured user segments figure 7.8 in the user segment content display application, site administrators can preview the various assets that have been configured to be displayed to different user segments the user segment content display application allows site administrators to preview the various assets that have been configured to be displayed to the user segment content list application displays content that has been categorized for the user segments that match the user segments to which the for example, suppose that your website has several assets categorized under the following user segments tennis fans, soccer fans, and when a user that belongs to the tennis fans user segment views this application, the application displays a list of assets categorized for the tennis fans user segment. if the user belongs to multiple user segments, then a list of articles that have been categorized for any of the matching user figure 7.9 the user segment content list application displays content that matches the user segments which fit the current user. you can configure the user segment content list application to display assets of any kind or only specific kinds of assets by default, the user segment content list application is configured to display assets of any type that have been categorized for any user segment that matches however, you can configure the user segment content list application to display only assets of specific types. configure the user segment content list application to only display web content the campaign content display application is similar to the user segment content display application except that instead of displaying an asset based on the user segments to which a user belongs, it displays an asset based on the campaigns however, the campaign content display application's display rules are simpler than those of the user segment content display application. you can specify multiple rules for the campaign content display application according to the following format as with the user segment content display application, you can specify any number of if clauses when configuring the campaign content display application. otherwise clause always follows the last if clause so the campaign content display application knows what to display if the user doesn't match any these rules cannot be ordered manually as they can with the user the order of the rules is based on the figure 7.10 the rules for configuring the campaign content display application to display content are similar to the rules of the user segment content display application, but simpler for example, suppose that you've created two campaigns called world cup and stanley cup, designed to target users who are interested in the world cup of soccer and the stanley cup of hockey. you could add a campaign content display application to a page and configure it with the following rules once a campaign content display application has been added to a page and been configured this way, portal users who match the world cup campaign will see a certain image in the application. users who match the stanley cup campaign will see a different image in the application. users who don't match either campaign of course, once a campaign has ended, no users will once all campaigns have ended, all users will see the note when audience targeting is enabled with a large number of rules, tracking actions, and reports, you may need to adjust some jvm parameters of your server for optimal performance. the campaign content display application, like the user segment content display application, allows site administrators to preview the different assets that will be displayed for different campaigns.;;
|
the audience targeting app includes a simulator feature. simulator allows administrators to preview the way portal pages appear to it does so by allowing site administrators to modify the matched user segments or campaigns. the audience targeting simulator is the simulator icon appears below the add, preview, and edit icons but above the edit controls icon on the left side of the dockbar. clicking on the simulator icon opens a panel which has two tabs user segments by default, the audience targeting simulator is only visible to site administrators and users with the view permission for the audience targeting note permissions pertaining to the audience targeting simulator and other features of the audience targeting app can be granted via the actions define permissions menu of the roles section in the control panel. defining permissions for a role, go to site administration configuration to find the audience targeting, audience targeting resources, and audience targeting simulator sections the user segments tab of the audience targeting simulator displays a list of all the user segments matched by the current user as well as all the user segments not matched by the current user. any matched user segment can be unselected and any unmatched user segment can be selected. this allows site administrators to simulate how the website would appear to different users. simulate button makes your website appear to you the way it would appear to the simulation continues until you click the stop this allows site administrators to navigate around their site as if they were a user that matched the selected user segments figure 7.11 audience targeting simulator the campaigns tab of the content targeting simulator displays all matched campaigns and all unmatched campaigns. it does not offer a simulate option however, since campaigns target specific user segments, it's easy to simulate how your site would look if certain campaigns were matched.;;
|
in this chapter, we discuss several ways liferay users can customize pages, applications, and the way they use your portal. personal sites allow each portal user to manage and customize a set of public andor private pages and any associated content or applications. provide a means of making content publicly available. means for users to create content and use applications that should be hidden liferay 6.1 introduced the concepts of customizable pages and administrators can designate certain pages or applications as customizable, which allows each user to make and save their own portlet layouts can also be customized with the use of application display templates allow a portlet's look and feel to be completely customized. rules engine which allows administrators to create custom portal rules and simplify complex blocks of code containing lots of if-else statements. start by discussing personal sites.;;
|
"liferay's documents and media library provides a mechanism for storing files online using the same type of structure that you use to store files locally. can use it to store files of any kind; it serves as a virtual shared drive, and can mount and browse external repositories. its companion portlet, the media gallery, displays selected content from the documents and media library. display image, audio and video files. other features in the documents and media library include customizable document types and metadata sets, automatic document preview generation, and support for mounting multiple external the new document types and metadata sets are an addition to, not a replacement for, the portal's system of tags and categories. exploring how to use the documents and media portlet.";;
|
by default, liferay stores documents and media files on the file system of the you can choose a specific location for the document library store's root directory by adding the following property to your url file and replacing the default path with your custom you can also use an entirely different method for storing documents and media you can use any of the following documents and media library stores with warning if a database transaction rollback occurs in a document library that uses a file system based store, file system changes that have occurred since the start of the transaction won't be reversed. document library files and those in the file system store can occur and may all stores except dbstore are vulnerable to this warning dbstore's file stored as a blob size limit is 1 gigabyte. store such large files, use simple file system store or advanced file system for example, you can store documents and media files in your liferay instance's to enable dstore, add the following line to your remember to restart your liferay server after updating your url file in order for your customizations to take effect. please refer to the document library portlet section of your url file to find a complete list of supported you can customize features such as the maximum allowed size of documents and media files, the list of allowed file extensions, which types of;;
|
liferay portal's documents and media lets you access external repositories in addition to the built in document repository. with third-party repositories include using external repositories involves configuring liferay and the external repository for interoperability and adding a repository that binds them in there are also different kinds of repositories liferay can connect with through liferay can connect with repositories, such as alfresco, nuxeo, and more, that support the content management interoperability services in addition, ee subscribers can use the apps to work with sharepoint and documentum in documents and media let's start with the common configuration steps the configuration steps are the same for repositories that support cmis, and are even similar between cmis repositories and those that use proprietary apis. it makes sense to cover these steps now the common configuration steps are let's adjust the portal properties in order to authenticate with the third-party repository, you need to store passwords for the user sessions. you must configure an authentication type that supports storing passwords to the user sessions important since authentication with single sign-on sso does not store encrypted passwords in the user sessions, sso can't be used with the external let's configure liferay portal for what's required in authentication. create a url file, if one doesn't already exist, and add a url next, make sure to authenticate the same way on both liferay portal and you can do so by authenticating based on screen portal property to your url file alternatively, configure these properties in the control panel under portal external repository integration requires liferay portal users use the same screen name and password as their external repository user. management chapter on adding and managing users. liferay portal as such a user whenever you're accessing the repository from it important use lowercase for user names in the external repository, as liferay screen names are lowercase note in the external repository, make sure to associate users with necessary roles for accessing repository files. must belong to the nuxeo administrators group to access nuxeo repository files adding a repository mapped to the external repository is the final step you can add new repositories from the ui by clicking the add button from the repositories can only be mounted in the home folder figure 5.5 you can add a new repository by navigating to add repository in the documents and media portlet the next sections explain how to add specific types of repositories including cmis repositories and sharepoint repositories liferay portal's documents and media can inter-operate with repositories that support the content management interoperability services cmis standard. defines a model for interacting with repository files. interoperability through cmis version 1.1 the current cmis version and it can access cmis repositories using atompub and web services let's explore accessing a cmis repository using atompub atompub is the easiest protocol to specify for communicating with a cmis repository follow these steps to access a repository with cmis atompub sign in to liferay portal as a user that also exists in the external repository and can access files you want to use in that repository in documents and media home, click the add and select repository. enter an arbitrary name for the repository and optionally enter a click on the repository configuration section to access its form. values for the following fields the external repository appears in documents and media. the repository and manage files next, let's access a cmis repository with web services after adjusting your portal properties and adding any user accounts required by the repository, you can add a documents and media repository that inter-operates with an external repository that supports cmis with web services follow these steps to add such a repository in documents and media home, click the add button and select the new repository screen appears click on the repository configuration section to access its form for repository type, select cmis repository web services enter the web service urls wsdl urls per your cmis repository's example urls are listed after these steps. urls for the following services tips in a browser, you can open the repository's wsdl file and verify each also make sure to specify the entire urlsthey all end with?wsdl leave repository id blank, as liferay generates the id your repository appears in documents and media. repository and work with files as you do other files in documents and media next, let's learn how to use a sharepoint repository lets users access sharepoint 2010 libraries from within a liferay documents and the app installs a sharepoint repository type that you can select when adding a new repository to documents and media. with existing sharepoint libraries, so you can access all of your organization's the liferay connector for sharepoint 2010 is available to ee subscribers on downloading and installing apps for information on using marketplace to download and install apps as with other third-party repositories that support the cmis standard, users can gain these benefits by accessing the sharepoint repository through the liferay the liferay connector for sharepoint 2010 uses sharepoint's api, which has some to use a sharepoint repository inside documents and media, you must first configure the sharepoint and liferay environments to support authentication with sharepoint and then add a documents and media repository that connects to let's start by configuring the environments here's an overview of what you must do to configure your host, liferay portal, and sharepoint to use sharepoint from liferay's documents and media library note, these instructions are geared to liferay portal and sharepoint system before you can use sharepoint as an external repository with liferay portal, you must set up a few things on the sharepoint host and in the sharepoint server for the liferay connector for sharepoint 2010 to authenticate to the sharepoint web services, you must enable basic authentication on the sharepoint host. you do this, make sure to empty basic authentication's default domain and realm authentication setup steps differ between windows versions. here are steps for enabling basic authentication on windows server 2008 figure 1 the features view for the site shows the authentication icon figure 2 clicking the edit... action brings up the a dialog for setting the default domain and realm you've configured basic authentication on the sharepoint host. in the dialog box, empty the default domain and realm fields of any you've configured basic authentication on the sharepoint host next, you should enable versioning support in your sharepoint library so that users can leverage file versioning between liferay portal and sharepoint you must enable versioning in sharepoint library for liferay portal's check-inout features to work with sharepoint. to enable it, follow these steps you've set sharepoint to accept versioning requests from liferay portal in order to authenticate with the sharepoint repository, you need to store supports storing passwords for the user sessions encrypted passwords in the user sessions, sso can't be used with the liferay connector for sharepoint 2010 app as a liferay portal system administrator, you must ensure that the same credentials and authentication are used in liferay portal and in sharepoint. is a typical mechanism for synchronizing them. if you don't have ldap, however, you must manually synchronize the credentials and authentication for liferay portal users to access the external repository, their screen names and passwords must be the same in liferay portal and in sharepoint. on adding and managing liferay portal users, refer to user mangement from within liferay's documents and media library, you are now prepared to mount the sharepoint library as an additional external repository it's time to add a documents and media library repository of type sharepoint, so users can work with sharepoint in liferay portal here are the steps for adding a sharepoint repository type add the documents and media application to a page, if you haven't done so from the home location in the documents and media application, click add in the new repository screen enter an arbitrary repository name and a repository type select the sharepoint option site url enter the url of the site where your sharepoint library lives e.g., library name enter a name for the library. enter the name of the sharepoint library you're connecting to after you've finished entering any additional options, click save your documents and media library is now connected to the sharepoint repository. the new external repository is now listed in the documents and media home now that you've added a sharepoint repository to documents and media, you can access and modify sharepoint library files from within liferay portal's next, let's look at configuring the documents and media portlet.;;
|
to configure the documents and media portlet, click on the gear 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 below root folder, browse or create the folder you'd like to be your new top-level folder, and click save. root 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 5.6 to make portlet-specific configurations for documents and media, click on the gear 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 enable related assets box. 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, statuses, downloads, and actions are displayed. the portlet to display files' create dates and modified dates. columns from being displayed, move them to the current box or to the available you can 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 column in the portlet ratings and comment ratings are also enabled by default for documents and media if users decide that a file or certain comment about a file is useful or informative, they can rate it as good by clicking on the thumbs up icon next to if they think the file or comment is unhelpful or misleading, they can click on the thumbs down icon. if you'd like to disable ratings or comment ratings for files, uncheck the enable ratings or enable comment ratings;;
|
"tags and categories are two important tools you can use to help organize these tools help users to easily find the content they're looking for through search or navigation. you can tag or categorize an asset at creation time or when if you click on the categorization section of the form for creating or editing an asset, you'll find an interface for adding tags if no categories are available to be added to the asset e.g., if no categories have been created, the categories heading won't appear figure 6.1 here, the web content display portlet's form for categorizing a new web content instance doesn't include a categories heading since no categories have been created the control panel contains an interface for managing tags and categories for this interface can be used to manage all your tags and it is important that you both tag and categorize your let's take a closer look at tags and categories tags are an important tool that can help organize information on your portal and make it easier for users to find the content that they're interested in. are words or phrases that you can attach to any content on the website. content makes your search results more accurate and enables you to use tools like the asset publisher to display content in an organized fashion on a web there are two ways to create tags you can do it through the administrative console in the control panel or on the fly as content is created. by default, tags can be created by regular users and users can apply them to any assets which they have permission to create or edit while regular users can, by default, create new tags by applying them to any assets that they have permission to create or edit, only site administrators can access the tags portlet in the content section of the site administration area here, site administrators can create new tags and edit any to create tags in the control panel, visit the site for which you want to create tags and then click on admin content. click on tags in the content section on the left. view existing tags and create new ones. to create a new tag, click add tag and you can also customize a tag's permissions and properties. however, must be done by a server administrator. configuration, add a url file to your liferay home directory with the following contents and then restart the server once this is done, you can change the permissions on a tag to make it viewable by guests, site members, or owner. you can also assign other permissions for managing tags, including permission to delete the tag, edit the tag, or edit the you can also add properties to a tag. add information to specific tags. you can think of tag properties as tags for structurally, tag properties are key-value pairs associated with specific tags that provide information about the tags figure 6.2 the add tag interface with editing of tag properties and permissions enabled. when managing a site's content, click on tags and then add tag to create a new tag. the add tag interface allows you to enter a name for the tag, define permissions for the tag, and add properties to the tag tags are not the only portal-wide mechanism for describing content you can also categories are similar in concept to tags, but are designed for use by administrators, not regular users. hierarchies of categories can be created, and categories can be grouped together in vocabularies. hoc method for users to group content together, categories exist to allow administrators to organize content in a more official, hierarchical structure. you can think of tags like the index of a book and categories like its table of both serve the same purpose to help users find the information they adding vocabularies and categories is similar to adding tags. which you want to create categories and then click on admin content. then click on categories in the content section on the left to view the figure 6.3 when managing a site's content, click on categories and then on add vocabulary to create a new vocabulary. by default, a vocabulary called topic already exists. when adding new categories, make sure you're adding them to the correct vocabulary clicking on a vocabulary on the left displays any categories that have been to create a new vocabulary, click on the add enter a name and, optionally, a description. allow multiple categories box is checked. this allows multiple categories from the vocabulary to be applied to an asset. if the box is unchecked, only one category from the vocabulary can be applied to add asset. types lets you choose which asset types the categories of the vocabulary can be applied to and which asset types are required to have an associated asset from lastly, you can configure the permissions of the vocabulary. should the vocabulary be viewable by guests? which of these roles should be able to delete the vocabulary, update it, or edit by default, guests can view the vocabulary but only the owner can delete it, update it, or configure its permissions creating new categories is similar to creating new tags except that categories must be added to an existing vocabulary and they can only be create by site however, once created, regular users can apply categories to any assets they have permission to create or edit. the add category button in the categories administration portlet. for the new category and, optionally, a description. dropdown list to select a vocabulary to which to add the category. tags, you can configure the permissions of the category, choosing which roles guest, site member, owner can view the category, apply it to an asset, delete it, update it, or configure its permissions. by default, categories are viewable by guests and site members can apply categories to assets. properties to categories, just as with tags. category properties are a way to add information to specific categories. you can think of category properties as structurally, category properties are just like tag properties they are key-value pairs associated with specific categories that provide information about the categories once you have created some vocabularies and categories, you can take advantage of the full capabilities of categories by creating a nested hierarchy of to nest categories, select the category that you'd like to be the then drag any category that should be a child category onto it. you will see a plus sign appear next to the name of the category you are dragging if you can add it to the selected parent category; if you see a red x that means that you cannot add that category as a subcategory of parent category after you have created a hierarchy of categories, your content creators will have them available to apply to content that they create. the content section of the site administration area the control panel and click click on categorization from the right-side menu and click select on the vocabulary you'd like to apply. select any relevant categories by checking the box next to them, and they'll be applied to the content liferay 6.1 added several new features to vocabularies and categories. mentioned a few of these already when we were discussing the allow multiple categories and required checkboxes for vocabularies and categories. new features are targeted vocabularies, singlemulti-valued vocabularies, and separated widgets for every vocabulary targeted vocabularies allow you to decide which vocabularies can be applied to an asset type and which vocabularies are required for an asset type. configure these settings, go to the categories administration portlet in the control panel and mouse over the vocabulary in the list until you see the edit select the icon to reveal a dialog box like the one below figure 6.4 you can target vocabularies by checking the allow multiple categories checkbox and then selecting the asset types the default value for associated asset types is all asset types. fine tune your choices by using the and - buttons, which narrows the scope of the vocabulary to specific assets. in the screenshot above, notice that the vocabulary is configured to be available for web content instances and blog entries, but it is not required. it is mandatory, however, for documents and you can also decide if users can choose one or more categories from the same vocabulary to apply to an asset. if a vocabulary is single-valued you can only if it allows more, you can choose several categories from the vocabulary to apply to an asset figure 6.5 multi-valued vocabularies allow multiple categories from the vocabulary to be applied to an asset. single-valued vocabularies only allow one category from the vocabulary to be applied. here, the cinema and music categories are selected to be applied but the sports category is not you can configure the single-valued or multi-valued status of a vocabulary through the categories administration portlet. the allow multiple categories checkbox to create a single-valued vocabulary. use the default option to create a multi-valued vocabulary a third feature of vocabularies and categories is that every vocabulary has its these widgets appear in the categorization section of the form for editing an asset and they allow users to easily select appropriate figure 6.6 vocabularies have their own widgets, making it easy to select available categories it's important to use tags and categories with all your content, so that content let's look at one of the ways users will make use of tags and categories searching for content.";;
|
"as we create web content, it's important to keep in mind that to liferay, the pieces of content are assets, just like message board entries and blog posts. this allows you to publish different kinds of content using liferay's asset you can use the asset publisher to publish a mixed group of various kinds of assets such as images, documents, blogs, and of course, web content. this helps in creating a more dynamic web site you can place user-created wiki entries, blog posts, or message board messages in context with your content. let's examine some of its features the asset publisher portlet is a highly configurable application that lets you query for mixed types of content on the fly. control what and how content is displayed from one location, the asset publisher helps you to bubble up the most relevant content to your users to get to all the portlet's options, click the options button in the portlet's on the setup tab, you can configure the asset publisher's settings from the following three areas asset selection allows you to configure which assets are displayed. asset selection to either dynamic or manual. assets are automatically displayed based on certain rules or filters. example, you can set the asset publisher to display only assets of a certain type or assets to which certain tags or categories have been applied. manual asset selection, the asset publisher only displays assets that have been explicitly selected by an administrator the asset publisher supports a scope that restricts both manual and dynamic the asset publisher can only display assets from its configured by default, the asset publisher portlet is scoped to the site of the page however, you can customize the scope from the asset selection section of the asset publisher configuration window. asset publisher's scope, click select under scope and choose either global to add the global scope or other site... to add the scope of anther site the display settings section of the asset publisher configuration window lets administrators customize many details that determine how content is displayed. the subscription section allows administrators to enable, disable, or configure email subscriptions and rss subscriptions. in the following sections, we'll explore the available configurations for the asset selection, display settings, and subscriptions sections of the asset publisher's configuration window. start by learning how select content manually. you'll see that it's very similar to using the web content display portlet except that you can select assets of any type, not just web content instances by selecting manual from the select box beneath asset selection, you tell the asset publisher that you want to select content manually. multiple scopes, including the global scope, from which to select assets figure 6.13 selecting assets in the asset publisher manually is similar to selecting assets in the web content display portlet except that you can select assets of any type, not just web content. you can also add scopes to expand the list of assets that available to be displayed in the asset publisher when selecting assets manually, you'll see a list of configured scopes under the click the red x button at the right to remove a scope from the click the select button to add additional scopes to the asset after you've added a scope, a new select button appears under the asset entries heading. a list of assets selected for display appears in the asset entries section. you can select assets to be displayed by clicking on the appropriate select button. by default, the available asset types include the following you can select any number of assets to be displayed. a display setting called number of items to display that determines the maximum number of items to display or, if pagination is enabled, the maximum number of items to display per page. the asset publisher enables you to mix and match different asset types in the same interface. any selected assets are added to the list of assets that are displayed by the portlet. once you have your content selected, you can configure the display types to configure how the content appears. discuss the display settings in more detail after we finish discussing how to while manual asset selection allows you to select assets of various types from different scopes, it can be time-consuming to periodically update the assets it's often more convenient to use the asset publisher the asset publisher's default behavior is to select assets dynamically according these rules can be stacked on top of each other so that they compliment each other to create a nice, refined query for your you can define complicated rules for selecting assets for display and liferay automatically takes permissions into account. performs well in these situations since it queries by search index instead of querying the database directly. you have the following options for creating scope choose the sites from which the content should be selected. works the same way as with manual asset selection assets can only be displayed if they belong to a configured scope asset type choose whether you'll display any assets or only assets of a specific type, such as only web content, only wiki entries, or any combination filter rules add as many filters on tags or categories as you like. choose whether the content must contain or must not contain any or all of the tags or categories that you enter figure 6.14 you can filter by tags and categories, and you can set up as many filter rules as you need once you've set up your filter rules for dynamically selecting content, you can decide how the content will be displayed you can order the content returned by the filters by title, create date, instance, suppose you have a series of how to articles that you want displayed in descending order based on whether the article was tagged with the hammer or, suppose you want a series of video captures to display in ascending order based on a category called birds. for these use cases, you can configure the ordering and grouping settings. you can also group by asset, type or vocabularies are groups of categories defined by administrators in the categories section of the control panel there are also three miscellaneous display options listed as checkboxes the ordering and grouping section of the asset publisher allows you to precisely control how content is ordered and grouped when displayed. order the assets displayed by asset publisher in ascending or descending order you can also configure a second ordering. the second ordering would be applied to any assets for which the first ordering wasn't sufficient. suppose you chose to order assets by title and there are multiple assets with then the second ordering would take effect. could order all the assets that had the same title by their publication dates when ordering assets, it's important to keep in mind that assets include different kind of entities web content articles, bookmarks, documents, custom if you're displaying an entity which doesn't make use of a field e.g., publish date and you set this field as the ordering field, your asset ordering will be incorrect you can establish grouping rules as well as ordering rules. for example, suppose there's a vocabulary called membership type that belongs to your site. suppose this vocabulary has two categories premium and regular. if you group assets by membership type, all assets with the premium category will be displayed in one group and all assets with the regular category will be displayed in another group. applied before any ordering rules they're a way to divide up the displayed the ordering rules are applied separately to each note that grouping and ordering rules are only one mechanism to control how your you can refine the display through many other display settings which we'll examine next note the following actions will have immediate effects in your asset publisher other changes in the rest of the options will come into effect after clicking save open the display settings subtab of the setup tab of the asset publisher's here, you can configure many more settings that control the asset publisher's behavior and that determine how the asset publisher the display settings section gives you precise control over there are many options available to configure how you want your content to appear. many of these, such as printing, flags, ratings, comments, comment ratings, and social bookmarks work the same way they do in the web content display portlet show add content button when checked, this checkbox adds an add new button that allows users to add new assets directly from the asset publisher display template this selector lets you choose an application display template to customize how the asset publisher displays assets. the following display templates for each newly created site, including the abstracts this display template shows the first 200-500 characters of the content, defined by the abstract length field. template of the asset publisher table this display template displays the content in an html table which can title list this display template displays the content's title as defined by full content this display template displays the entire content of the entry there's also a rich summary display template that belongs to the global this template provides a summary view of each asset along with a read more link to the article's full content abstract length here, you can select the number of characters to display asset link behavior the default value is show full content. value selected, when the link to an asset is clicked, the full asset is displayed in the current asset publisher. there's also a view in context link that shows the article in the wiki page's wiki portlet. context is selected, clicking on an asset causes that asset to be displayed in the portlet to which the asset belongs. for example, a blog entry would be displayed in the blogs portlet where it was created. would be displayed in the message boards portlet where it was created. similarly, a generic web content instance would be displayed in the asset publisher of its configured display page. see the section below on display pages tip when the asset publisher displays web content instances that have an associated small image, the small image becomes a to use this feature, add or edit a web content instance that the asset publisher should display. click on abstracts, flag small image, and upload an image. once your web content instance appears in the asset publisher's list, clicking the small image takes you to the full instance number of items to display here, you can select the maximum number of assets that can be displayed by the asset publisher. enabled, there's no limit to the number of assets that the asset publisher can so with pagination enabled, this number represents the maximum number of assets that can be displayed per page pagination type this can be set to none, simple, or regular. pagination set to none, the asset publisher displays at most the number of assets specified in the number of items to display property. pagination type to simple adds previous and next buttons that enable the user to browse through pages of assets in the asset publisher. pagination type to regular adds more options and information including first and last buttons, a dropdown selector for pages, the number of items per page, and the total number of results assets being displayed show available locales since content can be localized, you can have different versions of it based on locale. enabling this option shows the locales available, enabling users to view the content in their language of choice set as the default asset publisher for this page the asset publisher portlet is an instanceable portlet; multiple asset publishers can be added to a page and each has an independent configuration. the default asset publisher for a page is the one used to display any web content associated with the page enable conversion to if you have enabled liferay portal's openofficelibreoffice integration, you can allow your users to convert the content to one of several formats for information on setting up liferay's openofficelibreoffice document enable... the asset publisher's display settings allow you to enabledisable the following options for displayed assets enabling the print option adds a print link to the full view of an asset displayed in the asset publisher. clicking print opens a new browser window with a print view of the asset. enabling flags, related assets, ratings, comments, comment ratings, or social bookmarks add links to the corresponding social features to the view full of the asset in the asset tip an alternate way to add comments and ratings to a page is through the page comments and page ratings just add the portlets in the appropriate location near the asset you'd like to have feedback for. note that starting in liferay 6.2, these portlets can no longer be exported show metadata allows you to select various metadata types to be displayed for example, you can select tags and categories for display. saving your configuration, the asset publisher displays tags and categories for then users can click on the tags and categories to manually filter the displayed assets figure 6.15 you can configure the asset publisher to display various kinds of metadata about the displayed assets the display settings section of the asset publisher has numerous options to help you configure how your content selections are displayed to your users. though there are many choices, it's easy to go through the options and quickly adjust the ones that apply to your situation. publisher to query for different kinds of assets in the portal that contain the asset publisher portlet supports two kinds of subscriptions rss subscriptions and email subscriptions. to enable subscriptions, open the asset publisher's configuration window click on the gear icon and select in the configuration window, open the subscriptions tab of the enabling rss subscription creates an rss feed containing links to all of the assets that the asset publisher is configured to display. feed appears in at the bottom of the asset publisher portlet figure 6.16 when rss subscriptions have been enabled for an asset publisher portlet, a link to the asset publisher's rss feed appears. users can subscribe to the asset publisher's rss feed using their preferred rss reader enabling email subscription adds a subscribe link to the asset publisher. users wishing to be notified of newly published assets can click on this link to be added to the subscription list. liferay periodically checks for new assets and sends emails to subscribed users informing them about the new assets. default, liferay performs this check every twenty-four hours but this can be customized by adding the following property to your url file also by default, liferay limits the number of assets that are retrieved from the database during this check to twenty. if you're interested in optimizing liferay's performance, you can lower this limit. performance, you can remove this limit entirely. assets about which liferay notifies subscribed users, add the following property to your url file and change the number next, we'll look at display pages, an addition to the asset framework introduced if you've been using liferay for a while, you might have noticed something about how liferay handles web contentcontent is never tied directly to a page. this can be useful because it means that you don't have to recreate content if you want to display the same thing on multiple pages, it also means that you don't have a static url for any web content, which is bad for search engine as an improvement, liferay introduced the concept of display pages and each web content entry on the portal has a canonical url, which is the official location of the content that is referenced any time the a display page can be any page with an asset publisher configured to display any content associated with the page. editing web content, you can select a display page, but only pages with a configured asset publisher are available for selection to create a display page, you can create a page yourself, add an asset publisher portlet and configure it yourself. alternatively, you can use the content display page page template included with liferay. page manually, once you've added an asset publisher portlet to the page, open then check the set as the default asset publisher for also, for its display settings, set the display style to abstracts and the asset link behavior to view in context note web content linked in the asset publisher can be viewed by clicking their asset links. context behavior checked, the link displays the web content in its if the web content does not have a configured display page, it is displayed in the web content display portlet to which the you may now be thinking, wait, you just told me that each web content item has its own url, and that this is somehow related to pages where we display a whole bunch of content on the same page? page called my web content display page somewhere on your portal, using the now, on a different page, add a web content click the add web content button, enter a title and some content, click on display page at the right, and select the display page you figure 6.17 you can select a display page for a web content instance when creating or editing one in the asset publisher of the my web content display page, click the read more link to display the full content. notice that the canonical url for content appears in your browser's address bar. display page, any additional portlets that you place on the page are displayed along with the content when you access it via the canonical url. content display page page template for your display page, it not only features a configured asset publisher portlet but also a tags navigation, a categories navigation, and a search portlet. these tools help users to quickly identify next, let's learn about another new feature introduced by liferay 6.1.";;
|
related assets was a feature introduced in liferay 6.1 that enables you to connect an asset to other assets within the same site or to global assets, even if they don't share any tags and aren't in the same category. that you can show related assets within the display for a specific asset, and with the related assets portlet you can show links to any assets which are related to content displayed on that page the related assets portlet is based on the asset publisher and possesses essentially the same interface with one key difference. displays any content that meets the criteria selected in the portlet the related assets portlet only displays content that meets the criteria, and also is listed as a related asset for a piece of content that is currently published on the page where it is placed. as a prerequisite for the related assets portlet to display related assets, you have to configure it to show the content you want displayed. the asset publisher portlet and select the gear icon in the upper right under the setup tab, set type of assets to display the default value is set to any. the scope of the portlet to display any single category of asset type or select filter options let you set minimum requirements for displaying assets by their categories, tags, and custom fields. ordering and grouping allows you to organize assets using the same criteria. display settings allow you to customize how assets are shown in the portlet. they can be listed by title, in a table, you can convert assets to different document types you can choose to show various metadata fields such as author, modification date, tags, and view count. subscriptions and customize their display settings when you are finished setting the source and filter options, click save. you saw the message that says, you have successfully updated the setup, but there still aren't any assets displayed in the related assets you cannot see any related assets until you select an figure 6.19 select an asset in the asset publisher to see its related assets displayed in the related assets portlet. in the screenshot, we renamed the three related assets portlets on the left and updated their configurations once you select an asset, its related assets are displayed in the related assets portlet, as in the image above.;;
|
rss is a family of web feed formats used to publish frequently updated works such as blog entries and news articles. rss allows users to stay up-to-date with your site's content without actually having to visit your site! can subscribe to your site's rss feed with an rss feed reader. reads your site's rss feed and displays information about all the web content that's published on your site, such as each article's title and publication if one of your site's web content articles grabs their attention, then they can follow their rss reader's link to the article's full content on your many rss readers are available today, including web-based readers, ones for the windows, mac, and linux platforms, and ones for mobile devices. see how to create rss feeds in liferay to manage a liferay site's rss feeds, navigate to the site administration content page of your site and click web content. this web content administration portlet to manage their site's web content, including web content structures and templates, which we examined above. administrators can also use the web content administration portlet to manage click manage feeds if you'd like to add, note the web content feeds portlet is deprecated for liferay 6.2 and will the portlet will be migrated to the asset publisher figure 3.7 clicking manage feeds from the control panel's web content administration portlet opens a popup window which displays your site's rss feeds. you can add or edit rss feeds, configure their permissions, or delete them click the add feed button to add a new feed. select a target page for the feed. a feed's target page serves two purposes the site to which the target page belongs determines which web content for example, if the target page belongs to the marketing site, only web content articles belong to the marketing site will the target page is the page where orphaned web content articles will be orphaned web content articles are articles that have been published in your site but have not been configured to be displayed in liferay rss feeds can provide links to any published web content articles, both orphaned articles and articles that have been configured to be displayed in specific web content display for articles that have been configured to be displayed in a specific portlet, the rss feeds' links point to the portal page of that for orphaned articles, the rss feeds' links point to the feed's when users click on such links for orphaned articles, the full content of the orphaned article is displayed on the target page figure 3.8 to create a new rss feed, you only need to specify a name and a target page. of course, you can also configure other features of the feed such as its permissions, web content constraints, and presentation settings to specify a target page, you need to enter the target page's friendly url. that friendly urls do not include the host name. of a public page called welcome belonging to a site called marketing might look like this webmarketingwelcome. optionally, you can specify a target this would be the portlet id of a web content display portlet on the target page in which orphaned web content should be displayed. must exist or else the content will not displayed. it appears after you've actually created the feed by the final two sections of the add feed form allow you customize which web content articles appear in your feed the web content constraints section allows you to select a web content type and a structure with which to filter the articles that appear in your feed. you can select a particular type of web content such as announcements, only articles of the type you select will appear you can also choose for only web content articles that have a particular structure to appear in your feed. this is useful since customized kinds of web content articles are often created using web content structures the presentation settings section allows you to customize additional details about your feed and how articles are displayed in your feed. feed item content set to web content description if you'd just like a description of each article to appear in your feed. content use default template if you'd like the full content of each article customizing the feed type allows you to choose which web feed language to use for your feed. customize the maximum items to display to choose the maximum number of articles should appear in your feed at one leave the order by column set to modified date to have articles arranged in order from the last time they were published or modified. set the order by column to display date if you want to have articles arranged in order from the time they were configured to be displayed in a lastly, you can leave the order by type set to ascending to have the oldest articles at the top of the feed or you can set it to descending to have the newest articles at the top of the when you're done configuring your rss feed, you can click preview to see how if you're satisfied, click save to create your feed once one or more feeds have been created, they'll appear in a list in the feeds popup window when you click manage feeds. using the same form used for creating them. the main difference is that when you edit an existing feed, the url field is populated. browser tab or window to test your feed. from the feeds popup window, you can also customize the permissions of feeds or delete feeds it's possible to completely disable rss feeds at the portal level. this by setting the url property to false. if you keep the default, rss enabled, you can make several other please refer to the rss section of your the rss portlet allows you to display any number of rss feeds and configure how if you're looking for a web-based rss reader, look no further just add the rss portlet to one your personal site's private pages, and you have your own personal rss reader. open the portlet's configuration popup to select the feeds to be displayed and customize the display. portlet can also be placed on sites' public or private pages to make feeds available to guests or site members, respectively. that only site administrators have permission to customize the rss portlet and once you've added the rss portlet to a page, open the portlet's configuration popup window by clicking on the gear icon at the top right corner of the portlet and selecting configuration figure 3.9 the rss portlet's configuration window lets you choose feeds to be displayed and allows you to customize the display settings by default, the rss portlet displays two feeds. the green plus sign to add a new feed or on the red minus sign to remove a feed. enter the url of the rss feed to display into the url field. title field blank, the feed's title appears in the rss portlet. custom title into the title field, the custom title appears instead of the in the display settings section, use the following checkboxes to select the feed details that should be displayed you can also select the number of entries and expanded entries that should be expanded entries show more of an article's actual content by default, each feed shows eight entries per feed but only one expanded entry per feed. you can set the feed image alignment to control whether feed images appear to the right or left of the text. the feed image alignment is set to right. finally, you can select a header web content andor a footer web content. these are web content articles that appear in the rss portlet either above all of the feeds or below all of the feeds. can use these to provide an introduction, description, or footnotes about the feeds that you've selected to be displayed figure 3.10 by default, the rss portlet is configured to display feeds from liferay community blogs, yahoo news, and the new york times. this image displays what the liferay community blogs feed looks like in the rss portlet now that we've discussed how to create, manage, and use rss feeds, let's examine site templates and page templates. site templates are a powerful tool for let's examine how they work and then we'll look at;;
|
when you create a new piece of web content, you have the ability to choose a from a large number of languages liferay supports. translation, you must finish creating the content in your default language and once you've done that, editing the content provides you with the option figure 3.17 you have many translation languages to choose from for your web content after you click add translation, you can select a language by scrolling through the list or by entering the language you want to use in the search box. when you select a language, a new window opens within your browser enabling you to translate the original web content into the selected language. done with the translation, click save and the translation is added to the list figure 3.18 after typing your translated text, you can summarize the translation in the abstract section note to view localizable fields in a given language, you must have your this includes friendly urls for the web content as when you navigate to the localized friendly url e.g. , the web content is always displayed in the current language. you can change the language with the you can modify the language translation list by inserting url followed by your preferred languages in your url file. dutch netherlands, and hindi india warning if you switch your site's default language e.g., via friendly url, but do not have the necessary translations for localizable fields, your site's language values will be used from the old default language. you should change the default language of your site only when you have translated values for all localizable entities. control of what language is displayed in the portal the ability to completely delete a translation in one step has also been added. instead of simply disabling a translation or having to go through a multistep process to remove it, you can now simply open the translation you don't want and when you create a new web content structure, each field you create has a localizable checkbox displayed next to it. this enables you to control what can and can't be changed in the translation process. want images or content titles to be changed when the content is translated, you can make sure those fields aren't listed as localizable. steps above to localize content, only fields within the structure that had the localizable box checked appear within the translation window note the localizable checkbox was removed for 6.2 ce ga1 and ga2, and 6.2 however, the localizable checkbox is now available for liferay following these versions for web content structure fields. next, we'll discuss how to let users customize their site pages.;;
|
just like siblings have common features inherited from their parents, applications that ship with liferay also share common features. look and feel, communication, scoping, sharing, permissions, archive configurations, exportingimporting portlet data, and the recycle bin. discuss how these features work together to facilitate information flow within your portal and provide an enhanced experience for your users. into the nitty gritty of the applications themselves, it's best to cover these common features first, starting with the look and feel configuration options.;;
|
some liferay portlets allow you to export or import portlet data. many of liferay's collaborative applications, such as the blogs, wiki, and to export or import portlet data, click on the gear icon of your portlet and select exportimport. a.lar file that you can save and import into another portlet application of not to confuse portlet-specific.lar files with site-specific.lar files. see the section on creating and managing pages for a discussion of exporting and importing site page data note to prevent malicious code from being imported into your portal, liferay restricts external classes from being serializeddeserialized. need a class serializeddeserialized during the import of a lar, you must you can list your classes in url or in the given plugin by creating a url file with the proper settings and a url that contains a element to let the deploy framework recognize and merge the property configuration with the default first, to enable checking xstream class serialization security permissions, you qualified class names allowed to be serializeddeserialized during exportimport and staging processes using the url property. list can be empty since the portal default entities are added already. following list are types allowed by default types defined in the url portal property are passed as an explicittypepermission any class that is not whitelisted either through the portal property or by default generates a url.forbiddenclassexception thus, if you encounter such an error, you need to add the fully qualified class name to your url file let's explore the export process for portlets first figure 4.7 when exporting portlet data, you can choose what content to include first, you can select a date range of content that you'd like to export. content that has been added to your portlet within your specified date range is you also have options of choosing all dates or just the most recently added content, or last next, by checking the content box, you can choose specific content you'd like when you check the content box, more options appear, allowing you to choose specific kinds of metadata to include. for example, if you have a wiki page with referenced content that you don't wish to include, you can simply check the wiki pages checkbox and uncheck the referenced content checkbox. another option in the content section of the exportimport window is the two familiar content types in your portal is if you wish to include these entities in your.lar file, select change and select them from the checklist lastly, you can choose whether to include permissions for your exported content. the permissions assigned for the exported portlet window will be included if the when you check this box, a sub-box called permissions assigned to roles appears. if you wish, you can export your portlet's permissions but not the permissions assigned to roles. exported your portlet's data, switch to the current and previous tab to view ongoing export processes and the history of past exports figure 4.8 when importing portlet data, you can choose a lar file using the file explorer or drag and drop the file between the dotted lines to import portlet data, you can select the lar using your file explorer or by dragging and dropping the file between the dotted lines. file, you're given a similar screen to what you'd be offered during export. select the appropriate content and permissions, and click continue the next screen offers options split into two sections update data and here's options and descriptions for each section next, let's discuss the concept of a portlet's scope.;;
|
"whether you plan to build a social network or enable social applications as part of your overall user experience, liferay portal has the tools to make those starting with a suite of applicationsincluding a profile summary, activities feeds, social requests, a wall, and moreand rounding things out with an api to handle relationships between users as well as publish their activities to each other, liferay portal helps you implement common features of social networks figure 1.8 liferay portal provides feeds of social activities. these feeds can contain entries from any of liferay's built-in applications or applications that you write social relationships in liferay portal are ideally suited for everything from public social networks to enabling social features in your corporate intranet. users can form relationships with one another, allowing them to see updates from those whose activity they need to track. that's far more powerful than having them subscribe to multiple individual rss feeds or visit multiple profiles, because the system keeps track of the updates from those with whom you have a more than this, however, liferay is a great integration platform for social it fully supports the opensocial framework. gadgets you find online, or you can use liferay portal's built-in opensocial gadget editor to create and serve your own opensocial gadgets figure 1.9 liferay portal's opensocial gadget editor lets you rapidly create social applications that can be served across the web to any other opensocial container liferay portal also supports the creation of facebook applications; in fact, no additional coding is necessary to publish your liferay applications on facebook you would, of course, need to use facebook's api to use facebook-specific features like posting on users' timelines. all you need to do is get an api key and canvas page url from facebook figure 1.10 any liferay application can be published to multiple social networks with a few clicks as you can see, liferay portal is built with social applications in mind. highly likely, however that you also have your own application you the liferay portal platform is ideal for the web application you're considering writing. in addition to this, liferay portal is easily configured to be used as a shared hosting platform for multiple web let's look at the benefits you can reap by using liferay portal in these";;
|
we can't even begin to imagine what you're thinking of building, but whatever it is, you're going to put your heart and soul into it. web platform can give you a leg up. it provides everything you need to support your application, so you can concentrate solely on what you're building, and not the rest of the features your users expect will come along with it imagine your application for a moment. does it require users to register on can users comment on content contained in your application? something that users can tag or categorize? if you think about the layout of the application, would it benefit from modularization? rich javascript framework with many components built into it? securitywill you need to make information available to some users, but not to liferay portal has all of this and more available to developers liferay portal's development framework is a great help when you're building a while the framework itself is covered in other resources such as the liferay developer's guide or liferay in action, the strengths of liferay as a platform are also apparent once you've finished writing your for example, bug fixes to your applications are easy to apply, because liferay applications are hot deployed to the running server. you a ready-made shopping center for your applications. services and json architecture make it easy for you to share data from your applications with other systems running on different platforms you get all thisnot to mention the automatic facebook and opensocial integration mentioned abovewith liferay's development platform. powerful platform, and certainly worth your investigation if you're building an enterprise system, portals were designed in the first place to be a single point of entry to your users' applications and content. since liferay portal integrates well with user directories such as ldap and active directory, and single sign-on systems such as saml and opensso, it fits well into your enterprise systems. this allows you to use it as an integration platform for existing applications liferay portal, since it adheres to the jsr standard for portlets, was designed from the ground up for application integration. installed on the system to any page in the portal. provided by other systems to integrate their data into an application window in and applications you create with liferay's service builder api are web liferay portal excels as a multi-site hosting platform. multiple sites under the same overall architecture, or you could host several completely different websites based solely on liferay's ability to serve multiple instances of itself from the same physical installation in the first scenario, liferay portal's sites architecture lets you create multiple, different websites that have public andor private sets of pages and as many pages within those sets as you'd like. some sites can be defined as restricted or private, and users can't access those unless they're added by site administrators. these sites can have canonical domain names such as url or using this construct, you can build anything from facebook, to yahoo groups, to sourceforge, to the now-defunct-but-once-loved geocities. the number of sites you can have some liferay installations have only one or two, but others have many thousands. for those larger installations, liferay portal contains a complete site membership management framework that lets administrators manage automatic site members for groups of users. built to scale to the size you need in the second scenario, liferay portal lets you create completely separate instances of itself from the same installation. sites, and roles from each instance are kept completely separate. registers for a user id on one instance, he or she would have to register as a new user on another instance as well this lets you host many different, separate websites from one liferay portal users of each instance have access to the same powerful content management, collaboration, social, and web development platform that they'd have if they were operating from a single, standalone installation okay, so maybe this still isn't enough for you. let's see how you can customize liferay portal so that it looks and operates exactly the way you've envisioned;;
|
beyond using liferay as a development platform for new applications, liferay portal has also been designed to be extended and modified. project, its source code is available, but liferay portal's developers have designed the product to make it easy to build whatever you want out of it the first and easiest way of customizing parts of liferay portal is with these let you change the way built-in for example, if you don't like the documents and media library's file manager view with large icons, you can create an application display template that shows documents in a list view. layout of the blogs portlet, you can change it so that it has the look you want liferay portal goes far beyond this, though. special software components called hook and ext plugins enable developers to change any aspect of liferay's interface and behaviorwithout having to modify any of liferay portal's source this provides you all the benefits of building your site from scratch, but without all the effort to actually build from scratch. change to the user registration screens, add support for a proprietary single sign-on mechanism that you've written, add a feature to the message boards application, or anything else, you can make those customizations. a developer, we're sure you know that it's a whole lot easier to customize something that almost does things exactly the way you want than it is to write with liferay portal, you can have your cake and eat;;
|
"in the audience targeting application, a user segment is defined as a group of users that match a set of rules. out of the box, liferay provides several types of rules that are based on characteristics such as age range, gender, location, liferay audience targeting rules article for information on each rule type, and their configuration options. extend the set of available rule types, you can create a class that implements interface and deploy the class in your own osgi plugin osgi plugins can be hot-deployed and undeployed, they manage their own dependencies, and they can provide new services that other osgi plugins can the audience targeting application can consume services from rule osgi this tutorial shows you how to create a custom rule type and deploy it in an but before you begin creating a rule type, you must learn how to install and use the audience targeting project. these things, plus it gives you helpful tips before you can take advantage of the audience targeting project's scripts for creating rules, reports, and tracking actions, you must first install the to do this, you should install the audience targeting sdk so what does audience targeting sdk provide that's useful for audience first, the audience targeting sdk contains a liferay plugins sdk that facilitates deploying audience targeting plugins to liferay portal. the audience targeting sdk includes the audience targeting project, so you can leverage its development scripts to generate customizable rule, report, and the audience targeting sdk essentially provides an audience targeting development environment you can download the audience targeting sdk from once you've downloaded the audience targeting sdk installation's you'll want the plugins sdk to point to your application server. about setting up and using the plugins sdk included with the audience targeting sdk, you can visit the tip you can specify the following portal property setting so that the freemarker code is always retrieved from the template, next, you'll learn how to create a custom rule type using the audience targeting adding a new type of rule to the audience targeting application is easy. part of the tutorial, you'll learn how to create a rule and deploy it to your in the root audience targeting project folder appscontent-targeting, run the createrule command appropriate for your os from a command prompt. for example, the command below creates a rule project with weather for its project name and weather as its display name navigate to the newly generated project folder that has your rule's name prefixed with rule- e.g., rule-weather . the createrule command created default files that make the plugin now is a convenient time to deploy the project to see how it currently looks to deploy the plugin project, open a terminal to your plugin project's directory and run the ant deploy command. you'll find this new rule listed when creating or editing a user segment in the audience targeting tip if a plugin has been successfully deployed, but its changes aren't visible, check that the generated.jar in the plugins sdk's dist folder contains the latest modifications. if it doesn't contain them, delete it and then redeploy the plugin to view your new rule, navigate to your portal's admin site see the rule you just deployed, click add user segment, scroll down to the rules form, and expand the sample drop-down menu figure 1 although your new rule is very bare bones, it is deployable to your portal straight out of the box the default rule doesn't evaluate anything yet, but you can drag and drop the rule onto the form, as shown above you've deployed your rule plugin. next, you'll need to learn about the components that were generated for you and how to edit them to create a functional audience targeting rule there are three components you can specify for your rule the behavior of your rule is controlled from a java class file located in your ui and language keys can be configured in the url and the latter two components later on note if you're planning on developing a social rule type that classifies users based on their social network profile, it's important to remember that they will not work properly unless the specific social network's sso single sign on is enabled and configured properly. now, you can begin creating your rule's functionality by specifying its behavior in the -rule class e.g., url that the sdk generated for interface required, and extends the it's not mandatory to extend baserule, but it provides some helpful utilities, such as support for generating your rule's ui using freemarker. note that there are multiple methods in the generated -rule class; you must modify them to create a working rule if you navigate back to your rule deployed in your portal, notice that it's listed under a category named sample and that it uses a puzzle piece icon. you can change both a rule's category and icon by modifying their respective open your rule's java class file and find the geticon method. configures the icon displayed in the rules ui. value icon-puzzle with the name of a font awesome icon e.g., icon-coffee or icon-globe that appropriately fits your rule. complete listing of icons that you can specify, you can visit locate the getrulecategorykey method and replace its return value with the key name of the category in which you'd like your rule to reside. example, to categorize your rule in the session attributes category, replace the return value samplerulecategory.key with the value sessionattributesrulecategory.key, and make sure to import that class. there are several category classes listed redeploy your rule plugin by running ant deploy from the command prompt. now your rule uses its new icon and resides in the category you specified figure 2 this example weather rule was modified to use the sun icon and to reside in the session attributes category now that you've modified some basic features in your -rule class, you'll need to develop the ui for your rule's configuration. project already has an ftl template, which is used to show the rule's form. since a generated rule java class extends baserule by default, your rule already supports using the freemarker language if you're interested in using a technology besides freemarker to implement your ui, you can add a method getformhtml to your -rule class. details on this method, see the the getformhtml method is configured for freemarker templates in the this method is used to retrieve the html created by the technology you choose, and to return it as a string that is viewable from your if you plan, therefore, on using an alternative to freemarker, you must override this method by creating and modifying it in your -rule class. this tutorials demonstrates implementing the ui using freemarker if you wanted, for example, to create user segment rules based on the type of weather a user is experiencing, you could create a drop-down menu that lets the administrator select a weather type to associate with that user segment rule. here's a code snippet from a freemarker template url that could be applied to this example this freemarker code creates a select drop-down box with the name weather. then it specifies several options associated with different types of weather. you could borrow from this freemarker code and change the name and labels for a select drop-down box and values appropriate for your rule plugin figure 3 this example rule uses a select drop-down box for other working examples of freemarker templates used for rule configuration, note recall the last component of audience targeting rules language keys. to learn more about language keys and how to create, use, and generate them, now you'll jump back into modifying your rule's behavior via the -rule class find the processrule method in your -rule class. when you click save after selecting your rule in the rules form. portlet's request and response, the rule instance's id, and the values from the form can be used by this method in some cases, you may need to retrieve info from the portlet's request this tutorial demonstrates using the this parameter represents all the values on the form if you wanted to process one of the form's values, you could do that from the you'll need to return the string value for the selected entity you chose for your rule type. for example, recall the freemarker code to retrieve the selected value from the select box, you'd need to retrieve the weather value the return value is stored in the typesettings of the rule instance. typesettings field is managed by the framework in the rule instance table the next method you'd modify is the populatecontext method. method takes the value the user selected and injects it into the context for example, the following populatecontext method populates a weather context variable with the weather value of the values map in this example implementation, this method checks if the values are if they're not available, it checks for the then the context map is updated by assigning the you've processed your rule and populated the rule's context. step you'll need to take is specifying what your rule should evaluate. evaluation process determines whether a user matches the rule find the evaluate method in your -rule class. obtains the runtime user's value for what you plan to evaluate. you can look at this method's code in the downloadable zip file for the insert logic that retrieves the value you stored in the type settings, using for the weather example, you could retrieve the value from the rule instance's type settings now that you have both the user's value and the rule's value, check whether if they match, return true; otherwise, return false finally, deploy your rule plugin to the liferay server. functional, and the ui you've defined is added to the addedit user segment form so that administrators can set a value for that specific user segment you've created and deployed a fully functional rule here are some things to consider as you implement and deploy rules if you deploy your rule into a production environment, you may want to consider adding your values to the cache e.g., weather in different locations, since obtaining the same value on every request is very inefficient and could result in slowing down your portal as an alternative to storing complex information in the typesettings field which is managed by the framework in the rule instance table, you may want to consider persisting to a database by using which is supported in the rule plugins deletedata method in your -rule, so that it deletes any data associated with the rule that is currently being deleted if your rule handles data or references to data that can be staged e.g., a reference to a page or web content article, you may need to override exportdata and importdata methods, to manage the content properly. example of how these methods are used, visit the you now know how to create a custom rule type for your audience targeting for working examples of the default rules included in the audience targeting app, visit the audience targeting study the folders with the rule- prefix. to view the final solution of a deployable sample weather rule, you can download its developing with the plugins sdk using service builder to generate a persistence framework";;
|
in the audience targeting application, a report is a tool that allows administrators to analyze the behavior of users in a campaign or belonging to developers are able to extend the set of available reports by creating and deploying their own osgi plugins which contain a class implementing the osgi plugins can be hot deployed and undeployed, manage their own dependencies, and provide new services that other osgi plugins can consume. report osgi plugin, it is consumed by the audience targeting application to follow this tutorial, you must first have the audience targeting plugins sdk configured properly. installing the audience targeting project section for information on how to do this adding a new report to the audience targeting application is easy. tutorial, you'll learn how to create a report and deploy it to your liferay in the root of the audience targeting project, run the createreport command depending on your os. for example, the command below shows creating a hits-by-country report named hits by country move to the newly generated folder that has your report's name prefixed with files have been added by the createreport command. if you now run the ant deploy command in the root of the newly generated folder, you'll find this new report listed when you select the reports action in the action menu of a specific campaign in the audience targeting application of course, you still need to make some changes to define how your report open the java class file that was created here are some of the methods that you can implement to modify your report behavior getreporttype determines the associated resource for the report. default, the resource is a campaign, but you can change it to user segment to create a report for this type of resource updatereport called by the report ui to generate or update the report. therefore, it should process the available information e.g., from the analytics service and persist it so it can be displayed as a tablechart gethtml returns the html displayed to administrators when accessing the basereport class already implements this method including a freemarker template placed in url. for example, for a hits by country report, you could display the country flag and the number of hits for each country geticon configures the icon displayed in the report gui. the name of a fontawesome icon. see font awesome documentation getname the name of your report it can be localized finally, deploy the report plugin to the liferay server. listed when you select the reports action in the actions menu of a specific campaign in the audience targeting application. button to force your report to obtain and display the latest information you're now equipped with the knowledge necessary to create a custom report for your audience targeting app. default reports included in the audience targeting app, visit the audience page and study the folders with the report- prefix customizing liferay portal with hooks;;
|
"in the audience targeting application, a campaign defines a set of content targeted to specific user segments in a time period. campaign administrators to learn how users behave in the context of a campaign by monitoring their interaction over different elements of the portal developers are able to extend the set of available tracking actions by creating and deploying their own osgi plugin, which contains a class implementing the osgi plugins can be hot deployed and undeployed, manage their own dependencies, and provide new services that other osgi plugins can consume. tracking action osgi plugin, it is consumed by the audience targeting to learn more about how tracking actions are used in the audience targeting to follow this tutorial, you must first have the audience targeting sdk installing the audience targeting project section for information on how to do this next, you'll begin learning how to create a custom tracking action using the adding a new tracking action to the audience targeting application is easy. in this tutorial, you'll learn how to create a tracking action and deploy it to in the root audience targeting project folder appscontent-targeting, run the createtrackingaction command appropriate for your os from a command for example, the command below shows creating a newsletter tracking navigate to the newly generated project folder that has your tracking action's name prefixed with tracking-action- e.g., open the folder and study what's been the createtrackingaction command created default files that make the now is a good time to deploy the project to see how it currently looks in to deploy the plugin project, open a command prompt to your plugin's directory and run the ant deploy command. tracking action listed when creating or editing a campaign in the audience tip when a plugin has been successfully deployed and you don't see its changes, check that the generated.jar in the plugins sdk's dist folder contains the latest modifications. if it doesn't contain them, delete it and alternatively, you can run the ant clean deploy to view your new tracking action, navigate to your portal's admin to see the tracking action you just deployed, click campaigns add then scroll down to the tracking actions form figure 1 you can add your new tracking action to the form, but it doesn't do anything yet you've successfully deployed your tracking action plugin. about the components that were generated for you and how to edit them to create a functional audience targeting tracking action there are four components you can specify for your tracking action the behavior of your tracking action is controlled from a java class located in the tracking mechanism e.g., hook or servlet is not included by default; you'll need to create this manually. language keys can be configured in the url you can learn more about language keys and how to create, use, and generate them you'll learn about configuring a tracking mechanism and ui later in this you'll begin with customizing your tracking action's behavior you can begin creating your tracking action's functionality by specifying its behavior in the -trackingaction class e.g., newslettertrackingaction that interface required, and extends the it's not mandatory to extend basetrackingaction, but it provides some helpful utilities, such as support for generating your tracking action's ui note that there are multiple methods in the generated -trackingaction class; you must modify them to create a working tracking you'll begin defining the tracking action's behavior by modifying the way it looks to administrators in the tracking actions form when studying your tracking action in portal, notice that it uses a puzzle piece you can change the tracking action's icon by modifying the geticon default method used in the -trackingaction class open your tracking action's java class file and find the geticon method. this method configures the icon displayed in the tracking actions ui. replace the value icon-puzzle with the name of a font awesome icon e.g., icon-envelope-alt or icon-trophy that appropriately fits your for a complete listing of icons that you can specify, you redeploy your tracking action plugin by running ant deploy from the command now your tracking action uses its new icon figure 2 your tracking action now uses the font awesome icon you specified now that you've modified a basic feature in your -trackingaction class, you'll need to develop the ui for your tracking action's configuration. earlier, your tracking action already has an ftl template, which is used to show since a generated tracking action java class extends basetrackingaction by default, your tracking action already supports using the if you're interested in using a technology besides freemarker to implement your ui, you can add a method getformhtml to your -trackingaction class. further details on this method, see the the getformhtml method is configured for freemarker templates in the this method is used to retrieve the html created by the technology you choose and to return it as a string that is viewable from therefore, if you plan on using an alternative to freemarker, you must override this method by creating and modifying it in your this tutorial demonstrates implementing the ui using for example, if you wanted to create a tracking action that tracks the number of times a user views a newsletter, you could create a menu with the following here's a code snippet from a freemarker template e.g., url that could be applied to this example this freemarker code creates an aui input field for an alias and newsletter id, the alias and newsletter id fields are necessary because a name and id are required for the tracking action to know which another field that is created from the above sample code is the tracking action the tracking action specifies the type of event to monitor related to the event type available, the tracking action field is a select drop-down box; otherwise, the event type field is disabled or view only. template, you'd need to declare the possible eventtypes in your you'll learn how to do this later figure 3 this newsletter tracking action requires the newsletter alias and id for other working examples of freemarker templates used for tracking actions, visit the audience targeting project now that the your tracking action's ui is developed, you can resume the configuration of your tracking action's behavior. your -trackingaction class is the populatecontext method. the values that were entered by the user in the tracking action form and injects them into the context map parameter. populatecontext method populates the eventtypes variable that was used in the newsletter ftl sample with the event types available in the newsletter by populating the eventtypes variable, the tracking action field can use it to distinguish whether or not a drop-down menu of tracking actions is displayed. in many cases, a tracking action has multiple tracking event options. tracking options your tracking action provides, the more opportunities you have to decipher your audience's likes and dislikes within your site this sample newsletter tracking action tracks who views the configured newsletter by placing a transparent image in the newsletter. is viewed, the image makes a call to the tracking mechanism, which computes and you'll learn more about the tracking mechanism and how you'll also learn more about the transparent image and how it communicates with the tracking mechanism later in this tutorial notice in the populatecontext method above, a tracking url...track is created and a tracking image url is injected into the context parameter. are used in the tracking mechanism that you'll create next now that your tracking action's behavior is configured, you'll create the this can be done using a hook or servlet. you'll learn about creating a tracking servlet the first thing you'll need to do is create a separate java class where all there are two important aspects of the tracking mechanism that you'll need to to illustrate how to accomplish these two goals, you can study the class, which tracks when a user views a newsletter whenever the transparent image is viewed in the newsletter, the image makes a the servlet intercepts all requests matching the pattern track in order to track the request's information. populatecontext method that you injected the tracking url...track into the this is what is used to distinguish calls to the servlet that are relevant to the tracking action once the servlet intercepts the calls related to the transparent image, it must an analytics service which can be used to store your tracking information is available for that purpose in the newsletter servlet tracking mechanism, the tracking information is object and sent to the analytics service using liferay's message bus using the message bus is a common way to send tracking information for storage in liferay's analytics service. to learn more about liferay's message bus, visit now that you know about the tracking mechanism and how it should function, it's time to finish off your custom tracking action throughout this tutorial, using a transparent image that sends requests to the tracking mechanism when the newsletter is viewed has been mentioned frequently. you're probably curious as to how a transparent image can be added to content to the transparent image can be generated as a code snippet by your tracking action once you've entered the id into the form. once saving, you can add the generated code into the content you'd like to track e.g., newsletter figure 4 you can insert the transparent image into your content by copying and pasting the generated code from the form to do this, you'll need to make a few modifications to your ftl file. example to reference, view the sample newsletter's diffs, which highlight the logic necessary for your tracking action to generate in summary, the -trackingaction class generates a generic tracking url which in the updated ftl, the newsletter id you specified in the form is added, supplying the full tracking url that should be you now have all the knowledge necessary to create your own customized tracking action and deploy it to your audience targeting application. examples of the default tracking actions included in the audience targeting app, study the folders with the tracking-action- prefix. of a deployable sample newsletter tracking action, you can download its";;
|
have you ever wanted to share page templates with other users? and clients banging at your door to get hold of the structures and templates you use for your web content articles and wikis? if so, you can bundle these up in a liferay plugin to distribute to them. you can even put them in a marketplace app when they install your plugin, its templates and structures are automatically imported into their portal's global site. the templates importer feature of the resources importer app the resources importer is available from the templates importer is a part of the resources importer app. import the following resources although you can include the template importing capability in any liferay plugin, they're especially useful for liferay themes. upload themes to liferay marketplace, it's very convenient for them to be able to bundle sample content with the theme so that the theme can be viewed in an appropriate context. importing resources with your themes tutorial for instructions on using the resources importer with theme plugins. portlet plugins are the most common type of plugin used for importing templates. let's build a portlet plugin that imports some web content structures and if the resources importer is not already installed on your portal, visit liferay marketplace to download and create a portlet plugin project with the name of your choice. edit your url file to include the following here's a summary of what we're accomplishing with these settings - we remove the plugin's name value to prevent the portal from displaying the plugin as an available app. - since the templates importer feature resides in the resources importer web plugin, we include it as a required context. - by enabling developer mode, if the templates we're importing to the global site already exist on it, the templates importer conveniently - we set the module increment version to 1 since 1 is an appropriate version starting point for the plugin's version edit the portlet's url file and delete the value of its display-name element to keep the portal from displaying the portlet as an create a folder named templates-importer in the plugin's web-infsrc this folder will hold all of the structures and templates to import let's stop here for a moment and consider how to specify templates and the templates importer expects them to be specified in a directory structure under the plugin project's templates-importer folder. create folders to contain the template and structure files to apply to the here's the directory structure to follow for specifying folders to contain your for structures and templates in your custom plugins, you only need to create folders to support the templates andor structures you're adding we've provided a zip file of the folders, templates, and structures for the content, please take the following steps extract its contents into the templates-importer folder of the deploy the sample-templates-importer-portlet plugin into a liferay the console output should be similar to this view your resources from within liferay. administrator and check the global site to make sure that your resources were here's how you can use the control panel to view your the figure below shows some of the adts that were imported figure 1 the templates importer allows users to import all kinds of structures and templates, such as these application display templates as you take a look around the folders and files within the plugin's templates-importer folder, notice the different kinds of templates and page templates are specified in.json files in the template, web content, assets, and portlet configurations to be imported with here is the contents of the url file at the bottom of the json file, there are several important specifications for you can specify different layout templates to use for individual you can find layout templates in your liferay installation's layouttpl you can specify a name, title, and friendly url for the page using the respective name, title, and friendlyurl fields. demonstrated in this page template, you can even set a page to be hidden turning your attention to the columns of the json file, notice that you can declare portlets by specifying their portlet ids. liferay's core portlets, see the url file deployed in if you're using the web content portlet, you can declare articles to be displayed on a page, by specifying html files. interestingly, the url file demonstrates using the nested portlets portlet to display other portlets the search and currency converter portlets. lastly, you can also specify portlet preferences for each portlet using the tip you can also import resources, such as web content articles, using the for example, it's very useful to import web content articles along with a page template that references the articles, in a nested web content for more information on importing resources, see importing resources with your themes the figure below shows a page created using the page 3 template figure 2 users can create pages, like this one, prepopulated with portlets and content that you've specified in your plugins, that leverage the templates importer now that you've learned about the directory structure for your templates and the json file for the page templates, it's time to learn how to put template and structure files into your plugin. you can create structures and templates from scratch andor leverage ones you've already created in liferay. how to leverage bringing in xml structures and ftl or vm template files from the sections below explain how to create structure and template files to put within the defined directory structure of the portlet's templates-importer importantly, you must name the files of all structures and templates, except page templates, after their source structures and templates. any of the beginning steps in this section to make refinements to the sample plugin to try importing different structures and templates. sample-templates-importer-portlet project is available here as you've seen for yourself, importing structures and templates with your plugin the resource importer app's templates importer feature have fun distributing your structures and templates! customizing sites and site templates with application adapters advanced content with structures and templates;;
|
osgi open services gateway initiative is a framework for developing modular osgi implements a complete and dynamic component model. components, also called bundles, can be remotely installed, started, stopped, updated, and uninstalled without requiring the osgi runtime to be restarted. about its java packages and classes. bundle life cycle management is implemented via apis that allow for remote downloading of management policies. registry allows bundles to detect the addition of new services, or the removal of services, and adapt accordingly. liferay 6.2 includes an osgi runtime in which liferay plugins that are packaged as osgi bundles can run. services are available to liferay's osgi runtime and can be invoked from liferay in this tutorial, we explain how to create, package, and deploy note liferay 6.2's osgi runtime is it should be considered a technology preview at osgi web application bundles are usually distributed as jar files. architecturally similar to standard web application archives. application bundles differ from standard web applications archives, however, in that they must include additional metadata that's required for operating in an the osgi specification does not require a specific file extension for web application bundles web application bundles typically have a.jar extension but a.war extension is also possible to create an osgi plugin for liferay, you need a liferay plugins sdk. that the plugins sdk version matches your liferay portal version. extracted the plugins sdk, navigate to its shared folder. your osgi plugin project in the shared folder. e.g., create a new folder called in your plugin project folder, create two bnd is a tool that makes it easy to create osgi bundles. you can specify in your url file. basically, your url file contains instructions about dependency management and how to create your osgi bundle's your url allows your project to take advantage of the liferay plugins add the following code to your url, replacing the value of the element's name attribute with the name of your your url and url files constitute all the osgi-specific with these files in place, you're ready to write when you're ready to package your osgi bundle, just run ant jar from your plugin project's root folder the one with the url and url files the bnd.jar in the plugins sdk reads the instructions in your url file and creates all the files required by osgi, including the meta-infmanifest.mf. your plugin is packaged as a jar file which is created in the plugins sdk's dist folder when you're ready to deploy your osgi bundle, make sure that you have the following properties set in your build.username.properties file in your once these properties are set, run ant deploy from your plugin project's root this both packages your bundle and copies it to liferay homedeploy. liferay portal scans the liferay homedeploy directory for osgi bundles, as well as for standard liferay plugins. when it detects an osgi bundle, it automatically deploys the bundle to liferay homedataosgimodules. your log for confirmation that liferay found and deployed the bundle. 184650,656 info url.autodeployscannermoduleautodeploylistener69 module for url copied successfully. deployment will start in a few seconds finally, check your liferay homedataosgimodules directory to make sure that your bundle was successfully deployed. to customize liferay portal's module framework, including the osgi framework's auto deploy directories, please see the module framework sections of liferay's url file for example, you can set a comma-delimited list of directories to scan for modules to deploy, specify how to often to scan the directories for changes, etc. remember not to make customizations to the url file itself but to instead add customized properties to a url file in;;
|
everyone wishes that cyberspace were free of malicious software and unwanted since it isn't, you need to guard yourself and your portal from these liferay portal's plugin security manager to the rescue! super-hero in a cape and tights, except, well, it's not in its quest for peace within your portal, the plugin security manager pledges still not sold on the need to use liferay's plugin security manager? scenarios in the following section might change your mind consider the following scenarios these are just a few situations that may ring true for you. responsible for keeping your system running well 24x7, you can't be too cautious in protecting your portal, system, and network when the plugin security manager is enabled for your plugin, it checks your plugin's portal access control list pacl. this list describes what apis the plugin accesses, so people deploying the plugin can review what it does without if the plugin tries to access anything that's not on this list, the plugin's request is stopped dead in its tracks and the security manager logs information on the plugin's attempt to access the unauthorized apis access to apis and resources is authorized by means of property values specified specified in your plugin's web-inf directory. properties are collectively known as the plugin's pacl as you develop plugins for liferay marketplace or for distribution within your organization, you need to set the security management properties appropriately. before you dive into the intricacies of these properties, you should first consider a plugin development approach that involves designing an app for the security manager from the ground up when you start developing your plugin, you may not have a clear picture of all the aspects of the portal you need to access, and that's fine. recommended that you go ahead and develop your plugin first and address your plugin's portal access control list pacl later. plugin there are some common security pitfalls that you should avoid. develop your plugin you'll dig whole-heartedly into security management by generating and fine-tuning your plugin's pacl. if you're developing a plugin as part of a free app, writing the plugin's pacl and enabling the security manager for the plugin are optional here is the suggested process for developing secure plugins a key step in this process is turning on the security manager. if you want to distribute plugins, either on the liferay marketplace or through your web site, you have to assume that users will insist the security manager is for this reason, you should enable it when testing your plugins and packaging them for distribution it's very easy to activate the security manager. property to true in your plugin's url file now you know the basics of how liferay plugin security works developing with the plugins sdk developing plugins with liferay ide;;
|
as you develop your plugin, you need to anticipate your plugin's actions in light of liferay's secured environment. liferay's plugin security manager leverages the java se security architecture. therefore, understanding java se security and learning the few requirements that liferay's security manager adds on top of it will benefit you as you develop plugins. security architecture documentation is available for you to read at this tutorial highlights a couple of common mistakes developers make that violate liferay's secured environment you wouldn't intentionally make these kinds of mistakes, but it's easy to make them if you're not being careful enough. this tutorial considers scenarios that illustrate both of these mistakes and then explains how to avoid making them in security exceptions are presented first when you're running on liferay portal with the security manager enabled for your plugin, you must only access authorized resources. declared as throwing a security exception i.e., url.securityexception and you're not authorized to access the resources the method uses, the method throws the security exception and the security manger stops your plugin dead in security exceptions are unchecked, meaning that the compiler doesn't require your code to handle them. however, since methods that throw security exceptions are declared as throwing them, you should check their signatures while you're designing your plugin. if the methods your plugin uses throw security exceptions, handle them appropriately with trycatch blocks. mind that you must handle a method's security exception regardless of whether your plugin invokes the method directly or indirectly for example, you may be using a file utility that calls the canread method of since the canread method can throw a securityexception, your plugin will violate security if it invokes the utility on a file that you're not authorized to access. it's therefore important that you're aware of all the security exceptions thrown by methods that your plugin invokes, regardless of whether it invokes the methods directly or indirectly operations involving reflection and similar activities can typically throw the java se security documentation explains how to deal in many cases, you can declare your plugin's permissions to avoid configuring your plugin's permissions and security policies is covered in the tutorial building and testing your plugin's pacl the second common mistake you should avoid is allowing your plugin to bring up classloaders unintentionally, via other frameworks or libraries. following spring configuration from a plugin it declares a factory bean that calls a method on a liferay class. unfortunately, spring tries to grab the classloader for the since the factory class does not belong to the plugin, the security manager balks at the plugin's attempt to access the classloader for the the security manager forbids applications from accessing arbitrary classloaders because the classloaders can add, access, and modify classes that your plugin is not authorized to access. manner violates the secured environment how do you get around this issue? you could simply invoke the method directly but if you insist on using a spring factory bean, you can do the following write a class inside your plugin to act as a factory. should declare a class that wraps the type of instance your factory returns. your factory should also implement a method that returns the instance, wrapped in the class you declared configure a spring factory bean that uses your plugin's factory class here's what your plugin's new factory class could look like the code above declares a factory class named factoryutil that resides in a the factory declares an inner class named testuserlocalservicewrapper that extends liferay's userlocalservicewrapper class you want the factory to return. lastly, the getuserlocalservice method uses the original factory method, url, to get this instance is wrapped up in your factory's in your plugin, you've implemented a factory class to access the instances you want. your new spring factory bean would look like the following configuration now you know a couple alternatives to using the troublesome spring factory bean configuration that accesses a classloader that doesn't belong with regards to both of the use cases illustrated in this tutorial, the main point is that you must be aware of the how the libraries you use behave with respect to your secured environment. the better you understand java se security and liferay's plugin security management, the easier it is for you to write keeping this in mind, you can now confidently proceed developing with the plugins sdk developing plugins with liferay ide;;
|
liferay's plugin security manager requires that a plugin specify in advance the portal resources that it intends to access. something it hasn't told the security manager about, the security manager puts a a plugin's portal access control list pacl is its way of telling the security manager what it intends to access this tutorial shows you how to build and test your plugin's pacl through the lastly, this tutorial explains some of the subtle details about the pacl now go ahead and get startedyou don't want to run afoul of the security start by creating your plugin the way you normally do. write the code, unit test your code, and have users beta test your app. essence, do everything you normally do. do all of this with the plugin security manager disabled via your plugin's url file before the plugin security manager is enabled, you must specify the resources you do this by building a list of these resources in your rather than tediously figuring out all of the resources your plugin accesses on your own, let liferay's pacl policy generation tool to give you a head start! the generation tool detects the resources your plugin accesses and writes the corresponding pacl properties to a policy file. properties from this policy file into your plugin's here's how to generate a pacl policy for your plugin make sure your liferay portal instance has liferay set as its security manager strategy value and that the security manager was activated during to set your portal's security manager strategy value to liferay, simply specify the following in your url file your app server may require certain startup arguments to be used for activiting the security manager. check the pacl and security manager instructions for your app server in the chapter of using liferay portal. a terminal message like using security manager, indicating that it's unless you already started liferay with the security manager enabled and activated as described above, you must restart liferay with these settings enable the security manager to generate a security policy for your plugin by setting the following property in your plugin's the pacl policy generation tool writes a pacl policy file with the following liferay portal's security manager performs security checks on your plugin at deployment time and as you exercise your plugin's features. throwing errors on failed checks, the generator tool writes suggested rules that specify access to the resources your plugin accesses unless you've turned off logging for the generator tool, messages like the ones below are logged, reporting the various authorization properties that lastly, merge the properties that the security manager wrote i.e., your newly generated pacl policy file it's just a matter of merging the properties that start with the security-manager- prefix need to be restarted after deploying your plugin, in order for the security manager to detect and write out the complete set of policies for a plugin. you are using your plugin with the security-manager- generated properties the first time and notice security violations, then you may need to turn on policy generation one more time and restart liferay. this gives the security manager another opportunity to detect additional properties to satisfy your security if you are still seeing security violations on deployment, you'll need to address them per instructions that follow in this tutorial. work-around steps remove the previously generated servletcontextname.policy file, set security-manager-enabledgenerate in plugin, and merge any new properties from the newly generated now that you've thoroughly specified the resources your plugin accesses, you can enable the security manager and do final testing of your pacl properties if you want to distribute plugins, either through the liferay marketplace or your web site, you have to assume potential users will insist that the security manager be enabled in your plugin. for this reason, you should enable it when to enable the security manger set the following then re-deploy your plugin and re-test its functionality. throws java security exceptions if your plugin accesses resources that are not specified in your plugin's security policy. as you test, keep track of these java security exceptions so you can authorize access to the respective resources in the pacl properties of your url file. your changes to the file, re-deploy the plugin, and re-test. if it doesn't, there are more rules you must declare for your for additional details, refer to the online definition of the portal access control list properties for the url file and refer to the pacl properties section at the end of this tutorial if you're not finding an adequate way to specify a security rule with pacl, you can specify it in a java security policy file. liferay and pacl to be aware of every possible security implementation check, because developers, libraries, and the java security api can always call for new liferay, therefore, provides a java security policy the policy file lets you specify operations permissible within the context of your app's plugins in case you need it for your plugin, go ahead and get familiar with the java if you can't find a way to specify pacl permissions for an operation that your plugin must access, you can specify the permission in a java security policy you can create the policy file url in your plugin's web-inf the policy file must follow policy file syntax as described in detail at like the rules you define in your plugin's pacl, the additional rules you define in your plugin's java policy file, url, only apply to that plugins aren't privy to each other's security policies importantly, the java policy file should only be used to specify rules liferay's pacl property implementation does not already support. any rules in a java policy file that you can specify in a pacl here's a scenario that calls for using a java security policy java has a security implementation called it checks a whole bunch of networking operations that liferay's implementation in case you want to perform one of these operations, like using a custom stream handler, you can grant your plugin permission to do so in its this grant entry defines permission for the plugin's code to access the specifystreamhandler target operation of the url.netpermission class. the codebase value, in this example, specifies the following on reading this plugin's.jar file, the jvm creates a codebase for it. codebase uses properties that liferay sets for the plugin that in effect say, if a file originates within the plugin, then this plugin can perform the specifystreamhandler operation on it. the codebase narrows the scope for the this plugin is permitted to perform the defined operation specifystreamhandler, as long as it is done within the scope the plugin how do you add more permissions to a codebase? in this example, the plugin is granted permission to invoke native code that's this is another type of operation that liferay's it, therefore, makes sense to specify permission for it in the java security policy file with liferay's pacl policy and java security policy files, you can precisely specify all of the resources your plugin needs to access! revisit the file path values that the pacl policy generation tool wrote to your as mentioned earlier in this tutorial, using the pacl generation tool to give you a head start on specifying your plugin's security rules is recommended. generator, however, is only aware of file paths with respect to the current the file paths it genereates are absolute paths. policy in production, the policy should use only relative file paths. step after testing the generated pacl, you must massage the generated file paths into the appropriate relative file paths. for example, you can specify paths relative to your liferay web portal directory this example uses a dash - character at the end of the paths. oracle defines wildcards to use with java security, you can leverage the following wildcard characters for files and file paths for example, if you want to match all of your theme files and directories, the star means every file in this single directory. everything in this directory and below the dash lets you read the contents of the directory, but not the directory also, when defining the directory don't include a trailing slashotherwise the directory itself won't be included. specifies the themes directory and all its contents for file path separators, you can use the alias you now know how to specify your policy's file paths appropriately for deployment on any server. once you've completed testing your plugin without getting any java security exceptions, you can distribute it as an you can do so with confidence because you've specified all of the resources it uses in the application's pacl, and possibly your application satisfies liferay portal's security the next section provides some additional details regarding pacl properties liferay portal's plugin security manager checks all your plugin's api access attempts against the security manager properties specified in your plugin's if your plugin tries to access a portal resource that is not specified in these properties, the plugin security manager prevents it from happening. consider this a virtual finger waggin'. prevent this from happening, you have to tell the plugin security manager up-front the access your plugin needs the online definitions for the pacl properties can be found at if you have the liferay portal source code, you can find the some of the properties accept wildcard characters that have special meaning. following properties address file deletion, execution, reading, writing, and here's an example that uses the - character to specify that the plugin is permitted to delete files in the..webappschat-portletweb-infsrccomliferaychattemp directory and its note that you can use relative paths in the file security properties you can also use a mix of unixlinux and windows style paths, as demonstrated the following example uses the character to specify that the plugin reads files in the..webappschat-portletimages and..webappschat-portletweb-inf directories, but not in their for socket security properties, the character represents any hostname. example, url matches any host ending in url, such as now you know how to build and test your plugin's pacl. how to use a java security policy file in cases where the pacl just isn't armed with this knowledge, you can confidently build, test, and deploy plugins that don't end up on the wrong side of liferay's plugin security developing with the plugins sdk developing plugins with liferay ide;;
|
"enforcement of the general data protection regulation gdpr began may 25, companies processing the personal data of eu residents must adopt appropriate measures to protect their user data. resources discuss the implications of the regulation and the steps companies must take to ensure compliance the goal of this article is to help you tackle two of gdpr's technically for the upcoming release of 7.1, this describes new features to more easily tackle these requirements. features are planned for version 7.0 in a future service pack release following the release of version 7.1. code described here equally apply to versions 6.2 and 7.0. better native support for complying with gdpr. those features and more, of course the code supplied here demonstrates an approach you can use when developing two particularly difficult requirements of your full gdpr solution. your responsibility to assess your own organization's usage of personal data and the work required to comply fully with gdpr the code referenced here could be deployed via the scripting console or a sample web plugin containing this requires organizations to provide a machine-readable export of a user's personal there's no easy way through the ui to export a given user's personal data on one straightforward way to fulfill this requirement programmatically for applications built using service builder is to leverage this example exports all of a user's blogs created using liferay's it starts by creating an instance of blogsentryactionabledynamicquery and overriding the addcriteria method to grab all blogentries that match the user by userid or statusbyuserid. returns all blogs where the user is the original author or the last editor next it overrides performaction to write all matching blogentries to a json library to jsonify output, as it provides powerful customization features this naive implementation serializes all fields for blogsentries including system data like groupid, allowpingbacks, status, etc. the is formatted since a user's personal data is all that must be exported, we leverage jackson's now the exported data is cleaner and only contains user-inputted personal data as this code is essentially boilerplate for all of liferay's service generated classes, you can generalize this solution using reflection also known as the right to be forgotten requires organizations to erase a user's personal data upon request excluding data the organization has a legitimate reason to retain like financial records, public unfortunately, simply deleting the user object by calling url user does not sufficiently fulfill this requirement as content created by the user is understandably not deleted. fortunately, we can leverage the same logic in the data portability code example to locate and delete a user's personal data. continuing with the blogsentries example, you can simply delete any blog where the userid or statusbyuserid but what if blogs contain valuable data we want to keep? member wrote a blog post on de 7.0 upgrade tips but now requests to be in many cases, businesses want to anonymize personal data rather than anonymization requires data to be scrubbed such that it does not relate to an identified or identifiable natural person or in such a manner that the data subject is not or no longer identifiable recital this means at the very least you must alter the username field so the user no longer appears as the author or editor of the blog. requires more than just replacing names, email addresses, and other personally the blog's content must be reviewed and sanitized. example, a blog post on de 7.0 upgrade tips might begin with an anecdotal introduction like, i've seen some horror stories in my ten years as the it even though this sentence doesn't include any contact details, it's easy to identify the author via a quick social media unfortunately, this means proper anonymization can potentially be an imagine reviewing the thousands of forum posts an ultimately, whether and to what extent a business must judiciously review and edit every word, image, and detail during anonymization must be evaluated by each business. likelihood of identification and so on must be weighed, reasoned, and for our example, say you want to review the data first. export the personal data first using the code from the data portability section and review the blog title, subtitle, content, etc. various strategies can be used to search for certain contact details like user alias, email the content can then be updated either programmatically or through liferay's web interface after the content has been satisfactorily sanitized, you can replace the userid and username using the same actionabledynamicquery logic above. before doing so, you should create an actual user object populated with this makes it easier to identify all data in the future again, this solution is mostly boilerplate code and can be generalized to data these examples demonstrate how to leverage liferay's existing apis to address gdpr's new standard for personal data protection. involves much more than technical measures; it requires re-thinking, re-evaluating, and raising the standards of data protection for most modern";;
|
with liferay, so you don't have to do anything special to enable them for your but what if you need settings in addition to liferay's default you could develop a theme or hook with the display options you need, but it'd be nice if you could apply particular display options to specific portlet instances without having to redeploy any plugins. able to provide authorized portal users the ability to apply custom display this saves you from having to change portlet configuration code every time you need new settings adts providethe ability to add custom display settings to your portlets from this isn't actually a new concept in liferay. e.g., web content, media gallery, and dynamic data lists , you can already add as many display options or templates as you want. them to your custom portlets, too.;;
|
adts providethe ability to add custom display settings to your portlets from this isn't actually a new concept in liferay. e.g., web content, documents and media, and dynamic data lists , you can already add as many display options or templates as you want. them to your custom portlets, too. the figure below shows what the display figure 1 by using a custom display template, your portlet's display can be customized in this tutorial, we'll demonstrate how to use the application display templates api to add an adt to a portlet. to leverage the adt api, there are several steps you need to follow. steps involve registering your portlet to use adts, defining permissions, and exposing the adt functionality to users. let's walk through these steps create and register a custom portletdisplaytemplatehandler class. provides the baseportletdisplaytemplatehandler as a base implementation for you to extend. interface javadoc to learn about each template handler method each of the methods in this class have a significant role in defining and detailed explanation for each method defined specifically for adts as an example portletdisplaytemplatehandler implementation, you can look now that you've created the template handler, declare it with the... tags in the element of since the ability to add adts is new to your portlet, you must configure permissions so that administrative users can grant permissions to the roles that will be allowed to create and manage display templates. action key addportletdisplaytemplate to your portlet's now that your portlet officially supports adts, you'll want to expose the tag in the jsp file you're using to for example, it may be helpful for you to insert an like the following one in your configuration jsp file in this jsp, the templatehandler object is initialized for the specifies the display template drop-down menu to be used in the portlet's you're almost finished, but you still have to extend your view code to render your portlet with the selected adt. here is where you decide exactly which part of your view will be rendered by the adt and what will be available in the template context first, initialize the java variables needed for the adt next, you can test if the adt is configured, grab the entities to be rendered, and render them using the adt here's some example code that demonstrates implementing this in this step, we initialized variables dealing with the display settings and then used conditional tags to choose between rendering the adt, or displaying the entities some other way. portletdisplayddmtemplateid exists, the entity list is initialized and the adt is rendered using the page context, template id, and entities. otherwise, the entities are displayed some other way that you implement for an example that demonstrates implementing this, see now that your portlet supports adts, you can create your own scripts to change you can experiment by adding your own custom adt and insert freemarker like the following code or velocity code into the template editor, and click save go back to your portlet and select options configuration and click the display template drop-down. select the adt you created, and click figure 2 the example quick list template displays entities in a bullet list format once your script is uploaded into the portal and saved, users with the specified roles can select the template when they're configuring the display settings of section in using liferay portal for more details on using adts next, we'll provide some recommendations for using adts in liferay portal you've harnessed a lot of power by learning to leverage the adt api. careful, for with great power, comes great responsibility! talk about some practices you can use to optimize your portlet's performance first let's talk about security. you may want to hide some classes or packages from the template context, to limit the operations that adts can perform on liferay provides some portal properties to define the restricted classes, packages, and variables. you can override the following portal in particular, you may want to add servicelocator to the list of default values assigned to the url and to the classes, packages, and variables restricted by default by descriptions of liferay portal's freemarker engine and velocity engine properties are available on application display templates introduce additional processing tasks when your to minimize negative effects on performance, make your templates as minimal as possible by focusing on the presentation, while using the existing api for complex operations. the best way to make application display templates efficient is to know your template context well, and understand what you can use from it. fortunately, you don't need to memorize the context information, thanks to liferay's advanced template editor! to navigate to the template editor for adts, go to admin configuration application display templates and click add and select the specific portlet on which you decide to create an adt the template editor provides fields, general variables, and util variables customized for the portlet you chose. these variable references can be found on the left-side panel of the template editor. you can use them by simply placing your cursor where you'd like the variable placed, and clicking the desired you can learn more about the template editor in the section of using liferay portal finally, don't forget to run performance tests and tune the template cache options by overriding the following portal properties in your the cool thing about adts is the power they provide to your liferay portlets, providing infinite ways of editing your portlet to provide new interfaces for we stepped through how to configure adts for a custom portlet like the location listing portlet, tried out a sample template, and ran through important recommendations for using adts, which included security and;;
|
liferay hooks are the best type of plugin for customizing liferay's core if possible, use hooks whenever you need to override liferay's core it's possible to use ext plugins for many of the same tasks, but hooks are hot-deployable and more forward compatible, so we urge you to use them in this section of tutorials, you'll learn how to create hooks, and you'll explore their most common uses.;;
|
hook plugins are a special type of liferay plugin that is designed for customizing liferay in some way. you can do anything from customizing a service, to modifying a core jsp, to changing properties, to adding language keys, and you can create hooks in a plugins sdk project or a liferay maven project, using liferay idedeveloper studio or the command line. creating hooks in a plugins sdk project from liferay ide and from the command to learn how to create liferay maven projects, see the tutorial creating liferay maven plugins from ide creating liferay maven plugins from the command line creating a hook using liferay ide is easiest to learn first. jump right in by creating your hook project with liferay ide follow these steps to create a hook in ide in no time fill in the project name and display name fields choose ant for the build type and select the appropriate plugins sdk and select hook as your plugin type figure 1 shows the new liferay plugin project wizard with filled in values for a figure 1 creating a hook plugin is easy with liferay ide. just click file new liferay plugin project, enter a project name and display name, select a build type, plugins sdk, and liferay runtime, select hook, and then click finish the plugins sdk automatically names the hook by appending -hook to the project with liferay ide, you can create a hook in a completely new plugin project or create a hook in an existing plugin project. liferay plugin project to create a new plugin project or file new liferay hook configuration to create a hook in an existing plugin from your command line terminal, navigate to your plugins sdk's hooks folder. to create a hook project, you must execute the create script. format to follow in executing the script on linux and mac os x, you'd enter a command similar to the one in this example on windows, you'd enter a command similar to the one in this example liferay ide's new project wizard and the create scripts generate hook projects in your plugin sdk's hooks folder. appends -hook to your project name whether you created your hook project from the liferay ide or from the command line, you end up with the same project structure. customize something in liferay. you begin by mirroring the structure of liferay's code that you plan to customize. a hook plugin is built to contain the particular files you'll work on depend on the liferay features you're note if the liferay server prints the following message to your console, the marketplace portlet and portal compatibility hook must not already be for liferay 6.2.0 ce ga1, you can fork and clone liferay's liferay-plugins project from github, checkout the respective branch andor tag, and deploy each you can install the plugins sdk in liferay ide and import each plugin here is information on each of the plugins note when you created portlets and themes, they were fully functional upon hooks aren't like that because they're liferay customizations. default customization is the original implementation! now that you know how to create a hook using liferay ide and ant, it's time to get out there and create your customizations! developing with the plugins sdk;;
|
"hooks are commonly used to override web resources, found in the portal-web you can use a hook to override jsp files, jspf files, javascript files, and images important a jspf change takes effect only when you modify a jsp that replacing a portal jsp is a simple task with hooks suppose you need to manually override one of liferay portal's jsps, like its you can accomplish this by following these steps use liferay ide to create a new hook project in your liferay plugins sdk open the url file from your project's docrootweb-inf by default, it opens in overview mode. gives you a graphical user interface for developing your hook. toggle between overview mode and source mode via their respective tabs of select the custom jsps folder from the outline to bring up the custom jsp select the check box customize liferay portal jsps and create the default custom jsp folder meta-infcustomjsps by clicking the icon that has the three yellow diamonds figure 1 liferay ide lets you specify a folder for the custom jsps you're developing. create the folder by clicking the icon that has the three yellow diamonds add to the listing of custom jsps by clicking the plus icon and specifying the liferay portal jsp file that you want to override. on the right-hand side in the custom jsp text field simplifies finding it lets you scroll through the accessible jsps and lets you specify key words to narrow your search figure 2 liferay ide simplifies adding a custom jsp to your hook by providing a powerful overview mode for editing your url file open the copy of the liferay portal jsp file from the for example, the custom jsp file copy of liferay portal's url would be made available in the hook project at modify the jsp file with your customization note many errors may show in the editor because the resources used in the jsp e.g., portalutil are not available in the project; but they'll be available from the portal once the hook plugin is deployed to the portal deploy your hook and wait until it is deployed successfully the original jsp stays in the cache until the cache is cleared or liferay to clear the cache, navigate to control panel server administration and click on the appropriate clear content... navigate to the custom jsp in liferay and verify your customization for example, in the case of customizing the terms of use page, you'd create a new user and log in to see your customization now there are two jsp files in liferay deployed on your application server. jsp has the original name and the other ends with url. is your hook's version of the file. the url file is a copy of portal's for example, if the original portal jsp file was url, the hook's version of the file uses that name and the original version of the file to revert back to the original, undeploy your hook. removed, and the url file is automatically renamed, taking its place. you can override any jsp in the liferay core, while retaining thew ability to be careful not to override the same jsp in multiple hooks you'll get whichever one happened to deploy last note we don't recommend changing liferay's terms of use with a hook. replace the terms of use with a piece of web content simply by specifying values for these two properties in url although this example hook doesn't provide any new functionality, it demonstrates how to override liferay's jsp files congratulations on overriding a liferay portal jsp! overriding language properties using a hook";;
|
let's say you want to add more content to one of liferay's jsps, but you also want to benefit from any changes made to it as you upgrade liferay. than overwriting the jsp, you can instead create a new jsp in a hook and include the original jsp in the new jsp in this tutorial, you'll learn how to extend an original liferay jsp using a in this demonstration, you'll customize a hook project to extend a liferay jsp, while leaving the original jsp untouched. create a hook project, using liferay ide or the plugins sdk, if you're not already using an existing hook project open your hook's url file from your project's docrootweb-inf folder and select the file's overview mode tab select the custom jsps folder from the outline to bring up the custom jsp select the checkbox customize liferay portal jsps and create the default custom jsp folder meta-infcustomjsps by clicking the icon that figure 1 liferay ide's hook configuration menu allows you to create a custom jsp add to the listing of custom jsps by clicking the plus icon and specifying hint the browse icon on the right-hand side within the custom jsp text field simplifies finding the jsp you want to click ok and save the url file. the liferay portal jsp into your project so you can modify it open the jsp file docrootmeta-infcustomjspsjspfile'spath that liferay ide pulled into your project and delete its content use the tag, from liferay's util taglib to include the original liferay jsp and assign the jsp's content to a buffer variable. assigning the content to a buffer variable enables you to manipulate the original liferay jsp content as a string for example, you can assign the content of the liferay jsp to a variable if you use the buffer assignment from the snippet above, make sure you replace jspfile'spath with the liferay jsp's path. ide, the jsp file's path is shown as the liferay portal jsp in the liferay hook configuration's custom jsps section in the important add.portal to the jsp file's name, before the.jsp for example, if the original jsp's name is url, specify when liferay deploys your hook, the original jsp is renamed to file name url, and your jsp takes its place. therefore, you want to reference the original, you have to reference its new add more content before andor after the original jsp's content via the for example, you can import liferay's class and use it to prepend or append content to the buffer variable, like after adding your desired content to the original content, evaluate the buffer variable as an expression. for example, to evaluate a buffer variable the original jsp stays in the cache until the cache is cleared or liferay to clear the cache, navigate to control panel server administration and click on the appropriate clear content... navigate to the custom jsp in liferay and verify your customization the edits you made in the customjspsjspfile'spath are now visible in in liferay portal, the hook you created extends the original jsp's content with the version of the content you created. how to extend an original liferay jsp using a hook!;;
|
a language properties hook lets you change liferay portal's messages and labels for example, you may want to change the title of a liferay core portlet, a message liferay displays on successfully completing a request, or some other bit of text in the ui. you can override all these strings using figure 1 you can override portlet titles, like the sign in portlet's default title sign in, with new titles from a language properties hook plugin customizing liferay's default textual content involves the following two steps this tutorial illustrates this process, and it shows you how to use a hook to override the title of liferay's sign in portlet. to customizing any of liferay's language properties first, you'll learn how to find the language key properties that specify it's time to get started and locate the default liferay's default language files are in the url folder of the liferay portal deployment on you can view liferay ce versions of these files on each file corresponds to a language locale that for example, url contains the english language keys, url contains the spanish language keys, url contains the french language keys, and so on all of liferay's default text values are specified as properties in these the title of liferay's sign in portlet, for example, is specified by language key url.58 in each of the files. you wondering why the key includes the number 58? per convention, the names of the language properties of liferay's core portlets end with a portlet id number after you've noted the names of all of the properties that you want to customize, you can create new language properties files to specify the text you'll create these properties files in a liferay hook the steps in this section show you how to use liferay ide to create a language property hook plugin for overriding liferay's default text values with your own if you don't yet have a hook project, create one following the steps in the in liferay ide, right click your hook project and select new in the window that appears, select the language properties check box and click next figure 2 in the liferay hook configuration wizard, you can select the language properties check box to create a language properties hook accept the default path docrootweb-infsrccontent for the content click on the add... button and add the names of any language properties files that contain text values that you want to customize. figure 3 the liferay hook configuration wizard lets you specify any language properties files to customize behind the scenes, the liferay hook configuration wizard adds a blank copy of each of the custom language properties files you specified. them in the hook project's docrootweb-infsrccontent folder note if you are creating the hook via the plugins sdk, you must first create a folder docrootweb-infsrccontent in your plugin. create your custom language properties files in that folder and reference each custom language file in your url file. in the generated properties files, specify each of the properties that you are customizing and assign your custom values to them for example, to customize the sign in portlet's title for english and spanish languages, you'd specify the url.58 property in each language file and assign it your custom value in that language. what you might specify in the following language files for the sign in deploy your hook and reload any page that uses the language key you've to see the customization for the particular language that you customized, you can add the language portlet to a page and click on a nation's flag that uses that language for example, to switch to see a spanish translation customization, add the language portlet and click on spain's flag. translation, click on the u.s. flag or great britain's flag figure 4 here's a spanish translation of the sign in portlet's title if you created the language properties hook using liferay ide, you're finished the liferay hook configuration wizard in liferay ide automatically takes care of inserting the proper references in the url file to your language files. if you need to add more language files, simply run the wizard again the liferay hook configuration wizard is the easiest way to create and configure if you didn't use liferay ide's liferay hook configuration wizard or you created your hook project using the the next section shows you how to create and configure custom language properties files manually in order to override any one of portal's language properties files, you must put the custom language properties file in your hook plugin's on deploying the hook plugin, the portal applies the properties of each of these language properties files each custom language property file must match the name of the file it's if you wanted to override portal's url file, for example, then you'd create an empty url file in the hook plugin's docrootweb-infsrccontent folder and add custom properties in order for liferay portal to use your new language properties files, you must specify them in the plugin's url file. language file in url is defined in a language-properties tag. for example, you could reference custom language files for english, spanish, and the default language properties file by specifying them in the note that each of the files must reside in the plugin's docrootweb-infsrccontent folder and the content folder must be included in the path for each language file you can create these references manually in raw xml, or by using overview mode in liferay ide's xml editor. overview mode provides an easy-to-use graphical interface for adding and editing xml without requiring you to enter just follow these steps in liferay ide to use overview mode to reference your open url and click the overview tab to access overview click language properties in the outline column on the left. language properties field appears to the right click the plus icon and type in the language file that you want to for example, to add a reference to url, you can repeat this step for as many language files as you want to reference important unless you're adding language properties files using the liferay hook configuration wizard, language properties files are not created for you in create each custom properties file figure 5 liferay ide's overview mode for editing url facilitates specifying custom language files if you want to view the xml references that liferay ide generated for you, click on the source tab of url editor tip you can check the dtd of any liferay now that you've customized the liferay language key values, you can enjoy seeing your new titles, labels, and message strings in your portal;;
|
jsp hooks are often scoped to the portal, but what if you need to customize specific sites without propagating the customizations throughout the entire application adapters are special hooks that let you make there's a sample application adapter in the are you ready to build an application adapter of our own? you'll create your own application adapter hook modify your hook's url to specify the location of your custom jsp and set the global custom jsp setting to false you'll need to create the docrootmeta-infcustomjsps folder in your you can do this by creating the folder manually or navigating to your url file's overview tab and selecting then in the menu that appears, check the customize liferay portal jsps and click the button with three yellow diamonds in your project's docrootmeta-infcustomjspshtmlportlet folder, create a folder with the same name as the portlet you're overriding. the new folder, create a jsp file with the same name as the jsp file you're in this new jsp, you'll implement application customizations it's recommended to include the original jsp if possible when overriding a you can include an original jsp by using a for example, if you wanted to include an original jsp named url from a portlet named yourportlet, you could add a directive to include the liferay-util taglib and specify a tag to include you can include content before or after the original content the following example code snippet includes an original jsp named url and adds custom content below it within the tag, you must specify the path of the original jsp you're extending and set the usecustompage attribute to note when extending an original jsp in a global hook, you must end the jsp file's name with the suffix url within the however, when using an application adapter hook, you specify the jsp normally and set the usecustompage attribute liferay installs the application adapter under the name of the hook in your web browser, navigate to the liferay site where you'll use the select admin configuration site settings of the site from the application adapter field's drop-down figure 1 your application adapters are easily accessible from the site settings section of the site administration interface navigate to your site's pages, add the portlet your hook is modifying to a page, and make sure that the modification you made from your application adapter hook plugin's jsp file is displayed there navigate to a different site and add the same portlet to verify that only the content of the portlet's original jsp file displays using application adapter hook plugins to override liferay's core functionality you can also apply application adapters to site templates suppose you want to make an enterprise resource planning erp solution for a your erp solution requires an extension of liferay's wiki portlet so you implement that extension as an application adapter. incorporate the application adapter in a site template named erp site for the company's administrative user creates the sites by going to control panel sites and adding sites based on the erp site the added sites include your application adapter automatically in this tutorial, you learned that application adapters are used to scope customizations to specific sites in your portal instance. for yourself and learned best practices along the way advanced content with structures and layout templates;;
|
liferay's audience targeting application allows you to monitor your portal's you can organize them into user segments, target specific content to those user segments, and create campaigns to expose user segments to a certain targeting content to your audience chapter for more information on audience targeting and how to use it although the audience targeting app can be configured to monitor your portal's audience out of the box, it is also designed as a framework to be extended by there are a set of extension points that can be easily hooked using other plugins that can be hot deployed into your liferay installation these extension points include in this section's tutorials, you'll learn how to create these extension points for your audience targeting application.;;
|
application available in liferay's marketplace can be used to target content to you might want to take this to the next step and use the for instance, you could list user segments in your own application or update a campaign when someone creates a calendar event. the content targeting api, you can unleash the power of audience targeting to the realms outside of liferay's default applications in this tutorial, you'll learn how to give your application access to the then you can view some examples of how to use the java and json apis that are available configuring your app to have access to the content targeting api requires only this line of code is a dependency that should be added to your follow the instructions below to add the content open the url file in your app's root folder find the tag and place the following dependency within the complete tag should look like this your app now has access to the content targeting api and can now take advantage of everything audience targeting has to offer. in the next section, you'll learn how to use the content targeting api by studying a few examples there are two ways you'll learn how to call the content targeting api making direct calls to the java api and making direct calls to the json api. dive into calling the java api first suppose you'd like to display a list of existing user segments in your portlet. you could do this by opening your portlet class the class that extends the mvcportlet class and adding the following method notice that the usersegments list is populated by calling to finish off this example, some logic needs to be added to your portlet's this logic uses the usersegment object to list the existing user segments in by importing the usersegment and usersegmentlocalserviceutil classes into your files, you have direct access to your portal's user segments via the content targeting java api lastly, you'll explore a small example of accessing the content targeting suppose you'd like to display a list of existing campaigns in your portlet using you could do this in your portlet by opening its url file notice that the content targeting api is called to retrieve the existing then, each campaign is listed in the campaignslist and displayed in your if you'd like to view all the available methods with examples exposed in the json api by audience targeting, you can visit your portal's apijsonws url as you can see, accessing the content targeting json api is just as easy as accessing the related java api you've learned how easy it is to expose the content targeting api and use it in a custom app to unleash its power! if you'd like to peruse the entire content if you're interested in seeing the examples that were discussed in this tutorial working in a finished portlet, download and deploy the creating new audience rule types targeting content to your audience running service builder and understanding the generated code;;
|
"the portal directory hook required for the portlet-to-gadget tutorial is have you ever wanted your gadgets to communicate with each other or with pubsub is implemented in liferay to facilitate interaction between gadgets and interaction between gadgets and pubsub is a diverse messaging system that allows messages to be sent with the use of pubsub, the worlds of gadgets and portlets blend together, facilitating their ability to communicate and interact with each other we'll run through a tutorial for gadget to gadget communication, and then show an example for using gadget to portlet communication; both will integrate google after we've run through the exercises, we'll briefly analyze specific code fragments that made the pubsub messaging possible. for gadget to gadget communication, two independent gadgets are placed on a page and configured with pubsub; these two gadgets are able to communicate with one another and provide tools that the user could not otherwise produce. example, we'll demonstrate two google maps gadgets that publish and subscribe to using pubsub, these gadgets work together to display an the first gadget represents a publisher that enables the user to input a specific address and publish the address. the second gadget represents the subscriber who receives the address, displays the address, and locates the figure 1 gadgets like google's address and map gadgets are automatically synced to communicate with each other once the update button is selected in the google address gadget, the address is published to a specific channel. since the google map gadget is subscribed to that same channel, it receives the address and then displays it in the map figure 2 after inputting a custom address in the google address gadget, you are able to see its physical location in the google map gadget the gadgets are communicating well with each other. this simple tutorial demonstrated two gadgets communicating with each other using the publish-subscribe framework has been deprecated for google gadgets however, pubsub is still the primary communication for gadgets and will be supported with gadgets on liferay we will now dive into the source code and analyze how this interaction is to view the full contents of the google map, visit the the following excerpt from the google map xml file enables the gadget to use pubsub and specifies the channel topic to which the gadget publishes notice the opening, mandating the pubsub-2 topic url that the gadget publishes to. the topics parameter, you define all the topics your gadget uses for furthermore, the publishtrue attribute specifies the gadget's role as a publisher to the topic in the javascript of the gadget's content, the gadget publishes to the topic when the user clicks the gadget's update button, the message is sent by the publishing gadget to the topic named url; pubsub broadcasts the message received on that topic to all subscribers, such as your each subscriber receives and processes the message. the case of your google map gadget, the message containing an address is processed by the gadget to show the address location on its map next, we'll analyze the tutorial's subscribing gadget's source code specified the subscriber source code is similar to that of the publisher it mandates the pubsub-2 feature for the gadget and specifies url as one of its topics, as you would expect; of course, the only difference is the fact that this gadget subscribes to the topic, hence the attribute setting subscribetrue the following javascript from the gadget's content registers a callback on the the url function is called by the opensocial container, once the gadget connects to the pubsub messaging hub. the gadget subscribes to the previously mentioned topic; all subscribers to this topic receive messages sent to it when a message is received, the gadget's callback function is executed. this example the callback method sends the received message the address sent by the publisher, calls url to get the locations, and finally processes and displays the locations on the map in summary, subscriber gadgets need to specify a topic and register a callback function on that topic to handle the messages they receive as you can see, pubsub allows your site to run efficiently and enables otherwise unconnected gadgets to communicate and flourish within liferay portal gadgets are not limited to only communicating with other gadgets. section, we will demonstrate the capabilities of communication between portlets for this tutorial, we'll continue exploring the google map gadget inside of if you have portlet applications that can take advantage of the functionality your maps gadgets have to offer, it would certainly be convenient for a user to allow communications between those gadgets and your portlets framework has been deprecated for google gadgets however, pubsub is still a primary communication mechanism between portlets and gadgets and will be supported on liferay as a demonstration, we'll show a customized portal directory portlet that communicates to the google map gadget using pubsub. portal directory portlet that has a specified address, a show in google maps link is displayed beneath the user's address. location of the user's address is displayed in the google map gadget figure 3 the modified portal directory portlet sends the user's address to the google map gadget to display the portal directory portlet's url file was edited to assign the portlet as a pubsub publisher, but what edits to the jsp file made this liferay core portlet, it's not recommended to edit its code directly. as you know from explanations given earlier, the google map gadget is therefore, the portal directory portlet needed to take on the publisher role to enable communication. directory portlet to publish to the topic on which the google map gadget is subscribed, we inserted the following javascript into the url file this code involves a publishaddress function that's called whenever you click on the show in google maps link. url function, passing in the name of the channel receiving the message and the user's address as the message. one thing to note is that when a portlet sends data to a gadget, there must be a gadget prefix before the channel declaration; this distinguishes who the messages are intended for when they are broadcast across a channel notice that you don't need to change anything for your google map gadget, since it's already subscribed to that channel; you only needed to define the portal directory portlet as a publisher to that channel note if you would like to broadcast messages to portlets, follow the same guidelines, but don't use the gadget prefix in your topic parameter value for the call to the url lastly, a button is needed to initiate the publishing of the address to the topic in the portal directory portlet; to do this, we inserted the following letting your portlets communicate with gadgets enhances your portlet applications and gives you a plethora of different ways you can enhance your customizing liferay portal with hooks";;
|
"as part of liferay's opensocial integration, the opensocial gadget editor is the gadget editor is a complete development environment for gadgets, providing syntax highlighting, preview functionality, undoredo options, and built in tabs for working on multiple gadgets at the same you can also organize and manage gadgets easily using the editor's file all of this gives you the convenience of creating and improving your gadgets right from within liferay portal within the editor, each gadget's xml file has a drop-down menu allowing you to close, rename, delete, publish, or unpublish the gadget, or to simply show the the publish button directs you to a screen, similar to the opensocial gadget publisher, allowing you to publish your gadget. published through the editor are stored in the site's document and media the show url button gives you the url so that the gadget may be these options offer a user-friendly and easy to use testing station for enhancing the gadgets on your sites figure 1 the drop-down menu can be easily found to the right of your xml file note when you publish a new gadget, remember that your liferay portal installation is the new host when specifying the gadget's url as a brief tutorial, we'll demonstrate creating a new gadget and publishing the gadget to liferay using the gadget editor. navigate to site administration content and select opensocial in the editor, create a gadget from scratch or copy in a gadget's xml and click the floppy disk button to save your new gadget xml. your gadget's desired name, click the check mark. make sure to attach the.xml suffix to the end of your gadget's name; otherwise, the gadget will figure 2 it is easy to insert gadget content into liferay's opensocial gadget editor and save it as an opensocial gadget select the preview tab from the toolbar and a preview of your gadget figure 3 the preview tab displays what your gadget would look like if it was added to a liferay page publish your gadget for portal-wide use by selecting the drop-down menu next to the gadget's name and clicking publish. up, showing your gadget's url and categories to select for your gadget figure 4 a publish gadget window displays your gadget's url and a host of categories for you to consider for your gadget choose a category and click save your new gadget is now available for portal-wide use! the opensocial gadget editor allows you to create and improve gadgets within the comfort of your own liferay portal instance. interactions on your sites and increase your portal content's popularity across your social network by leveraging the power of opensocial gadgets and the gadget using the device recognition api customizing liferay portal with hooks";;
|
do you want to transform the look and feel of your liferay portal? themes are hot deployable plugins unique to a site. themes, you can create whatever user interface you want for your site. section of tutorials, you'll learn how to develop themes layout templates define how portlets are arranged on a page. css-based containers where portlets live in the body of the page. comes with several built-in layout templates, but if you require a more complex page layout, you'll want to create your own custom layout templates. learn how to develop layout templates in these tutorials too.;;
|
"you can create themes in a plugins sdk project or a liferay maven project. can create either type of project from liferay idedeveloper studio or from the this tutorial focuses on creating themes in a plugins sdk project, from liferay ide and from the command line to learn how to create liferay maven projects, see the tutorial creating liferay maven plugins from ide creating liferay maven plugins from the command line creating the theme using liferay ide is easiest to learn first follow these steps to create a theme project in the ide go to file new liferay project fill in the project name and display name fields select the liferay plugins sdk and portal runtime you've configured select theme for your plugin type your theme inherits the parent theme's styling as a base from which to build your theme. in addition to the styled theme, you can choose to inherit from the unstyled theme, which contains no styling. there's also the classic theme that has a smooth look and feel and works you can select the freemarker or velocity template frameworks for your theme. or you can select jsp as your theme's figure 1 make sure to select the theme plugin type for your liferay plugin project you've just created a theme project in which to implement your new look and creating a theme from the command line using ant is simple too from your terminal window, navigate to your plugins sdk's themes folder. create a theme project, you must execute the create script. to follow in executing the script on linux and mac os x, you'd enter a command similar to the one in this example on windows, you'd enter a command similar to the one in this example whether you created your theme project from the liferay ide or from the command line, you end up with the same project structure. slate on which you you can exercise your creative talents. automatically appends -theme to your project name. custom themes are created by layering your customizations on top of one in tutorials that follow, you'll learn how to populate your theme with your very own stylish look and feel. now, examine your theme project the structure of a theme separates different types of resources into folders. here's the full structure of a theme project the diffs folder that's created inside the docroot folder of your theme is important; this is where you place your theme's code. must mirror the parent theme's directory structure. the parts of your theme that differ from the parent theme, place only the folders and files you'll customize there the other folders inside docroot are copied over from the parent theme in use these files as the basis for your modifications. customize the navigation markup, copy the navigation.vmftl file from docroottemplatesnavigation.vmftl into the docrootdiffstemplates folder you may have to create this folder first. from the diffs folder and customize it to your liking for custom styles, create a folder named css inside your diffs folder and place a single file there called url. this is where you'll define all because url is loaded last, styles defined here override any styles in the parent theme it's a best practice to add your styles only to the url file. keeps all of your changes in one place and makes future upgrades easier, because you won't have to manually modify your templates to add support for new liferay whenever you modify your theme, wait a few seconds until the theme deploys, then refresh your browser to see now you know how to create a theme project and are familiar with its creating liferay maven plugins from liferay ide";;
|
do you want to develop liferay resources without having to redeploy to see your are removed, so any changes you make are visible right away. have to reboot the server as often in developer mode how does developer mode let you see your changes more quickly? mode, there are several changes to the normal order of operations. list of developer mode's key behavior changes and the override settings that trigger them individual file loading of your styling and behaviors, combined with disabled caching for layout and freemarker templates, lets you see your changes more as you're developing your theme plugin, you can use developer mode regardless of whether you're developing it in liferay ide. first, you can explore how it's for liferay portal servers of version 6.2 or greater, the liferay settings section of the server runtime environment creation wizard lets you select either standard or development url for the runtime's the standard server mode is selected by default. development mode, select development url and save the the next time you start any liferay server that is based on this runtime environment, it starts in development mode to enable development mode for existing servers, access the liferay settings section of your runtime environment by double-clicking on the server in figure 1 you can set developer mode in the liferay settings section of your runtime environment in liferay ide warning only change the server mode from the runtime environment's liferay on server startup, if standard mode is set in liferay ide, the url file is not included for overriding portal for liferay portal servers below version 6.2 e.g., liferay v6.1 ce server, liferay v6.0 ce server, liferay ide enables developer mode by default. starting your liferay server for the first time, ide creates a url file in your liferay portal directory. next you can take a look at how you can set developer mode outside of ide if you're not using liferay ide, you must add the url file to your application server's configuration file in order to enable since each application server has a different configuration file or ui to specify system properties, you must follow your application server's specific method for adding the url file's properties for example, to deploy liferay in developer mode on a tomcat application server, options for your catalinaopts variable, in your url file tip if you're already using the system property external-properties to load other properties files, add url to the list and use a comma to separate it from other entries you've set up your liferay server for developer mode. modify your theme's url file directly in your liferay bundle, you can see your changes applied immediately on redeploying your theme! copy any changes you make back into your diffs folder, or they'll be overwritten when you redeploy your theme developing applications with liferay developer studio;;
|
have you associated a thumbnail image with your theme? settings of your site pages in the site administration screen, notice that each available theme has a thumbnail image. it's time to dress up your theme with stylistic appeal by creating a thumbnail image for it here are the steps for setting up a thumbnail image for your theme make sure it's 150 pixels wide by 120 pixels high. you may want to take a snapshot of your theme and re-size it to these it is very important to abide by these exact dimensions or your image won't display properly as a thumbnail save the image as a.png file named url and place it in your theme's docrootdiffsimages folder create this folder if it on redeployment, your url file automatically displays as your theme's thumbnail now, when you visit your the look and feel settings, your theme's thumbnail displays along with the thumbnail images of other themes available to your site now you know how to create a thumbnail image for your theme! developing liferay theme plugins with maven;;
|
you can define settings to make your theme configurable for site administrators. you can add a simple text field input setting, which is the default setting type, or add other types of settings, such as text areas, checkboxes, etc. and you can even introduce logic in your settings to leverage different theme templates based on the settings selected by the user. learn how to do all these things first, it's best to learn how to add configurable settings to a theme settings must be defined in the theme plugin's url file found in the process is easier than you may think. follow the steps below to get started if your project doesn't have this file, create it in the docrootweb-inf folder and add the following xml content replace the element's id and name attribute values with the id add tags between the theme's tags add a element between the tags for as many settings as you want for the theme. for example, if you want to add a simple input field setting, you can add a setting like this one if you stopped at this point, this setting would not be configurable for you'd have to manually change the setting in the theme plugin's url file and redeploy the plugin note, that you can access your settings in your theme's templates by calling url your-key method, where you'd specify your setting's to make a setting configurable from the portal, you must add the attribute configurabletrue to the element your assembled url content might look similar to the code below, with your own and element attribute values in place of the ones specified below to define additional settings, add more elements inside the what other types of settings you can add to a theme, see the dtd file referenced at the beginning of this file's contents. definition files are available to view at any configurable settings you've defined are visible and ready for the site in the look and feel section of the site administration site pages panel, the configurable settings are visible once the site administrator selects the theme and clicks save figure 1 here are examples of configurable settings for the site admin to enter a slogan and display the theme's footer. themes and their settings are available in the look and feel of a site's page settings hook to properly display configurable theme settings, like the slogan text area and footer checkbox from the previous example. section in the hooks chapter of the devguide now that you know how to add settings, you can move on to learning how to add logic to enable different templates for a theme 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. you can follow the steps below to facilitate selecting different templates for make sure you have a docrootdiffstemplates folder created create a template for each of page style choices you want to make available for example, if you want to provide a theme template option for a detailed header for the theme and a brief header option for the same theme, you can create separate template files for them and put them in the copy the docroottemplatesportalnormal.vmftl file into that and add logic to use a particular template based on a theme setting for example, if you have a velocity template called url that implements the theme using a detailed header and another template called url that implements the theme using a brief header, you could implement conditional logic that chooses between the templates based on the value of a theme setting. the example velocity code below uses the value of a setting named header-type to select a theme template to apply in your url file, you could add a element for each variation of your theme, based on the templates you implemented. sure to use a element with the same key, but different value in here are example elements that both use a with key heading-type assigned to different values following this strategy allows the plugin to leverage the same portalnormal.vmftl template, but apply templates based on the theme that now you know how to create configurable settings for your theme and use multiple page templates from the same portalnormal.vmftl template leveraging portal predefined settings in your theme;;
|
lets you use screenlets to develop native mobile apps on each platform. screenlets are complete visual components that you insert in your app to leverage liferay portal's content and services. to develop hybrid mobile apps for android and ios the tutorials in this section show you how to develop hybrid mobile apps using you'll start by preparing your xamarin project for you'll then learn how to use screenlets in xamarin, customize their note these tutorials assume that you know how to use xamarin.;;
|
to use liferay screens with xamarin, you must install screens in your xamarin you must then configure your project to communicate with your liferay note that liferay screens for xamarin is released as a note after installation, you must configure liferay screens to communicate with your liferay portal instance. the last section in this tutorial shows you liferay screens for xamarin includes the bindings necessary to use all screenlets included with screens. the following software is required also note that if you get confused or stuck while using screens for xamarin, the official liferay screens repository contains two sample xamarin projects that you can reference an example app for xamarin.android containing all the currently available screenlets an example app for xamarin.ios containing all the currently available screenlets each screenlet in liferay screens calls one or more of liferay portal's json web services, which are enabled by default. the screenlet reference documentation lists the web services that each screenlet calls. services must be enabled in the portal. it's possible, however, to disable the web services needed by screenlets you're not using. portal configuration of json web services follow these steps to install liferay screens in your xamarin project open your project in visual studio right click your project's packages folder and then select look for liferayscreens and install the latest version accept the license agreements for any dependencies. check your configuration one of these ways next, you'll set up communication with liferay portal before using liferay screens, you must configure your project to communicate to do this, you must provide your project with the fortunately, this is straightforward. do the following in your xamarin projects for xamarin.android, create a new file called url in the add the following code to this file for xamarin.ios, create a new file called url in make sure to change these values to match those of your portal instance. server address is suitable for testing with android studio's emulator, because it corresponds to localhost8080 through the if you're using the genymotion emulator, you should, however, use 192.168.56.1 instead of localhost the liferaycompanyid and companyid values are your portal instance's you can find this in your portal instance at control panel the liferaygroupid and groupid values are the id of the site your app to find this value, first go to the site in your portal instance that you want your app to communicate with. id is listed at the top of the general tab the liferayportalversion and version value 70 tells screens that it's communicating with a liferay portal ce 7.0 or liferay dxp 7.0 instance. supported values are 62 for liferay portal 6.2, and 70 for liferay portal note that if you omit liferayportalversion or version from these files, they default to 62 you can also configure screenlet properties in url and listed below, liferayrecordsetid and liferayrecordsetfields, enable ddl form screenlet and ddl list screenlet to interact with a portal instance's ddls for additional examples of these files, see the your xamarin projects are ready for liferay screens using screenlets in xamarin apps creating xamarin views and themes liferay screens for xamarin troubleshooting and faqs;;
|
you can start using screenlets once you've your xamarin project to use liferay screens. documentation describes the available screenlets using screenlets is very straightforward. this tutorial shows you how to insert and configure screenlets in your xamarin app. you'll be a screenlet master in no follow these steps to insert screenlets in your xamarin.ios app insert a view uiview in your storyboard in visual studio's ios designer note that if you're editing an xib file, you must insert the view inside the xib's parent view set the view's class to the class of the screenlet you want to use. example, login screenlet's class is loginscreenlet. xamarin designer for ios in visual studio, you must also give the view a name so you can refer to it in your view controller's code for example, the following video shows the first two steps for inserting login screenlet in a xamarin designer for ios storyboard configure the screenlet's behavior in your app by implementing the screenlet's delegate in your view controller. listen for events the screenlet triggers, implement the screenlet's delegate methods and register the view controller as the delegate. annotate each delegate method with export.... can be called from objective-c, which is required for it to work in screens. you should also set any screenlet attributes you need. lists its available attributes and delegate methods note in liferay screens for xamarin, screenlet delegates are prefixed with an i. for example, login screenlet's delegate in native code is loginscreenletdelegate, while in xamarin it's iloginscreenletdelegate for example, here's a view controller that implements login screenlet's note that the viewdidload method sets the screenlet's themename attribute themename is available for all screenlets via basescreenlet inheritance and registers the view this view controller also implements the onloginresponseuserattributes method, which is called upon successful also note this method's export... annotation for more examples of view controllers that use liferay's screenlets follow these steps to insert screenlets in your xamarin.android app open your app's layout axml file and insert the screenlet's xml in your for example, here's login screenlet's xml in an set the screenlet's attributes. if it's a liferay screenlet, refer to the to learn the screenlet's required and supported attributes. shows login screenlet's attributes being set figure 1 you can set a screenlet's attributes via the app's layout axml file to configure your app to listen for events the screenlet triggers, implement the screenlet's listener interface in your activity or fragment class. to learn its listener interface. then register that activity or fragment as note in liferay screens for xamarin, screenlet listeners are prefixed with an i. for example, login screenlet's listener in native code is loginlistener, while in xamarin it's iloginlistener for example, the following activity class implements login screenlet's iloginlistener interface, and registers itself as the screenlet's listener via loginscreenlet.listener this. methods onloginsuccess and onloginfailure are called when login succeeds in this case, these methods print simple toast for more examples of activities that use liferay's screenlets preparing xamarin projects for liferay screens creating xamarin views and themes liferay screens for xamarin troubleshooting and faqs;;
|
you can use a liferay screens view to set a screenlet's look and feel independent of the screenlet's core functionality. with several views, and more are being developed by liferay and the community. the screenlet reference documentation lists the views available for each screenlet included with screens. tutorial shows you how to use views in xamarin.android the concepts and components that comprise views and view sets in liferay screens for xamarin are the same as they are in liferay screens for android. description of these components, see the section on views and view sets in the general tutorial on using views. for a detailed description of the view layer in liferay screens, see the tutorial architecture of liferay screens for android follow these steps to use a view in xamarin.android copy the layout of the view you want to use from the alternatively, you can create a new layout. the following links list the view layouts available in each view set for example, this is login screenlet's material view, url when you insert the screenlet's xml in the layout of the activity or fragment you want the screenlet to appear in, set the liferaylayoutid attribute to the view's layout. for example, here's login screenlet's xml with liferaylayoutid set to loginmaterial, which specifies login screenlet's material view from the previous step if the view you want to use is part of a view set e.g., the material view is part of the material view set, your app or activity's theme must also inherit the theme that defines that view set's styles. following code in an app's url tells apptheme.noactionbar to use the material view set as its parent theme to use the default or westeros view set, inherit defaulttheme or now you know how to use views to spruce up your xamarin.android preparing xamarin projects for liferay screens using screenlets in xamarin apps creating xamarin views and themes liferay screens for xamarin troubleshooting and faqs;;
|
themes in xamarin.ios are analogous to views in xamarin.android. themes let you set a screenlet's look and feel independent of the screenlet's liferay's screenlets come with several themes, and more are being developed by liferay and the community. the screenlet reference documentation lists the themes available for each screenlet included with screens. tutorial shows you how to use themes in xamarin.ios follow these steps to install and use a theme if the theme is packaged as a nuget dependency, you can install it in your to do so, right-click your project's packages folder and then select add packages.... then search for the theme and install it. if the theme isn't available in nuget, you can drag and drop the theme's folder directly into your project to use the installed theme, set its name to the screenlet instance's themename property in your view controller that implements the screenlet's all screenlets inherit this property from for example, this code sets login screenlet's themename property to the material theme if you don't set this property or enter an invalid or missing theme, the screenlet uses its default theme. each screenlet's available themes are listed in the themes section of the screenlet's now you know how to use themes to dress up screenlets in your preparing xamarin projects for liferay screens using screenlets in xamarin apps creating xamarin views and themes liferay screens for xamarin troubleshooting and faqs;;
|
recall that views in xamarin.android and themes in xamarin.ios are analogous components that let you customize a screenlet's look and feel. views and themes provided by liferay screens, or write your own. own lets you tailor a screenlet's ui to your exact specifications. you can create views and themes from scratch, or use an existing one as a views and themes include a view class for implementing the screenlet ui's behavior, a screenlet class for notifying listenersdelegates and invoking interactors, and an axml or xib file for defining the ui there are also different types of views and themes. you should read those tutorials before creating views in first, you'll determine where to create your view or theme if you plan to reuse or redistribute your view or theme, create it in a new multiplatform library for code sharing. otherwise, create it in your app's project creating views for xamarin.android is very similar to doing so in native code. you can create the following view types themed view creating a themed view in xamarin.android is identical in xamarin.android, however, only the default view set is available to child view creating a child view in xamarin.android is identical extended view creating an extended view in xamarin.android differs from to create an extended view in xamarin.android, follow the steps for creating an extended view in native code, but make sure your custom view class in the second step is the appropriate c for example, here's the view class from the native code tutorial, now you know how to create extended views in xamarin.android creating themes for xamarin.ios is very similar you can create the following theme types in xamarin.ios first, you'll learn how to create a child theme in xamarin.ios child themes leverage a parent theme's behavior and ui components, letting you modify the appearance and position of those components. or remove components, and the parent theme must be a full theme. presents visual changes with its own xib file and inherits the parent's view follow these steps to create a child theme in xamarin.ios in visual studio, create a new xib file named after the screenlet's view by convention, an xib file for a screenlet with a view class named loginview and a theme named demo should be named you can use content from the parent theme's xib file as a in your new xib, you can change the ui components' visual properties e.g., their position and size. change, however, the xib file's custom class, outlet connection, or these must match those of the parent xib file in the view controller, set the screenlet's themename property to the for example, this sets login screenlet's themename property to the demo theme from the first step this causes liferay screens to look for the file loginviewdemo in all if that file doesn't exist, screens uses the default theme you can see an example of loginviewdemo in next, you'll learn how to create an extended theme an extended theme inherits another theme's ui components and behavior, but lets for example, you can extend the parent theme's view class to change the parent theme's behavior. you can also create a new xib file that contains new or modified ui components. an extended theme's parent must be follow these steps to create an extended theme by convention, an xib file for a screenlet with a view class named loginview and a theme named demo should be named you can use the parent theme's xib file as a template. make your theme's ui changes by editing your xib file in visual studio's ios designer or xcode's interface builder create a new view class that extends the parent theme's view class. should name this class after the xib file you just created. or override functionality of the parent theme's view class. example that extends the view class of login screenlet's default theme note that it changes the login button's background color and disables the progress presenter set your new view class as the custom class for your theme's xib file figure 1 set new view class in xib theme file now you know how to create an extended theme creating ios themes native code preparing xamarin projects for liferay screens using screenlets in xamarin apps liferay screens for xamarin troubleshooting and faqs;;
|
the liferay mobile sdk provides a way to streamline consuming liferay core web services, liferay utilities, and custom portlet web services. json web services, making them easy to call in native mobile apps. of authentication, makes http requests synchronously or asynchronously, parses json results, and handles server-side exceptions so you can concentrate on the liferay mobile sdk is compatible with liferay portal 6.2 and later. with the liferay android sdk and is ready for you to download and use. gives you access to the sdk releases, provides the latest sdk news, and has forums for you to engage in mobile app development discussions. configure the mobile sdk in your app, you can invoke liferay services in it. liferay android sdk bridges your native app with liferay services figure 1 liferay's mobile sdk enables your native app to communicate with liferay the android app development tutorials include the following topics a great way to start is by setting up the mobile sdk your android project. makes liferay and custom portlet services available in your app invoking liferay services in your android app creating ios apps that use liferay;;
|
you must install the correct mobile sdks in your android project to call the remote services you need in your app. you should first install liferay's this is required for any app that leverages liferay. call your custom portlet's services, you also need to install the mobile sdk for instructions on building a mobile sdk for your custom this tutorial shows you how to install liferay's prebuilt mobile sdk, and any first, you'll learn how to use gradle or maven to install liferay's prebuilt mobile sdk. you'll then learn how to install a mobile sdk manually, which is required for installing any custom built mobile sdks. now go forth and fear no remote service! if your android project is using gradle as the build system, you can add liferay's prebuilt mobile sdk as a dependency to your project. available at the jcenter and maven central repositories. listed here, but you only need to have one in your app if you get errors such as duplicate files copied in apk meta-infnotice when building with gradle, add this to your url file when your project syncs with your gradle files, liferay's prebuilt mobile sdk downloads to your project. doing this with maven are shown next you can also add the liferay's prebuilt mobile sdk as a dependency to your to do so, add the following code to your url file however, what if you're not using gradle or maven? install a custom built mobile sdk? the next section shows you how to use the following steps to manually set up a mobile sdk in your android project to install liferay's prebuilt mobile sdk, first the latest version of liferay-android-sdk-version.jar. own mobile sdk, find its jar file on your machine. copy the jar into your android project's libs folder if you're manually installing liferay's prebuilt mobile sdk, you also need to download and copy these dependencies to your android project's libs now you know how to manually install a mobile sdk in your android apps if you want to invoke remote web services for your custom portlet, then you need to generate its client libraries by building an android mobile sdk yourself. building an sdk is covered in the tutorial once you build an sdk to a jar file, you can install it using the manual installation steps above make sure to use the jar file you built instead of note that because your custom built sdks contain only the client libraries for calling your custom portlet services, you must install them alongside liferay's prebuilt sdk. liferay's prebuilt sdk contains additional classes that are required to construct any remote service call now that the remote services you need are available in your app, you're invoking liferay services in your android app creating ios apps that use liferay;;
|
"once the appropriate mobile sdks are set up in your android project, you can access and invoke liferay portal's services in your app. through the steps you must follow to invoke these services since some service calls require special treatment, this tutorial also shows you but first, you'll learn about securing liferay portal's json the liferay mobile sdk calls liferay portal's json web services, which are the web services you call via the mobile sdk must remain enabled for those calls to work. it's possible, however, to disable the web services that you don't need to call. for instructions on this, see the tutorial portal configuration of json web services a session is a conversion state between the client and server, that consists of multiple requests and responses between the two. requests between your app and the mobile sdk. in most cases, sessions need to be created with user authentication. the imports and code required to create a the arguments to sessionimpl are used to create the session. parameter is the url of the liferay instance you're connecting to. running your app on android studio's emulator, is equivalent to be sure to replace this with the correct warning be careful when using administrator credentials on a production liferay instance, as you'll have permission to call any service. of course, the default administrator credentials should be disabled on a production liferay instance the second parameter creates a new basicauthentication object containing the depending on the authentication method used by your liferay instance, you need to provide the user's email address, screen name, or user id. you also need to provide the user's password. tells the session to use basic authentication to authenticate each service call. the mobile sdk also supports oauth authentication, as long as the oauth provider portlet is deployed to your liferay instance. authentication with the mobile sdk, see the if you're building a sign in view for your app, you can use the signin utility class to check if the credentials given by the user are valid note that the mobile sdk doesn't keep a persistent connection or session with each request is sent with the user's credentials except when using however, the signin class provides a way to return user information next, you're shown how to create an unauthenticated session in the limited cases in some cases, it's possible to create a session instance without user however, most liferay remote methods don't accept unauthenticated making a call with an unauthenticated session generates an authentication access required exception in most cases unauthenticated service calls only work if the remote method in the portal or your plugin has the annotation. hypothetical class fooserviceimpl and its method bar to make such a call, you need to use the constructor that accepts the server now that you have a session, you can use it to call liferay's first, you should determine the liferay services you need to call. the available portal and plugin services at be sure to replace in this url with your server's add the imports for the services you need to call. building a blogs app, you can import blogsentryservice note that the liferay version .v62 is used in the package namespace. the mobile sdk is built for a specific liferay version, service classes for different liferay versions are separated by their package names. example, the mobile sdk classes use the.v62 package, which means this mobile sdk is compatible with liferay 6.2. this namespacing lets your app support once you have a session and the required imports, you're ready to make the this is done by creating a service object for the service you want to call, and then calling its service methods. for example, if you're creating a blogs app, you need to use blogsentryservice to get all the blogs entries from this is demonstrated by the following code this fetches all blog entries from the guest site. note that many service methods require you can get the user's groups by calling the getusersites method from groupservice service method return types can be void, string, jsonarray, or primitive type wrappers can be boolean, integer, this blogsentryservice call is a basic example of a synchronous service call; the method only returns after the request finishes. allow network communication from an app's main ui thread. from the main ui thread need need to be asynchronous. invoking services asynchronously from your android app now you're familiar with the basics of accessing liferay services through however, there are some special cases you may run into when making service calls from your app. these are discussed in the following there are some special cases in which a service method's arguments aren't in these cases, you should use jsonobjectwrapper. you must pass a json containing the object properties and their values. server side, your object is instantiated and setters for each property are called with the values from the json you passed there are other cases in which service methods require interfaces or abstract since it's impossible for the sdk to guess which implementation you want to use, you must initialize jsonobjectwrapper with the server looks for the class name in its classpath and instantiates the object it then calls setters, as in the previous example. orderbycomparator is a good example of this. on the server side, orderbycomparator is an abstract class. pass the name of a class that implements it. if the service you're calling accepts null for a comparator argument, pass you may want to set the ascending property for a comparator. of liferay 6.2, most liferay orderbycomparator implementations don't have a setter for this property and it isn't possible to set from the mobile sdk. future portal versions will address this. orderbycomparator that has a setter for ascending. for more examples, see the test case another non-primitive argument is servicecontext. attention because most liferay service methods require it. required to pass it to the sdk; you can pass null instead. creates a servicecontext instance for you, using default values if you need to set properties for servicecontext, you can do so by adding them to a new jsonobject and then passing it as the servicecontext argument some liferay services require argument types such as byte arrays byte and the mobile sdk converts byte arrays to strings before sending the post request. for example, hello.getbytesutf-8 becomes a json array such as the mobile sdk does this for you so you don't have worry about it; you only need to pass the byte array to the method however, you need to be careful when using such methods. allocating memory for the whole byte array, which may cause memory issues if the other portal service methods require url.file as an argument. cases, the mobile sdk requires inputstreambody instead. you need to create an inputstream and pass it to the inputstreambody constructor, along with the file's mime type and name. the mobile sdk sends a multipart form request to the portal. a file instance is created and sent to the service method you're calling it's also possible to cancel or monitor service calls that upload data to every service that uploads data returns an asynctask instance. can use it to cancel the upload if needed. if want to listen for upload progress to create a progress bar, you can create an uploadprogressasynctaskcallback callback and set it to the current session object. called for each byte chunk sent. it passes the total number of uploaded bytes so for more examples on this subject, see the aadfileentry methods in as you can see, the mobile sdk does a great deal of work for you even when special service method arguments are required creating ios apps that use liferay";;
|
android doesn't allow synchronous http requests to be made from the main ui to make synchronous requests from threads other than the main ui thread. don't want to use asynctask, you can make asynchronous requests through the to do so, you need to implement and instantiate a callback class, and then set it to the session. when the mobile sdk makes your service calls for that session, it then makes them asynchronously. again, set null as the session's callback with the following steps, this tutorial shows you how to implement asynchronous before implementing and instantiating your callback class, you should add the the imports you add depend on the return type of the service for example, if you need to call the service method getgroupentries to retrieve blog entries from a site's blogs portlet, you need to import the mobile sdk's asynctaskcallback and jsonarrayasynctaskcallback this is because the getgroupentries returns a jsonarray. asynctaskcallback implementations, one for each method return type it's also possible to use a generic asynctaskcallback implementation called to do so, you must implement a transform method and if you still don't want to use any of these callbacks, you can implement however, you should be careful when doing so. should always get the first element of the jsonarray passed as a parameter to the onpostexecutejsonarray jsonarray method for example, next, implement and instantiate your callback class. callback class, you need to implement its onfailure and onsuccess methods. these methods respectivley determine what your app does when the request fails the onfailure method is called if an exception occurs during this could be triggered by a connection exception e.g., a request if a serverexception occurs, it's because something went wrong on the server side. that doesn't exist, the portal complains about it, and the mobile sdk wraps the error message with serverexception the onsuccess method is called on the main ui thread after the request since the request is asynchronous, the service call immediately the service delivers the service's real return value to the callback's onsuccess method, instead example code is shown here for asynctaskcallback and now that you have your callback class, you can set it to the session once you've implemented and instantiated your callback class, you're ready to if you haven't created a session yet, do so now. invoking liferay services in your android app shows you how to create a session. now you're ready to set the callback to the for example, this is done here for asynctaskcallback now you're ready to make the service call last but certainly not least, make the service call. calling any other service create a service object from the session and use it this is also described in the tutorial invoking liferay services in your android app. an example service call that gets all the blog entries from a site's blogs the example code from the above sections is shown together here now you know how to invoke services asynchronously from your android creating ios apps that use liferay;;
|
"the mobile sdk also allows sending requests in batch. efficient than sending separate requests. for example, suppose you want to delete ten blog entries in a site's blogs portlet at the same time. making a request for each deletion, you can create a batch of calls and send this tutorial shows you how to implement batch processing for your android app. it's assumed that you already know how to invoke liferay services from your invoking liferay services in your android app. now get ready to whip up a fresh batch of service calls! making service calls in batch only requires two extra steps over making them one the rest of the steps are the same as making other service calls. a service object, and you still need to call its service methods. here's a code snippet from an app that deletes a blogs portlet's blog entries after the import, batchsessionimpl is used with a pre-existing session to create a batch session. constructor takes either credentials or a session. constructor is useful when you already have a session object and want to reuse after creating the service object, several deleteentry since the service object is created with a batch session, these calls aren't made immediately; they return null instead. calls aren't made until issued in batch by calling the invoke method on the it returns a jsonarray containing the results for each since this example contains three deleteentry calls, the jsonarray contains three objects. the results are ordered the same as the but what if you want to make batch calls asynchronously? the callback as a batchasynctaskcallback instance this is similar to the procedure for making asynchronous calls as described in invoking services asynchronously from your android app. now you know how to make efficient service calls in batch! invoking liferay services in your android app invoking services asynchronously from your android app creating ios apps that use liferay";;
|
although the jsr 329 standard does not define any jsf components that bridge implementations are required to provide, liferay faces bridge comes with a handful of components that are helpful to use in jsf portlets. more about liferay faces bridge, visit the understanding liferay faces bridge for listings, demos, and code examples of liferay faces bridge components, check the liferay faces bridge project home page can be found at because liferay faces has several active versions targeting different versions of jsf, liferay portal, etc., there are several versions of the project view declaration language vdl documentation for these liferay faces bridge provides ui component tags under the bridge and portlet namespaces for the bridge and portlet 2.0 tags, respectively. tutorials, you'll explore several of these tags and learn about how they work;;
|
liferay faces bridge provides bridge-specific uicomponent tags as part of its in this tutorial, you'll explore the bridgeinputfile tag and learn what it can do for your jsf portlet the bridgeinputfile tag renders an html tag, providing here's a code snippet from a class that imports the fileuploadevent class and implements handling the file upload notethe bridgeinputfile tag depends on apache's commons-fileupload you can add another uicomponent to your repertoire!;;
|
liferay faces bridge provides several portlet 2.0 uicomponent tags as part of in this tutorial, you'll learn about the note although jsp tags are provided by the portlet container implementation, liferay faces bridge provides these tags in order to support if the var attribute is present, the portletactionurl tag introduces an el variable that contains a url.actionurl, adequate for postbacks. otherwise, the url is written to the response this knowledge adds just another component tag for your jsf portlet development;;
|
liferay faces bridge provides many useful portlet 2.0 uicomponent tags as part in this tutorial, you'll learn about the if the var attribute is present, the portletnamespace tag introduces an el variable that contains the portlet namespace. namespace is written to the response another uicomponent tag to use for jsf development is in the books;;
|
the liferay faces bridge component suite provides many portlet 2.0 uicomponent tags that are useful for jsf development. in this tutorial, you'll learn about nested inside portletactionurl, portletrenderurl, or portletresourceurl now you know a little bit about the portletparam tag and have viewed a;;
|
alloyui's carousel module has a lot to offer as is, but you can take it to the next level by customizing it and making it your own. set up the basic aui-carousel, please refer to the tutorial in this tutorial, you'll learn how to modify the ui of the standard there are three key steps to follow as you customize your carousel assign an id to the carousel and its images configure the carousel's attributes style the carousel from the url file now that you know what lies ahead in this tutorial, it's time to start rolling! first, you must add an id value for the carousel's element and each of this was demonstrated in the tutorial for example, if your carousel has four images, you might specify your carousel and its images in your jsp using elements like these your carousel and its images are now identifiable, making them ready for in addition to identifying your carousel and its images, you can configure the the following example jsp code configures a carousel there are some things worth pointing out about the above example carousel code. the mycarousel is the carousel widget's bounding box used for the carousel is set to display each image for two seconds. transition between images is set to last one second. to zero displays the first image listed in the mycarousel when the note this is only a subset of the carousel's if you choose not to set values for these attributes, for a full list of the carousel's attributes and their defaults, as well as further documentation on it, please visit now that you've laid the configuration groundwork for the carousel, it's time to the carousel's ui has a lot of moving parts that you can style. things organized, you may want to customize your carousel's body and images. then, you may want to style its menu controls, its active and inactive index indicators, and its menu bar and its list of controls. the figure below identifies different carousel elements that you can manipulate with css figure 1 here are the carousel's key elements that you can style now that you're familiar with the carousel's elements, you can start styling the you can specify your carousel's style in the url file in your portlet's the example css code below is for styling a carousel's the code starts off by setting the width and height for the carousel body and then rounds the carousel's edges with the border-radius property. carousel is centered in the middle of the portlet by setting the margin property of the boundingbox element mycarousel in this case to auto for the top margin is set to 0, while the bottom margin is set to 40px, to leave room for the menu's controls. given a background-image property that points to its respective url now that you've styled your carousel's body and images, it's time to make its each menu control has an existing class that you can reference via css. identify the classes for the controls by viewing the document object model dom to give you an idea of the tree's overall structure, below is a you can see that the carousel menu controls lie within the mycarousel, must traverse the dom tree to select the carousel's elements and style them note you can view the dom tree by right-clicking the carousel's next menu button and inspecting its html code in once you understand the dom tree for each element, you can go ahead and specify the styling for each of the menu buttons with their corresponding class. menu button has a background property that you can set to an image file each button also has a border-radius property that lets you round if you don't want rounded edges, you can omit the border-radius the url file example code below demonstrates make sure to place any custom background images for your menu controls in the folder you specify for the control's background-image url. styled your carousel's menu controls, you can move onward to styling your carousel's active and inactive index indicators! as with the menu controls, you style the carousel's active and inactive index please refer to your carousel's dom tree to see its structure for yourself. below is example code for styling active and inactive index indicators in a url file the indicator images are set with the background-image property. indicators are then assigned a color with the background-color property now that you've taken care of the index indicators, it's time to cover styling the carousel's menu bar and menu controls list as with the other styles, you can view the existing class for the menu bar and below is one example from a url file the left edge of the menu bar is set 518 pixels from the carousel container's the top edge of the menu bar is set 250 pixels from the container's top edge, placing it just beneath the carousel, which is 250 pixels high. menu bar's width is scaled down to 26 the size of the carousel's width. finish out the css, the list, which holds the menu controls, is set to adjust to the size and shape of the menu bar you've completed the css for your carousel to give it a fresh new look. yourself a pat on the back for adding some seriously awesome style to your when you're ready, go ahead and deploy your portlet to your portal if you've added the carousel to a portlet that has already been deployed, you may need to undeploy and redeploy the portlet in order for your in this tutorial, you've learned how to take the basic aui-carousel module and first, you learned how to set some basic attributes to configure the carousel. then, you learned how to re-design the carousel by setting the styles of the carousel's body and images. styled your carousel's menu and controls to match your taste you have successfully learned how to give alloyui's carousel your own here is an example of a carousel that uses customizations from this tutorial figure 2 here is an example of a customized carousel, that uses this tutorial's scripts you can access a finished version of the example customized portlet at url.2.xdevguidecode12-working-with-alloyuicustomized-carousel-portlet enjoy making your carousel the best that it can be! implementing a ui with liferay taglibs;;
|
in this tutorial, you'll learn how to manipulate html elements in the dom you'll also learn how to handle events on and if you're playful at heart or you simply want to see dom manipulation and events come to life, you can explore the silly phrase generator example portlet at the end of the tutorial throughout the exercises in this tutorial, you'll use the alloyui taglib aui. to access it in your view jsp, add this directive to it you must also add an element into which you'll put alloyui-based javascript for manipulating he dom. element's use attribute to specify alloyui's dom-related packages. reference html element node objects, you must specify that your script uses you can use as many alloyui packages as you like by declaring them in a comma-separated list of values assigned to the script's use attribute the exercises in this tutorial show you various ways to manipulate dom nodes in jsps, so feel free to write similar code in your jsps. you'll master the dom with alloyui in no time! alloyui provides the html method to set and get the inner html value of a to get a node object's value, invoke the html method, passing to set the html value of a node object, pass in an html value as an argument for the html method. the examples below illustrate how the html gets the html value of the node on which it's called. url gets the html of node1's node object html'html' sets the html value of the node on which it's called. example, url'rosebud' sets the html value of node1 to rosebud you must grab, or select, nodes in order to get and set their html values. url method returns the first node that matches its selector parameter and the url method returns all the elements that note that alloyui uses the same selectors as css the list below describes a few of alloyui's selectors that you can use.class selects nodes with the given class name. url'.wrapper' returns the first element with the class name wrapper element selects nodes that match the given element. url'p' returns all of the paragraph elementattributevalue selects nodes with the matching attribute setting. for example, url'divtitlesection' returns the first div element with an attribute setting title'section' selects nodes that match the given id. url'' returns the first element with the id attribute setting lists all the selectors that alloyui supports here's example jsp code that demonstrates getting the value of a specific paragraph node and applying its value to part of another paragraph node's new it selects the first node with setting idparagraph and then sets that value in the html of the paragraph that has the setting idhtmlvalfrompara. figure below shows the result of using this example code in a jsp figure 1 grabbing html nodes and modifying them is a breeze with alloyui's selectors and html methods do you want to manipulate taglib nodes too? for example, if you have an element with the setting idsubmit, you could select it by invoking url . example jsp code that grabs the value generate from an and uses the figure below shows the results of rendering the code example figure 2 alloyui lets you select taglib elements, like this , and use its html value you can also get and set node attributes, including a node's value attribute. alloyui's attr and val methods make this possible. are overloaded, meaning that they can be used for both getting and setting if you pass an argument to the val method, it sets the node's if you don't pass val any arguments it gets the the attr method behaves in a similar manner. the attr method two arguments, the first argument specifies the attribute to be modified and the second argument specifies the new value of that attribute. if a second argument is not given, the attr method gets the value of the below are concise descriptions of both methods and a code example that demonstrates how properly to use the methods attrattribute sets or gets the value of a node's specific attribute. example, url''.attr'name' gets the value of the name attribute of the first node that has the attribute setting idcontainer val'value' sets the value of a node's value attribute. parameter is specified, it returns the value of the node's value attribute. example, url''.val returns the value of the value attribute for the first node that has the attribute setting idinput1 the example code below demonstrates getting an element's type attribute and it changes the's type value from the figure below shows a portlet that uses this example code in its view figure 3 in this example portlet, its button's original html value, original type, and new type are printed you can appendadd other elements to a node using the append method on the you can append a brand new element or an existing element that's to append an existing element to a node object, invoke the appendto method, passing the variable of the node object you wish to append as the argument of the method. append'element' adds an element to a node object. you're a lizard harry adds the new paragraph to appendto'nodeobject' adds one node object to another node object. example, url adds the element set of node1 to the element the example below appends new paragraph elements to the s and then appends one element's html to another element the figure below shows the results of appending the new element. node2's paragraph is appended to node1's paragraph. first node is followed by a horizontal rule, to show where the first node ends and to separate it visually from the second node figure 4 appending new or existing elements to a node is easy with alloyui lastly, regarding node manipulation, you can style nodes. methods for applying styles with css. below is a list of some of the available addclass adds a class to the node. url'foo' adds the class foo to the node object removeclass removes a class from the node. url'foo' removes class foo from the node object setstyle sets the css property given. url'border','solid' sets the node object's border css getstyle gets the value of the css property given. url'border' gets the value of the node object's border css at this point, you know how to manipulate nodes that are on your page. to dynamically work with user input. the next section shows you how to handle some html nodes can generate events. you can handle these events to process their information and to provide content based on interaction with the user. in this section, you'll learn how to subscribe to node events and handle them first, you must declare the portlet and aui tag libraries to access their from the portlet tag library, you should include the tag so that you can access portlet objects like renderrequest, actionrequest, and portletpreferences in your jsp. add the following declarations to the beginning of your jsp you must also configure your script to use alloyui's event package. the event package to your leading tag's use attribute. configure it to be like this script tag using the on method of a node object, you can subscribe to events and trigger a function when an event occurs on that object. the available events you can subscribe to on an are blur when a node loses focus, click, focus when a node gets focus, mouseout, and note you can find descriptions of more alloyui event methods at the alloyui rosetta stone the example below subscribes to the click event of a button that's a part of a the form has a single input field that has the attribute setting when a user clicks the button, the jsp code below handles the event by printing the value of the input field for the example above, when the user clicks on the generate button, the value of the input field is printed above the verb input field figure 5 alloyui lets you handle events on all kinds of elements, like the event triggered by this some other methods of interest are the hide and show methods. you hide and show elements in the dom hide'nodeobject' hides a node object. with the hide and show methods you can hide and show dom nodes appropriately for the flow of your user experience in this tutorial, you've learned the fundamentals of getting node objects, setting their values, and reacting to events on them. next section shows you an example portlet that demonstrates all of the alloyui features that you've learned in this tutorial. if you want to have fun trying it out and familiarizing yourself with its code, continue with the next section the silly phrase generator portlet relies heavily on alloyui's dom manipulation you can add the following code into a portlet jsp or you can just look at the portlet's code the portlet's code resides on github but it's also shown here for your convenience the portlet gets the value of each of the input fields in the element at the end of the code. note that in selecting each input field, the input field's id value is preceded by the tag. namespacing issues between portlets in addition to the input field and button variables, the code declares a variable named phrase, in which to display the silly phrase. element created earlier in the code. then it adds an element to display the silly phrase by appending a to make sure that the html is not rendered if any fields are blank, conditional logic wraps the call to the method that sets the html for the phrase. portlet also includes a button that lets you hide or show the title once you've either copied the code into your portlet's jsp or you've downloaded the portlet from github into a liferay plugin sdk, you can deploy and test the silly phrase generator code. the one below, your silly phrase displays this phrase walk your left-footed platypus gingerly in the warehouse. figure 6 you can experiment with dom manipulation by generating silly phrases with the silly phrase generator example portlet if you've copied the silly phrase generator jsp code, then you may also want to consider making some style changes to it. the silly phrase generator functions well, but the silly phrase that is generates looks small compared to the title. you can enlarge the silly phrase text in case you didn't notice, the jsp adds a class to the phrase node this class was added inside the btnsubmit function so that when the user clicks the button to generate the silly phrase, any styling for the class is added to the silly phrase before it is displayed. phrase node by opening your portlet's url file and adding styles like when you generate a silly phrase, you'll see your new styles applied to the your silly phrase generator is complete, and you now have a basic understanding of how to manipulate the dom using alloyui;;
|
using tabs is a good way to keep your portlet's ui clean and organized. liferay's liferay-ui tag library provides simple, easy-to-use tags to by using the liferay-uitabs tag in conjunction with the liferay-uisection tag, you can quickly create a tidy ui that's easy figure 1 using tabs can streamline your portlet's interface this tutorial shows you how to use the liferay-uitabs tag and liferay-uisection tag to implement a tabbed interface in your portlet. you're done you'll be able to keep tabs on anything! the liferay-uitabs tag is easy to use. the examples below show how to add and use the liferay-uitabs tag with the liferay-uisection tag in your there are three basic steps to accomplish this follow these steps and you'll have a well-organized ui for your portlet in no now, onward to building a tabbed interface! open one of your portlet's view jsps. create one if it doesn't already exist add a directive at the top of the file to reference the liferay-ui tag with the first step out of the way, you can now use liferay-ui tags in your specify a tag and add a names attribute to it, with the names of the tabs you want to create. you can specify as many tabs as you like for example, if you wanted to add three tabs named tab1, tab2, and tab3, you could add this code to your jsp you can deploy your portlet's changes and visit this view jsp that has the tabs, to make sure they're shown just as you specified. the first tab is always selected? while your tabs resemble the structure you want, they're not associated with any content or functionality. liferay-uitabs tag's attributes and the liferay-uisection tag to add there are several attributes that you can use with the liferay-uitabs tag that add functionality to your tabs. below is a listing of some of these backlabel sets a label for the back url formname sets the component's form name names sets the names of the tabs. each name must be separated by a comma onclick sets a function to be called when users click the tabs param sets the variable to refer to the tabs component portleturl sets a url to reference the portlet itself refresh sets whether the page refreshes when a tab is clicked. tabsvalues sets the tab value names. values must follow the same order as the tabs defined in the names attribute. each value must be separated by a possible values are tabs and pills url sets the url all the tabs are linked to when clicked. the url of each tab individually by using the urltab-number attribute url0-9 sets the url the given tab number links to value sets the tab that is active when users first visit the page your by default, the first tab is active now that you know what attributes are available, you can use them to spice up before you start adding attributes, you should create a section for each of the sections allow you to associate content with each tab. your liferay-uitabs tag you can add a liferay-uisection tag for each of the tabs you named in the names attribute of your liferay-uitabs tag. within each section, you can add html content or add content indirectly by including content from another jsp here's example code that demonstrates adding sections for three tabs named note that the text for each tab in this example is bounded by a the figure below shows what this sample code looks your portlet's tabs and sections may look similar to it figure 2 placing content inside sections allows you to associate it with individual tabs the liferay-uitabs and liferay-uisection tags work together to produce a clean, well-organized ui for your app. using text, however, your tabs may not seem very exciting. while it's possible to add content directly inside the liferay-uisection tags, it may be better to place content in separate jsps and reference them from the sections by adding an directive as the liferay-uisection tag's content. below demonstrates how to configure jsps in this manner for example, if you wanted to provide a means for users to select a time zone, you could add a liferay-uiinput-time-zone tag to a separate jsp and then include it in a tab section of your main view jsp. file named url that contains this time zone component once you've prepared a separate content jsp, you can add an include directive to reference it in an appropriate liferay-uisection tag in your view jsp in the example below, the third tab refers to a separate content jsp file named if you configured a portlet that implemented the code from these examples, the portlet would look like the screenshot in the figure below figure 3 here's an example of what a tab could look like referencing useful content like this time zone selector in this tutorial you learned how to implement a tabbed interface for your now you can keep tabs on all kinds of portlets!;;
|
by using meaningful graphics as icons, you can draw your users' attention toward important parts of your portlet. using icons also enhances your portlet's think of it as wrapping your portlet up in a nice, user-friendly bow. you can display icons in your portlets with the liferay-uiicon taglib. the figure below for an example of icons being used in a portlet figure 1 here's an example of a portlet that uses an icon now it's time to go icon crazy! get started by learning how to use liferay's liferay has a wide variety of icons that you can use in your portlets. located in your webappsroothtmlthemesclassicimagescommon directory. follow these steps and you'll be using them in no time reference the liferay-ui and portlet taglibs by adding the following taglib declarations to the top of your url file now that you have the proper taglibs referenced, you can use liferay-uiicon in your url to add icons to your portlet to use an icon, declare its name without file extension in the image attribute the code below uses liferay's add icon in a portlet the whole url that includes the icon would look like this the figure below illustrates the code above figure 2 here's what the add icon looks like in a portlet you have successfully added an icon to a portlet! the example appears near the top of the portlet. the position of the icon in the portlet is dictated by the position of liferay-uiicon relative to other items there are a few more attributes for liferay-uiicon that can take your design what if you want to link an icon to a site? add a url attribute with the site url to liferay-uiicon. code creates a url to the liferay home page using the add icon you can also change the tool tip that appears when you hover your mouse over the by default, the tool tip is just the name of the icon. but sometimes it isn't sufficiently descriptive. use the tool tip to suggest the user take a specific action. just add a message attribute to liferay-uiicon with the the next bit of code defines a message that tells your figure 3 here's what the add icon looks like with the changes above when hovered over now that you have an understanding of how to use liferay's icons in your portlet, it's time to use some of your own! the process for adding your own icons in a portlet is similar to the process of there are just a few minor but important differences you should note that liferay-uiicon uses sprites that hold multiple icons. for instance, all of the navigation icons are in one url file. you use one of the navigation icons, you are grabbing the icon from a larger group of icons in a single sprite file you may be thinking, what is all this sprite talk? case, a sprite refers to an image sprite. an image sprite is a group of images that are combined into one single image. each image loaded by the browser is a separate http by combining multiple icons into one larger image, you can turn 12, 20, or even 100 separate http requests into just one. sprites greatly decreases load times and increases efficiency lucky for you, liferay automatically generates sprites of your icons as long as they are placed in the proper folder. when it comes to portlets, sprites are only generated for png files located in the docrooticons directory to put your own icons in your portlet, just add a src attribute to liferay-uiicon that points to the location of your custom icon. this bit of code puts url in your deploy your portlet and your new icon appears inside it. learned how to use your own icons in a portlet! using liferay ui tabs and sections using liferay-uisuccess and liferay-uierror messages;;
|
liferay contains some standard navigation elements that are used throughout its you can use the same elements, because they are encapsulated into tags that build those elements for you. liferay ui provides the icon menu tag to this tutorial covers how to configure and use the liferay-uiicon-menu tag now that you know what the icon menu can do for you, it's time to see how to use the liferay-uiicon-menu tag takes a list of child components and renders them the example below shows how to add and use the liferay-uiicon-menu go through each of these steps to create menus in your application open the url of your portlet. create one if it does not already add a directive to reference the liferay-ui taglib you can now use the liferay-ui tags in your portlet! inside your portlet's url, add the liferay-uiicon-menu tags at the you'll place all your icons for your menu inside the tags you just added. in this step you'll add the icons that you wish to display in your icon menu still inside the url nest the liferay-uiicon tags inside the repeat the step above to create as many icons as you need for your navigation it's important to note that the icons must have their url attribute configured in order to render properly in the icon menu. create a default menu with default attributes. available attributes for the icon menu tag to give your menu more of a custom the list below gives some of the available attributes along with how to you can view the full list of attributes here direction sets the direction the menu pops up relative to the button that maxdisplayitems sets the number of icons to display in the visible area of message sets the text to be displayed on the button trigger for the icon showarrow sets whether to display a arrow on the button trigger to indicate useiconcaret sets whether to point the arrow on the button trigger towards the direction set by the direction attribute. with the settings above, your icon menu should look like the figure below figure 1 setting up an icon menu is a piece of cake as you can see, the liferay-uiicon-menu tag is easy to use using liferay ui tabs and sections creating a navigation menu with the liferay ui icon list tag using liferay-uisuccess and liferay-uierror messages;;
|
the navigation for your site can have a huge impact on how people interact with poorly designed navigation can ruin even the best of content, causing people to run screaming from your site to warn the other villagers of the monster you this is an exaggeration of course, but the point is that your site's navigation should be taken seriously one important aspect of design is how your navigation is organized. placement and layout of your site's navigation can play a big part in how your liferay ui provides a easy to use tag that allows you to create a list-style navigation with ease liferay-uiicon-list. liferay's sign in portlet makes use of this tag for its navigation figure 1 liferay's sign in portlet uses a liferay ui icon list as its name suggests, the liferay-uiicon-list tag allows you to create a navigation menu from a list of icons. liferay-uiicon-menu tag for a pop-up menu navigation. this tutorial covers how to use the liferay-uiicon-list tag to create a by the end of this tutorial you should be able to keep the torch carrying mob at bay, at least when it comes to the navigation of the example in this tutorial shows how to add and use the liferay-uiicon-list tag in the url of a portlet by using the following steps go through each of these steps to get your navigation going! open the url of your portlet. create one if it doesn't already add this directive to reference the liferay-ui taglib you can now use liferay ui tags in your portlet! liferay-uiicon-list tag to your portlet. it sounds like the unruly mob is already starting to head back to the village! next, add the liferay-uiicon-list tags to the bottom of your portlet's the example here shows these tags in the next step, you'll place all the icons in your list inside the tags you still inside the url, nest the liferay-uiicon tags inside the there are a few attributes for the liferay-uiicon tag that you should note. the image attribute tells liferay what image to use for the icon. example, if the value of image is statusonline, then liferay uses its default icon for a user that is online. the message attribute defines the text for example, if you set the value of message to sign in, that text appears next to the icon. defines the url to go to when the icon is clicked. list with three icons that use these attributes of course, you can add as many icons as you need to your list. shows the icon list created by the above code figure 2 an icon list with three icons you can rest easy now, knowing that the villagers will enjoy customizing liferay portal with hooks;;
|
liferay faces alloy is a.jar file that you add as a dependency in your jsf portlet project to leverage alloyui. provides a way to use alloyui in a typical jsf development fashion. a set of facelet uicomponent tags as part of its component suite for listings, demos, and code examples of liferay faces alloy components, check out the liferay faces showcase. example using liferay faces alloy components, visit the the liferay faces alloy project home page can be found at because liferay faces has several active targeting different versions of jsf, liferay portal, etc., there are several versions of the project's view declaration language vdl documentation for the following tags have been deprecated in the liferay faces alloy 3.2.5-ga6 release and removed in the liferay faces alloy 4.2.5-ga6 release;;
|
liferay faces portal is a.jar file that you add as a dependency in your jsf portlet project to leverage liferay portal's jsp components liferay faces portal provides a way to use liferay-security jsp components in a typical jsf development fashion. facelet uicomponent tags as part of its component suite for listings, demos, and code examples of liferay faces portal components, check the liferay faces portal project home page can be found at because liferay faces has several active targeting different versions of jsf, liferay portal, etc., there are several versions of the project's view declaration language vdl documentation for the following tags have been deprecated in the liferay faces portal 3.2.5-ga6 release and removed in the liferay faces portal 4.2.5-ga6 release;;
|
"developer studio makes it easy for you to write custom business logic that learn to create your own workflow in developer studio and discover features from kaleo designer for java designer along the way to begin demonstrating designer's features, this tutorial creates a workflow definition for a software ticketing process view it in full figure 1 check out the adventures of liferay's mascots, ray and alloy at url create new workflow definitions by going to file new alternatively, you can select liferay kaleo workflow from the toolbar button shown in the figure below figure 2 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 figure 3 the create kaleo workflow form in liferay developer studio lets you select a script type and template type for your workflow you're directed to the choose assignment type window next. provide an initial task name, then choose an assignment type from the list to follow our workflow example, select assign to asset creator and name when the workflow's developer task is invoked, the creator of the workflow's asset is assigned to it. workflow is associated with an asset type. ina later tutorial, the workflow will be associated with a dynamic data list ddl figure 4 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 workflow definition setup the graphical workflow diagram appears, which is convenient for editing the graphical features and toolbars allow you to customize your workflow the palette view is one of designer's most commonly used tools the palette lets you graphically customize your workflow with nodes and in addition, you can choose different behaviors for your mouse figure 5 the palette toolbar lets you customize your workflow with additional nodes and transitions once you've created a project, you'll want to start really fleshing it out. learn to design and create workflows in the next tutorial.";;
|
"to illustrate several different workflow strategies, here are diagrams of each of the workflows that ship with the kaleo web plugin. figure 1 the scripted single approver definition is identical in structure to the single approver definition that comes installed with liferay, but includes a scripted assignment figure 2 the legal marketing approval definition has two review tasks and an update task figure 3 the category specific approval definition has a condition node, two review tasks, and an update task think of workflow as a state machine made up of nodes. task, a condition, a fork, a join, or a timer. each type of node has different properties. example, states execute actions automatically and require no user input. block until user input completes a transition to another state. then moves the workflow to the next task or state. the end approved state is reached. for example, you could create a workflow which goes through two approvers. initiating the workflow puts it in the in review state and then transitions to a task which requires user input. approve or reject the asset as part of the task. the asset in the workflow, a condition checks to see if there are two since there is only one, workflow transitions back to the task. the second user approves the asset, the condition finds there are two approvers and it triggers a different transition to the approved state 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 the kaleo workflow designer for java each node type supports execution of scripted actions and sending notifications that can use templates note unlike most tutorials on liferay developer network, this set of tutorials works toward building a specific project, the we started building the project in the tutorial on creating a workflow definition with kaleo designer for however, you can use the information you find here in your own workflow project for the ticket-process-definition workflow diagram, there's a simple startnode state node, followed by the developer task node, followed by there are two transitions, from startnode developer and from developer endnode here's the idea behind the ticket process workflow definition. should approve his fix and send it for quality assurance to qa, where it must then it'll go to qa management, where it must let's use a fork node to accurately depict these 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 4 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 5 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 if you click on an error marker, developer studio displays hints on resolving the problem. don't worry, we'll address these error clicking on 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 the qa tasks in our ticket process workflow, let's assign someone other 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 discover documentation on to configure the user's email, login to the user's account and visit control panel server administration 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 6 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 let's take a moment to consider the xml code of the ticket process workflow definition in its current state it specifies its xml version, encoding, and its document root element called nested within the workflow-definition element are its name, description optional, version, and its nodes 1 fork, 1 join, a start here's the general overview of our workflow definition we'll describe each of our workflow definition's nodes, starting from top to our start state node, named startnode, simply transitions the flow of execution to our developer task. here is this state node note, we left off the optional... elements to shorten the code snippets the developer task is assigned to the creator and transitions to the endnode each workflow instance is associated with an asset. default, a task is associated with the asset creator the ending state node is named endnode. action is to be executed on entering this node our workflow definition has one fork node named pass to qa. process to the qa and qa manager task nodes both the qa-related task nodes are assigned to the user with screen name lastly, the qa and qa manager task nodes transition into the pass to qa now you know what the resulting xml is like for your workflow definition. can check your definition's source code anytime from within liferay studio or to learn more on the different workflow nodes available to use in liferay workflow definitions, see the discover documentation on creating new workflow definitions since we've been using designer's workflow diagram mode, let's go over some of 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 figure 7 the workflow diagram actions are in the toolbar in the upper right corner of the workflow diagram 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 8 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 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 9 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 note the discover portal section 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 creating nodes and transitions is good, too. there's more you can do with it; keep reading to learn about creating workflow scripts, or making your notifications more interesting using freemarker templates.";;
|
as much as java is used throughout liferay's back-end data layer, javascript is used throughout its presentation layer. liferay uses javascript to implement responsive control logic and provide powerful ui components, and the scripts liferay's javascript follows the module pattern to encapsulate data and it makes available its modules via the liferay global object. the liferay object is loaded automatically at runtime and is available throughout the portal, its theme, and all portal plugins. of sub-objects that are chock-full of useful methods. how you can take advantage of liferay's javascript objects.;;
|
as you design apps, you have to consider the user's browser and platform. you find that you must tailor an app's ui to the features and limitations of you might, for example, display one set of controls to a user on browserplatform a and a different set to a user on browserplatform b. the liferay.browser object's methods can determine a user's browser, operating this tutorial describes these methods and shows how to first, you can determine a browser's type and version the following methods return true if the user's browser matches the type ischrome returns true if the browser is google chrome isfirefox returns true if the browser is mozilla firefox isie returns true if the browser is microsoft internet explorer issafari returns true if the browser is apple safari isopera returns true if the browser is opera the following methods return information about a user's browser version and getversion returns the browser's version number e.g., 44.0 getmajorversion returns the starting whole number portion of the browser's getrevision returns the browser's revision number e.g., 537.29 . revision number might have no resemblance to the version number now that you're familiar with the browser type and version methods, you can learn how to get a user's platform information the liferay.browser object has methods that can help you determine the user's platform, including the user's device type and operating system here are the platform detail methods isiphone returns true if the device is an apple iphone ismac returns true if the device is an apple mac islinux returns true if the operating system is linux iswindows returns true if the operating system is microsoft windows below is a code snippet that demonstrates how to use these methods in a url file in a portlet's docrootjs folder such javascript functions can be referenced in the portlet's jsp's. the following input tag associates the previous function with a button's click you can use liferay.browser object's methods to cater to users on various getting ids, paths, and sign-in details in javascript user interfaces with the liferay ui taglib;;
|
in java, developers are used to being able to find lots of context information you can learn about what user is browsing your application, what page it's on, what site it's in, and lots more. could access that same information in javascript? it's a part of the liferay global object that's automatically available to you you can refer to the object as liferay.themedisplay. the themedisplay object provides information on many aspects of a portal. it can identify the portal instance, the current user, the user's language, and the user's navigational context. it can tell you the paths to a portlet's scripts and images, a theme's images and files, and a portal's main folder. it lets you know if a user is signed in and if the user is being impersonated. you can quickly assess your portal surroundings with themedisplay this tutorial describes some of the most commonly used themedisplay methods for getting ids, paths, and user sign-in details using the themedisplay methods below, you can grab ids of various portal getlanguageid returns the user's language id getusername returns the user's name now that you know how to retrieve ids of some of liferay's key elements, you can learn how to get paths to various deployed entities in the portal the themedisplay object has methods for retrieving commonly used file paths. below are a few of the methods getpathimage returns the relative path of the portlet's image directory getpathjavascript returns the relative path of the directory containing the portlet's javascript source files getpathmain returns the path of the portal instance's main directory getpaththemeimages returns the path of the current theme's image directory getpaththemeroot returns the relative path of the current theme's root now that you know how to retrieve paths to liferay's deployed entities, you can next learn how to get information about the current user here are a couple methods related to the current user isimpersonated returns true if the current user is being impersonated. authorized administrative users can act as another user to test that user's account issignedin returns true if the user is logged in to the portal below is javascript code that demonstrates using themedisplay's issignedin the example above alerts a signed in user with a personalized greeting. otherwise, it defaults to a guest greeting. although this is a basic example, it shows how you can easily define unique user experiences with the themedisplay getting browser and platform details in javascript user interfaces with the liferay ui taglib;;
|
"liferay 6.2 uses twitter bootstrap-based theming for a slick, vibrant look and feel with instant access to the twitter bootstrap bootstrap theme but there are a number of changes that needed to be made to alloyui in order to accommodate and properly use bootstrap. the reasoning behind the changes to alloyui and we'll explain how to migrate plugins to use alloyui 2.0 and bootstrap here is an outline of the types of changes you'll need to understand and handle in migrating your plugins to liferay 6.2 the good news is that liferay provides a tool for making these changes. before we show you that tool, we'll explain the impact of each of these alloyui changes with respect to liferay 6.1 plugins. first, let's look at the removal of the aui- class prefix was hindering developers from copying and pasting examples from bootstrap's site into their liferay plugin code. the prefix from all of alloyui's css and javascript classes. update any references to the classes that have been removed. should remove the aui- prefix from the class reference.aui-ace-autocomplete, converting the reference to.ace-autocomplete. are plenty more class references like this one that you'll need to update there are a number of html tags that alloyui 1.5 styled by defining custom css for example, alloyui previously styled the html tag in a but since bootstrap provides styling for these tags, we now leverage the styling by wrapping the bootstrap code see for migrating such classes as.aui-fieldset to alloyui 2.0, simply remove the aui- prefix but append the.aui parent class name for example, you'd replace this file for the html tags that bootstrap styles next, let's consider the modules that have been deprecated in alloyui 2.0 because extensive changes were needed for a number of alloyui modules, many of the original modules were deprecated. in some cases the original modules were deprecated with no replacement; in other cases we used the original name for the new module implementation and have simply renamed the old module by adding a alloyui 2.0's module api is documented at note, some of these modules have new implementations with the same name, excluding the suffix -deprecated. liferay's alloyui upgrade tool tacks the -deprecated suffix onto module references it finds. next, let's consider the css classes that have been replaced by bootstrap many of the css classes used in alloyui 1.5 were replaced with bootstrap classes or were removed because they didn't blend well with bootstrap. with css classes in your plugins. consider replacing your classes with url for more information on these css classes next, let's consider the component output and markup changes in alloyui 2.0 alloyui 2.0 introduces appealing new changes in its output and some practical these changes help facilitate building uis with a consistent look and feel, and they help improve ui performance. of these component changes via the pages of examples and tutorials found on you'll have to take a look at the alloyui 2.0 api documentation to understand a number of the markup changesbut here are some common changes there are plenty more changes, but at least these are a few to get you started. and remember that the liferay alloyui upgrade toolthat we'll introduce shortlywill help you out as well. next, let's consider the changes in the we replaced many icons with those provided by bootstrap. these icons look great and provide a consistent look and feel throughout liferay and our plugins. plugin's references for icons that have been removed. liferayicon taglib, you simply need to change the value of its image attribute to that of a different icon. consider using the new icons available in bootstrap, such as their icons from we've given you the dime tour of the types of changes you'll need to accommodate in the plugins you're migrating from liferay 6.1 to 6.2, but to really jump-start your migration process, we'll show you liferay's alloyui so, put on your work gloves and get ready to power through to access the liferay-aui-upgrade-tool project and install it locally, you'll need an account on github and the git tool on your machine. url for instructions on setting up the account and see url for instructions on here are some simple steps for forking the liferay-aui-upgrade-tool project on github and installing the project locally go to the alloyui project repository at click fork to copy liferay's liferay-aui-upgrade-tool repository to your in your terminal or in gitbash, navigate to the location where you want to put the liferay-aui-upgrade-tool project. repository by executing the following command, replacing username with navigate into your new liferay-aui-upgrade-tool repository directory and associate a remote branch to liferay's liferay-aui-upgrade-tool repository so you'll be able to fetch its latest changes from time to time you now have all of the liferay-aui-upgrade-tool project's source code. project's tool you use to upgrade plugins to alloyui 2.0 is called laut, which stands for liferay aui upgrade tool. you can build the upgrade tool using url, which is a platform for building applications. unix users can download its source in a url file, unzip it, un-tar it, and build it per the instructions in its url file. download the.msi installer file and run it warning on windows, only install to locations that have unix-friendly paths. that contain space characters and parentheses can prevent software from working to build the upgrade tool with nodejs, execute the following command exclude to get the usage summary of the upgrade tool, run it with the --help option by default, the upgrade tool expects to convert files with extension js, you can specify a list of file extensions as arguments with the -f option you can specify individual files or directories to search through and convert. it's common for users to simply specify a single directory for the tool to search and convert all of the files let's use the upgrade tool to upgrade liferay's ce 6.1 microblogs portlet from using alloyui version 1.5 to using alloyui 2.0. microblogs portlet in its liferay-plugins repository let's take a look at the changes the upgrade tool made to the portlet's jsps in the url, the upgrade tool renamed the aui-io module to the tool replaces module references, even if a 2.0 module exists with the same name, for a couple of different reasons. that you look at a diff of the modifications the tool makes, you'll notice that the module has been deprecated. knowing that, you can investigate whether there is a new alloyui 2.0 module that you should start using instead. investigate the api for the 2.0 module to find out how it works and to determine second, by using the deprecated module, you're assured that your code will not run into interpretation errors; it may even exhibit the you must investigate if the deprecated module's it's up to you as to when and how to start using a 2.0 in 2.0, many of the aui- prefixes were dropped and in some cases modules were for example, the upgrade tool modified the microblogs aui-helper-hidden with its new 2.0 module named hide let's take a look at a different type of change done in the microblogs portlet's notice that the aui- prefix is deleted from all alloyui class names, replacing aui-button-holder, aui-button-disabled, and aui-button-submit class references with button-holder, button-disabled and keep this type of change throughout your warning make sure to add the.aui parent class reference in front of a classname if you're extending the styling of a class that bootstrap already styles. removal of the aui- prefix from all classes for details lastly, consider the changes done to the microblogs portlet's url file. the script now uses the liferay-util-window module in place of the old the upgrade tool took things a step further by updating so that the script properly uses the liferay-util-window module to get pop-up below are code snippets of what it like before and the microblogs portlet's url code before upgrading the microblogs portlet's url code after upgrading the liferay alloyui upgrade tool gives you a great jump-start on migrating your of course, you should review the upgrade changes and test the changes before redeploying your plugin into a production environment. and remember that the tool may not pick up all of the changes that need to be but you'll be happy that the tool does a good bit of the monotonous conversion work for you";;
|
image carousels are often the first thing people see when they visit sites. carousels provide an interactive way of cycling through visual elements and are an effective means of communicating information to users. aui-carousel module makes it very easy to get an image carousel up and running figure 1 image carousels can be a very handy tool to communicate information to users. here is an example of the carousel in a portlet now that you can see the appeal of adding a carousel to your design, it's time in order to get the carousel running in a portlet you have to do a few walk through each of these steps to get a carousel up and running in your create a location in your portlet to store your carousel's images and then copy for example, you could create a folder named img in your portlet's docroot folder and then put your image files in it create one if you don't already have one in your add a directive to reference the aui taglib add a element to reference all of the images that you want to within this, nest a for each of the make sure to assign a unique id to the outer element and each of the nested elements for example, the following html specifies an named mycarousel that holds references to an images named image1 and image2 which to display your images, you first add... tags within those tags, add code that instantiates the carousel, passing a reference to the outer as the value for carousel's for example, the following code creates a carousel for a named to create the carousel, you get the aui object to use the aui-carousel module to create a carousel component. carousel's contentbox, height, and width attributes the carousel that alloyui creates automatically adjusts to the number of images in the contentbox element, letting you add as many as images as you if you were to deploy your jsp's changes right now, however, no images would be this is because the display of the carousel's items is not configured and the carousel has no reference to the image files. you can use css to configure the items and map the image files to your jsp. next step shows you how to take care of these requirements this step's instructions demonstrate using css to configure the carousel's create a url file in your portlet's docrootcss folder, if it specify the dimensions and opacity to use for each carousel item's div. the following example css specifies basic width, height, and opacity information for the divs using a class named carousel-item. sure to keep the class names consistent between your jsp and the url if you wish, you can add more styling to the carousel items via the select the id of each of your jsp's image elements and apply a for example, if you have elements with ids image1 and image2, then you could map them to their respective image source files with code of course, you can style each image here as well now that you've written code to display your carousel, you can deploy your plugin and see your images in the carousel. give yourself a pat on the back. you've just successfully used the aui-carousel in your portlet! user interfaces with the liferay ui taglib using alloyui in your application;;
|
"this tutorial covers how to add the ability to move your app's entries to the figure 1 you can easily create a way to move your app's entries to the recycle bin here are the steps for implementing this recycle bin component start off by configuring the app's service for every entity you want to recycle bin-enable, you must enable the trash to do this, insert insert the trash-enabledtrue attribute inside your entities' tags in your url file. entity element should look similar to this one to generate back-end trash related classes for the entities you'll implement trash handlers for these entities next as with many other liferay frameworkssuch as the workflow, assets, and indexing frameworksyou must implement a handler class for recycle bin. recycle bin handler class manages moving entries to the recycle bin, viewing them in the recycle bin, restoring them, and permanently deleting them. interface for each trash-enabled entity. as a convenience, liferay provides the consider the following trashhandler methods as a minimal set of methods a trash handler must implement or override for example, the jukebox portlet's jukeboxbasetrashhandler class implements these methods and serves as a base implementation for the app's as an example trash handler implementation, you can refer to the songtrashhandler and its base class jukeboxbasetrashhandler after you've implemented trash handlers for your trash-enabled entities, specify the handlers in your app's url file. jukebox's song portlet specifies the song trash handler like this you can refer to the jukebox portlet's url file to see the trash handlers it specifies note a trash handler refers to an entity, not a portlet. can, therefore, be declared in any of a plugin's portlets. declare them in the app's principal portlet you have trash handlers ready to manage your trash entries, but you still need a way to get the entries to the recycle bin. you'll implement a local service method for moving them to the this service method must implement a trash service for the your -entitynamelocalserviceimpl class's trash method should look similar to the method movesongtotrash in jukebox portlet's songlocalserviceimpl notice that this method is annotated as. an entry is moved to the recycle bin, liferay re-indexes the entities and their this makes the trashed entries searchable only from the recycle bin, while regular entries aren't searchable outside of the recycle bin there's also a call to url.statusintrash, which sets the song's status, so that the workflow engine knows the song is in note that a portlet need not leverage workflow to implement the next, the asset's visibility is updated so that it no longer appears outside the its visibility is deactivated by the following call on first thought, this may seem a bit odd. why do you have to make the entry invisible in its original location? i thought i was moving it to the recycle bin? importantly, entries that are moved to the recycle bin are actually left in their original location; they're just not visible note if you're not using assets with your entity, you'll need to filter the elements in your ui by status, so it only shows approved entities. the updatevisible method only works on asset next, notice that the service method adds a new trash entry to the recycle bin lastly, the movesongtotrash service method invokes trashutil's gettrashtitle method to set the entry's trash title. the trash title is an alternative the trash title prevents duplicate entry name conflicts, discussed in the tutorial resolving recycling conflicts you must now provide the means of invoking the service method from your you implement this using a portlet action that you can trigger from and implements portlet action method deletesong to invoke the here's an abbreviated version of the deletesong note that the logic in the try block handles moving entries to the recycle bin and permanently deleting entries. you can write similar portlet action methods for deleting your app's entries now that you've written your portlet action class, you can use a jsp for example, the jukebox portlet's url implements buttons named move to the recycle bin and delete to trash or permanently delete a song notice this jsp code specifies the jukeboxportlet's deletesong action it also displays an appropriate button for recycling or deleting the entry, depending on whether the portlet class found the entity to be now that you laid all the ground work for moving your entries to the recycle bin, you're ready to set up the framework for rendering the trashed entries in you do this by implementing trash renderers for the in a similar way to creating a trash handler, you create a class to render trash if you're already using an asset renderer, you can reuse it, as long as it also implements the as an example of a combined asset renderer and trash renderer implementation, consider the jukebox portlet's songassetrenderer if you don't already have an asset renderer, you must create a trash renderer. in it, implement a gettrashrenderer method to instantiate and return a trash renderer based on the trash entry's primary key. the trash renderer from a trash handler, consider the gettrashrenderer method from the document library class dlfileshortcuttrashhandler it creates a new trash renderer class, dlfileshortcuttrashrenderer, based on the file shortcut instance. you now know how to implement moving your app's entries to the recycling assets with the recycle bin";;
|
this tutorial covers how to implement restoring entries from the recycle bin. you haven't yet implemented the framework for using the recycle bin in your moving entries to the recycle bin. once you can move entries to the recycle bin, you then want to be able to restore entries from the recycle bin. recycle bin if you can't restore its entries figure 1 by implementing the restore functionality, you can move entries out of the recycle bin and make them visible again in their original locations recycle bin entries are just pointers to the real entity. recycle an entity, its visibility is turned off, and a reference to the entity rash entries by first making their entities visible again and then removing the the entry restoration process is similar to the entry moving use these steps to restore an entry your first step is to create a service method for restoring the entry you'll create a service method that removes the trash entry from the recycle bin and makes the asset entry visible again in its original location as an example, the restoresongfromtrash service method from the jukebox class restores songs from the recycle bin first, the item's original name is restored with the help of trashutil's the entry's modified date is then set to the current next, the entry's status is updated by setting it to the original status from if the entry, for example, was originally a draft statusdraft , it's restored back to draft status. status by user id and by user name are updated to indicate the user that the status modification date is updated too in the following call, the asset entry is made visible in its original location lastly, the trash entry is deleted from the recycle bin at this point, the entry is restored and no longer resides in the recycle bin importantly, after writing your service method, make sure to generate the corresponding service interface and utility methods by running service builder to finish implementing the entry restoration process, invoke the service method from the entity's trash handler now that your service provides a method for restoring the entry, you must invoke it from the trash handler's restoretrashentry method. framework calls this method when a user clicks the trash entry's restore the following restoretrashentry method implementation is from the jukebox to restore a song from the recycle bin, jukebox users click the song's restore note sometimes, conflicts can occur when restoring entries. suppose you create a file with the same name of a file that you've trashed. although the file is in the recycle bin, it's still present in its original location, but with its status changed and visibility turned off. framework avoids these two files conflicting. resolution framework in the tutorial resolving recycling conflictsdocsrestutorials-knowledgebasetlution framework in the tutorial resolving recycling conflicts you now know how to provide the means for users to restore your app's entries recycling assets with the recycle bin;;
|
sometimes, users accidentally send the wrong entry to the recycle bin. seems kind of grueling to navigate away from your page to the recycle bin to restore the item, just to go back to where you originally started, right? for this reason, the recycle bin framework supports an undo button, so you can conveniently undo the action of sending an entry to the recycle bin without figure 1 implementing the undo button enables users to conveniently retrieve entries back from the recycle bin walk through the following steps to implement the undo functionality go ahead and implement the undo button and its related links! first, you must use the liferay-uitrash-undo tag in your jsp. to set a portlet action url and pass it to the liferay-uitrash-undo tag. this maps the tag's undo button to the portlet action that you'll implement in the tags you add to your jsp should look similar to these tags for restoring a now that you've added the tag and action url, go ahead and implement the portlet action to restore the entry you must create a portlet action method that invokes your service method to for example, the following portlet action method from the jukeboxportlet class restores songs from the recycle bin this method implements the restoresong action that was named in the the action url maps the liferay-uitrash-undo tag to this method note how it parses entry ids from the request object. entries by calling the restore service method are you wondering how this portlet action gets the ids of the entries to you'll learn how to pass this data to the session next the final step for implementing the undo button is to provide the trashed entry's information to the liferay-uitrash-undo tag. tag to display properly, you must provide some information for the session the session needs to know which entries were just deleted. restore method can use that information to restore the entries for example, the following if block from the jukeboxportlet's method deletesong populates the session with the entries that were just it gathers the elements needed to distinguish the entry instances to restore. for the jukebox song elements, the song's class name, title, and ids are then these elements are added to the session messages, so they appear in the in your portlet's delete action, you can similarly populate the session with the entry information of the entries being deleted. the undo functionality for your app's trash-enabled entities! recycling assets with the recycle bin;;
|
what happens if you need to trash a parent entity, such as a parent wiki page, or a web content folder full of articles? to and from the recycle bin is similar to moving non-parent entries albums, for example, in the jukebox portlet are parent entitiesthey aggregate songs. moverestore albums tofrom the recycle bin. this tutorial uses code from the jukebox portlet to demonstrate movingrestoring parent entities. translate the logic for your app's parent entities first, define each containerparent model as such in your app's services. this, open your app's url file and add the container-modeltrue attribute setting in the container entity's primary key column element for example, the jukebox portlet's url file marks the album entity as a container model in the following element on running service builder, it generates methods you can use to obtain each in the case of jukebox, the album entity has songs as service builder generates -model, -modelclp, and -modelimpl classes to implement the containermodel these implementations enable the recycle bin framework to identify and use these models as container models next, you'll handle the child entities because parent entities hold child entities, the child entities must be recycled if the parent entity is. you'll implement service methods both to recycle and to restore parent and child entities on moving a parent entry to the recycle bin, you must perform these actions on for example, look at how the method movedependentstotrash from albumlocalserviceimpl class handles moving an album's songs to the recycle bin. this method updates the entry's status, adds a trash version for it, turns off the visibility of its asset, and reindexes it for search purposes here's how the method implements this for the song entity update its status similar to updating the status for a single entry, the status of each album's song must reflect that the song has been moved to the the following code updates the song's status add a trash version for it when moving content with versions to the recycle bin, the trash version entity stores the status of those versions, so those statuses can be set back to their original values when the entity is when a parent entity with content is sent to the recycle bin, each element in that parent also generates a trash version. versions by navigating inside a trash entry. the trash version for the song turn off the visibility of its asset the song's visibility is turned off re-index it since the visibility of the song entity has been modified, the album's songs must be re-indexed so they're searchable. you'll be comforted to know that restoring a parent's child entities from the recycle bin involves similar steps. convenience method in the jukebox portlet's albumlocalserviceimpl class, for example, demonstrates these steps. as a summary, here's what you do restoring entities placed in the trash is straightforward when done in the service classes for your app's parent entities as a developer, you only need to tell the portal that the parent entity has children and how to obtain them. the recycle bin ui automatically accounts for you've learned how to designate parent models as container model entities in your service definition. you've provided a means to trashrestore a parent's child entities when trashingrestoring that parent, and you've learned how the recycle bin ui lets you work with a parent's child entities recycling assets with the recycle bin;;
|
"the conflict resolution framework helps liferay users identify and solve the most common conflict for the recycle bin is for instance, say you create a file called url in a then you decide you should delete it, because you already have that file on your file system, so you recycle it and upload the you would get a naming conflict because, although url has a recycle bin entry, it's actually still in the original folder but with its status changed and its visibility turned off this tutorial covers how to implement the conflict resolution framework so you note that you're on your own when it comes to conflicts outside the recycle bin. follow these steps and you'll be resolving conflicts in no time! entities are never actually created in the recycle bin. entity is kept in its original location and a trash entry that points to it is when viewing the entry in the recycle bin, the name appears the same as it does in the original entry. way to distinguish between the recycled pointer and the real entity, which can this requires adding logic to your entity's service and leveraging trash utilities to generate new names for recycle bin entries when an entry is sent to the recycle bin, it's still in its original location, but with a different status. users may create an entity with a name, move it to the recycle bin, and then create another entity with the same name. since both entities are in the same place, a naming conflict could occur. applications only allow one entity to have a particular property value; for example, names for documents, titles for songs in an album, friendly urls for pages, etc. on moving an entity to the recycle bin, you must rename properties for example liferay's jukebox portlet uses a unicodeproperties instance to store a mapping of each song's title the mapping is stored with the trash entry. url.getentryid is invoked from songlocalserviceimpl's movesongtotrash method to set the name of the original entity. song is renamed to a unique value that can be used to look up the trash entry url.getentryid resets the name of the original entity to a unique valuea slash followed by the trash entry's id. since the entity is now in the recycle bin, it's hidden from view in its original location; so users never see this mane. unique names generated by url... are used to get the names of the original entities when restoring those entities figure 1 the recycle bin allows you to manage trash entries, even if they share the same name next, you'll see how to restore a trashed entity's original name in your restore since recycled entities are renamed, you need to retrieve the original name when the code snippet below, from the jukebox portlet's restoresongfromtrashlong userid, long songid method in demonstrates how to retrieve the song's old name to restore it the original entity is retrieved by its id. url method is called to look up the entity's remember that the entity's current name is based on the trash trashutil's gettrashtitle method looks up the trash entry and returns the title value the song's original name, in this case previously mapped in the entry's type settings properties. lastly, whether an entity is in the recycle bin or not, you should always render an entity with its original name. as an example of rendering a song's original title based on a locale, the jukebox portlet's songassetrenderer if the song isn't in the recycle bin, the song's current name is returned. otherwise, the method invokes url.getname to return the song's original name next, you need to finish satisfying the interface contract, and completely implement the conflicts resolution functionality your app can now rename entries when they're removed and reinstate their original what happens when the original entry is restored to its original location, and a new entry with the same name also is there? naming conflict that needs to be resolved by the user the recycle bin framework provides a ui for users to decide whether to overwrite the existing entry or to keep both entries by renaming the title of the entry the figure below shows a conflict resolution pop-up that's displayed in the jukebox portlet on trying to restore a song for which an identically named song is already present figure 2 the recycle bin enables you to handle conflicts by notifying the user with a pop-up message and options for solving the problem. clearly, if you recycled kashmir, someone may have tried to fix that both by re-uploading it and by restoring it two methods need to be implemented in the trash handler to allow for the the first method must check for duplicate trash if an entry with the same name is detected in a directory, it must to learn how to do this, you can reference the checkduplicatetrashentry method from here's the code from that method lastly, implement a method that updates the entry title name. jukebox portlet updates a song title by calling this updatetitle method this method is also from the songtrashhandler it is called when the entry you're restoring needs its title renamed to resolve a conflict with a preexisting entry that has the same name. implementing these methods, your app's users should always be able to resolve naming conflicts involving trashed entries by leveraging the conflicts resolution framework in your app, you're able to provide a smarter recycle bin that handles potential conflicts with recycling assets with the recycle bin";;
|
liferay's message bus is a service level api that components can use to send it provides loose coupling between message producers and the message bus is located in liferay's global class loader, making it accessible to every deployed web application. supported, but messages are sent across a cluster when clusterlink is enabled here are a few common uses of the message bus you can leverage the message bus to send messages between and within your as you read through the message bus tutorials, you'll learn about synchronous and asynchronous messaging, serial vs. in-parallel message dispatching, and how to style message formats before you get into those topics, you should first learn about the message bus developing with the plugins sdk developing plugins with liferay ide;;
|
liferay's message bus system is a great way to handle communication both between and within your applications. however, before you get started with message bus, you should know the basics of how it's structured. presents information on the components of the message bus system, as well as the different types of messages that can be sent. 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 the message bus can be configured via 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 using either the liferay core services are typically serialized and deserialized in json. both types of message classes are used in the following tutorials to show you how to implement both synchronous and developing with the plugins sdk developing plugins with liferay ide;;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.