Monday, April 2, 2012

Calendar in Liferay




false EN-US X-NONE X-NONE Calendar Control in Liferay


1. This portlet is defined in /portal-web/docroot/WEB-INF/portlet.xml.
<portlet>
<portlet-name>8</portlet-name>
<display-name>Calendar</display-name>
<portlet-class>com.liferay.portlet.JSPPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/portlet/calendar/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>Power User</role-name>
</security-role-ref>
<security-role-ref>
<role-name>User</role-name>
</security-role-ref>
</portlet>
The unique id associated with this portlet is 8. The JSPPortlet class extends javax.portlet.GenericPortlet. The
source of this class shows that this class looks for the init parameters and forwards to the appropriate JSP depending on the portlet mode. This portlet is viewable by HTML browsers. Users must have either the Power
User or User role to access this portlet. The roles can be changed at run time via the Admin portlet.
2. The title is fetched by StrutsResourceBundle and is configured in /
portal-ejb/classes/content/Language.properties.
javax.portlet.title.8=Calendar
3. Additional definitions for this portlet are found in /portal-web/docroot/WEB-INF/liferay-portlet.xml.
<portlet
id="8"
struts-path="calendar"
scheduler-class="com.liferay.portlet.calendar.job.Scheduler"
preferences-sharing-type="user"
show-portlet-access-denied="true"
show-portlet-inactive="true"
</
The id value in liferay-portlet.xml must match the portlet-name value in portlet.xml. The struts-path value tells
Struts that all requests starting with http://localhost/c/calendar/* are considered part of this portlet's scope. See
the Mail portlet to better understand this feature. The scheduler-class value must be a class that implements
Scheduler and is called to schedule Quartz jobs for this portlet. The preferences-sharing-type value indicates
the preferences sharing type of the portlet. If set to none, preferences are not shared and each page will have its
own set of preferences. If set to user, preferences are shared by user if the portlet is in a personal page or by
group if the portlet is in a group page. If set to company, preferences are shared across the entire company. The
show-portlet-access-denied value, if set to true, means non-permissioned users are shown that they do not have
access to the portlet. The default value is set in portal.properties. The show-portlet-inactive value, if set to true,
means users are shown that the portlet is inactive (if the portlet is inactive). The default value is set in
portal.properties

4. Display information for this portlet is found in /portal-web/docroot/WEB-INF/liferay-display.xml and makes it
possible for users to add this portlet via the personalize pages screen.
<category name="category.community">
...
<portlet id="8" />
...
</category>
When a user goes to personalize pages and clicks on a category to choose a portlet, the Calendar portlet is
available under the category with the name that matches the key category.community. The value for this key is
defined in /portal-ejb/classes/content/Language.properties.
category.community=Community
 

0 comments:

Post a Comment