By default, a portlet can have only one page, and if you need more than one portlet on a page, you need to instantiate the portlet. After instantiation, Liferay assigns to each instantiated portlet a instance ID to differentiate the same functionality. The instance IDs of multiple identical portlets in a page are different, and the same portlet's instance ID is not the same for different pages. This makes it possible to develop implementations with th
Liferay's own database is very mini, generally is to play.In the real development process, we often need to connect it to our local database.There are 3 ways, and I'm just going to introduce my favorite method here. Even MySQL.1. Create the portal-ext.properties file in the root directory of the Liferay portal, where the contents are Jdbc. default. driverclassname=com.mysql.jdbc.Driver jdbc. default. Url=jdbc:mysql://Localhost/lportal?useunicode
Brief introduction:
It is well known that cross-domain problems are a very common requirement, such as having a client's EXT-JS control render a JSON object from the server side. We can solve them in many ways, such as JSONP. However, in Liferay, we can use the Serveresource method to gracefully resolve Cross-domain access issues.
Whiteboard Analysis:
Here is the whiteboard on the technical symposium:
Workaround:
First write a Serveresource met
In Liferay, if you can use good portletpreferences then it will be very powerful:
Brief introduction:
Portletpreferences is a combination of a set of information related to the current user, and we can allow a logged on user to share data through this portletpreferences on different pages of a portlet, at different stages, Without having to worry about other users stealing the data. The benefit of using this shared data is that it does not require s
Recently our team asked Liferay to do the front page tuning, of course, the evaluation tool is the most important, in order to see the specific page loading time and so on, our first choice of course is the Chrome Browser diagnostics tool, but the total feeling is not professional, based on my experience, I still recommend YSlow, it The index of the page will be graded, and then finally get the total score then rating, General level has A,B,C,D,E,F6 l
In the Liferay Control Panel, when you click the search user in the user panel:
The requests sent to the server are as follows:
Based on the configuration in Struts-config.xml, we find forward that match struts-action to/user_admin/view_users:
Then go to tiles-def.xml and find the page that matches forward for Portlet.users_admin.view:
So, we found the page is/portlet/users_admin/view.jsp:
In the/portal-master/portal-web/docroot/html/portlet/dockbar/add_panel.jsp fileThe following will be included:if (hasaddcontentandapplicationspermission) { "content,applications");} if (haslayoutaddpermission) { "page");}Modified to:if (hasaddcontentandapplicationspermission) { "applications");} if (haslayoutaddpermission) { "page");}Remove the following content:"/html/portlet/dockbar/add_ content.jsp" /> Liferay 6.2 Retrofit Series Three
1. A single JSP file is directly suffixed with. jsp; a JSP file containing multiple JSP files is suffixed with. jspf.
2. Use single quotes in JS files
Confirm ('
3. Use the field set to wrap the input box
4. Use the built-in liferay Separator
1. Cancel the display of the above dockbar
This is the default code in the liferay topic, that is, all login users will display this control bar.
Dockbar is the top column.
#if ($is_signed_in) #dockbar()#end
Change to the following:
#if (($is_signed_in) $permissionChecker.isCompanyAdmin($company_id)) #dockbar()#end
Non-admin users will not be displayed
Ii. Access prohibited
You can still access the Control Panel through this connection:
Http: // lo
Now let's make a summary:
In fact, in order to have a better user experience, we have optimized from all aspects:
The resource itself is cropped in size:
For CSS,JS resources, we compress them with yui-compressor.
For image resources, we use the Sprite tool bar multiple small pictures merged into large single pictures
The cost of resources being downloaded from the server to the client is reduced:
We have enabled the filtering of gzip filter on the server so that all the resources are comp
In Liferay, if we want to use our own JS library (such as the EXT-JS Library) instead of the default AUI library, you can follow these steps:
(1) Place the library file
We go to the $liferay_home/tomcat-7.0.23/webapps/root/html/js directory to build a directory called ExtJS, and then copy ext-all.js into.
(2) Create the portal-ext.properties in the $liferay_home directory and then from the portal.properties in the Portal-impl.jar package Javascri
The Liferay SDK has the following directory structure:
clients/is the directory for the client plug-in and provides an ant script to create the client plug-in
dist/This directory holds the archive applications for deployment and release. For example, the last time we wrote 2 portlets, here are 2 corresponding applications:
ext/is the directory of the Ext plugin and provides an ant script to create the EXT plug-in
hooks/is the directory of the
DockBar is the most active element in Liferay, because almost all of the user's operations start from the DockBar, so we're here to analyze the DockBar in depth.
Structure of the DockBar:
DockBar is divided into 2 parts from the whole, part is the left
The other part is the right
So the final DockBar structure is (I omitted a lot of code):
Conclusion:
Theme Upload logo will do the following things:
(1) Using Uploadportletrequest object to handle the
(2) for the uploaded logo picture is empty, then throw an exception.
(3) for the upload of the logo picture is not empty, the first from the database to find the current layout, for logo definition logoid, and bar logoid add to the current layout and then back to the database, and then set according to the Boolean variable to determine whether it is the logo associated to the hook
After learning the ant build theme, Liferay theme, we easily ported the theme project to Maven. The following are the specific steps:
Assume:
Because we used the http://supercharles888.blog.51cto.com/609344/890525 development structure as shown in the article, let's assume we put the theme we're developing in D:\WalmartProject.
First: Let's use the Maven Theme Wizard to create a theme:
Once created, because we want our pom.xml to inherit Father
. Servicecomponentlocalserviceimpl.java is the core of the class, if you carefully study the code of this class will have other gains, here is only one example: you can see that this class actually supports the operation of upgrading the database, As long as the previous tablesql and the new TAblesql inconsistent, will perform the upgrade database operations, according to our thinking, we deployed two times the tables.sql is inconsistent, why not execute this code? Debugging finds that the Table
The liferay page can be implemented using a search container tag, which is very convenient.
HTML \ juneidongtaiportlet \ list_dongtai.jsp
HTML \ base \ init. jsp
/** * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation
Unconsciously, I have been in the United States for more than two months. In the face of over 120 hours of work per Sprint, I have no energy to maintain my blog, so it is not updated in 2 months. Now, on Labor Day in the United States, let's take a look at my learning experience during this time.
This topic describes how to use the tarball distribution package to automate Liferay installation and deployment.
Purpose:
As we all know, the process of d
We see this article is not very happy ah, I feel is very happy, we can finally follow their own wishes to write a code, in Liferay some basic additions and deletions of the code is automatically generated, but we want to achieve their own method, I am afraid that a little effort, You have to know that every technology is necessary to study and learning, not always feel that the automatic generation of things do not have any good research, in fact, you
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.