gatein SVN: r982 - in portal/trunk/docs/reference-guide/en/modules: configuration and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 12:56:51 -0500 (Wed, 09 Dec 2009)
New Revision: 982
Removed:
portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml
Modified:
portal/trunk/docs/reference-guide/en/modules/Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml
Log:
More cleanup/fix
Modified: portal/trunk/docs/reference-guide/en/modules/Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,38 +2,19 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<chapter id="chap-Reference_Guide-Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Configuration</title>
+ <title>Configuration</title>
<xi:include href="configuration/IDM_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Default_Portal_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Portal_Navigation_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Predefined_User_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="configuration/User_Workspace_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Portal_Default_Permission_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!-- Kernel/Service_Configuration_for_Beginners --><!-- Kernel/Service_Configuration_in_Detail --><xi:include href="configuration/Database_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- Kernel/Service_Configuration_for_Beginners --><!-- Kernel/Service_Configuration_in_Detail -->
+ <xi:include href="configuration/Database_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Data_Injector_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!-- Core/LDAP_Configuration --><xi:include href="configuration/Skin_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- Core/LDAP_Configuration -->
+ <xi:include href="configuration/Skin_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/JavaScript_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Dashboard_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="configuration/Authentication_Token_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="configuration/Varnish_Configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,120 +2,129 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Authentication_Token_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Authentication Token Configuration</title>
- <section id="sect-Reference_Guide-Authentication_Token_Configuration-Overview">
- <title>Overview</title>
- <para>
- In this article, you will learn:
+ <title>Authentication Token Configuration</title>
+ <section
+ id="sect-Reference_Guide-Authentication_Token_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn:
</para>
- <itemizedlist>
- <listitem>
- <para>
- What token services are.
+ <itemizedlist>
+ <listitem>
+ <para>
+ What token services are.
</para>
- </listitem>
- <listitem>
- <para>
- Implement a token service for using in GateIn portal.
+ </listitem>
+ <listitem>
+ <para>
+ Implement a token service for using in GateIn portal.
</para>
- </listitem>
- <listitem>
- <para>
- Configure a token service with a token's life-time.
+ </listitem>
+ <listitem>
+ <para>
+ Configure a token service with a token's life-time.
</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Authentication_Token_Configuration-What_is_token_service">
- <title>What is token service</title>
- <para>
- Token service is used in authentication.
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Authentication_Token_Configuration-What_is_token_service">
+ <title>What is token service</title>
+ <para>
+ Token service is used in authentication.
</para>
- <para>
- Using token helps preventing information such as user name, password into user request so the system will become more secure.
+ <para>
+ Using token helps preventing information such as user name, password into
+ user request so the system will become more secure.
</para>
- <para>
- Token service provides the way to manipulate tokens such as create, delete, retrieve, clean ... Token service also defines the life-time of token. After the life-time, token has no more effect. The life-time definition must be configured.
+ <para>
+ Token service provides the way to manipulate tokens such as create,
+ delete, retrieve, clean ... Token service also defines the
+ life-time of token. After the life-time, token has no more
+ effect. The life-time definition must be configured.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Authentication_Token_Configuration-Implement_token_services_API">
- <title>Implement token service's API</title>
- <para>
- All token services used in GateIn portal's authentication must be a subclass of an abstract class <emphasis role="bold">AbstractTokenService</emphasis> . So they must have these following methods:
- </para>
-
-<programlisting>
- public Token getToken(String id) throws PathNotFoundException,
- RepositoryException;
- public Token deleteToken(String id) throws PathNotFoundException,
- RepositoryException;
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Authentication_Token_Configuration-Implement_token_services_API">
+ <title>Implement token service's API</title>
+ <para>
+ All token services used in GateIn portal's authentication must
+ be a subclass of an abstract class
+ <emphasis role="bold">AbstractTokenService</emphasis>
+ . So they must have these following methods:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[
+ public Token getToken(String id) throws PathNotFoundException, RepositoryException;
+ public Token deleteToken(String id) throws PathNotFoundException, RepositoryException;
public String[] getAllTokens();
public long getNumberTokens() throws Exception;
- public String createToken(Credentials credentials) throws
- IllegalArgumentException,NullPointerException;
- public Credentials validateToken(String tokenKey, boolean remove) throws
- NullPointerException;
-</programlisting>
- <para>
- These methods show how the token-service manipulates its tokens.
+ public String createToken(Credentials credentials) throws IllegalArgumentException,NullPointerException;
+ public Credentials validateToken(String tokenKey, boolean remove) throws NullPointerException;
+]]></programlisting>
+ <para>
+ These methods show how the token-service manipulates its tokens.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Authentication_Token_Configuration-Configure_token_services">
- <title>Configure token services</title>
- <para>
- Token services configuration is also known as specifying the life-time of token in the configuration file. The token service is configured as a portal component.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Authentication_Token_Configuration-Configure_token_services">
+ <title>Configure token services</title>
+ <para>
+ Token services configuration is also known as specifying the life-time of
+ token in the configuration file. The token service is
+ configured as a portal component.
</para>
- <para>
- Examples:
+ <para>
+ Examples:
</para>
-
-<programlisting>
-<component>
- <key>org.exoplatform.web.security.security.CookieTokenService</key>
- <type>org.exoplatform.web.security.security.CookieTokenService</type>
- <init-params>
- <values-param>
- <name>tokenTimeout</name>
- <value>jcr-token</value>
- <value>7</value>
- <value>DAY</value>
- </values-param>
- </init-params>
-</component>
-</programlisting>
- <para>
- In this example, <emphasis>CookieTokenService</emphasis> is a subclass of <emphasis role="bold">AbstractTokenService</emphasis> so it has a property which specifies <emphasis>how long token can live</emphasis>.
- </para>
- <para>
- Service will initiate this property by looking for an init-param named as "<emphasis role="bold">service.configuration</emphasis>". This property must have 3 values (service's name, amount of time, unit of time). In this case, we can see the service's name is "jcr-token", the token's expiration time is a week.
- </para>
- <para>
- At this time, GateIn Portal supports <emphasis>four</emphasis> timing units: <emphasis role="bold">SECOND</emphasis>, <emphasis role="bold">MINUTE</emphasis>, <emphasis role="bold">HOUR</emphasis> and <emphasis role="bold">DAY</emphasis>.
- </para>
- </section>
+ <programlisting role="XML"><![CDATA[<component>
+ <key>org.exoplatform.web.security.security.CookieTokenService</key>
+ <type>org.exoplatform.web.security.security.CookieTokenService</type>
+ <init-params>
+ <values-param>
+ <name>tokenTimeout</name>
+ <value>jcr-token</value>
+ <value>7</value>
+ <value>DAY</value>
+ </values-param>
+ </init-params>
+</component>]]></programlisting>
+ <para>
+ In this example,
+ <emphasis>CookieTokenService</emphasis>
+ is a subclass of
+ <emphasis role="bold">AbstractTokenService</emphasis>
+ so it has a property which specifies
+ <emphasis>how long token can live</emphasis>
+ .
+ </para>
+ <para>
+ Service will initiate this property by looking for an
+ init-param named as "
+ <emphasis role="bold">service.configuration</emphasis>
+ ". This property must have 3 values (service's name, amount of
+ time, unit of time). In this case, we can see the service's
+ name is "jcr-token", the token's expiration time is a week.
+ </para>
+ <para>
+ At this time, GateIn Portal supports
+ <emphasis>four</emphasis>
+ timing units:
+ <emphasis role="bold">SECOND</emphasis>
+ ,
+ <emphasis role="bold">MINUTE</emphasis>
+ ,
+ <emphasis role="bold">HOUR</emphasis>
+ and
+ <emphasis role="bold">DAY</emphasis>
+ .
+ </para>
+ </section>
+
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,65 +2,50 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Dashboard_configuration">
- <!--
+ <title>Dashboard configuration</title>
+ <section
+ id="sect-Reference_Guide-Dashboard_configuration-Parameters_in_edit_mode">
+ <title>Parameters (in edit mode)</title>
- Copyright (C) 2009 eXo Platform SAS. This 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;
- either version 2.1 of the License, or (at your option) any later
- version. This software is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. You should have
- received a copy of the GNU Lesser General Public License along with
- this software; if not, write to the Free Software Foundation, Inc., 51
- Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- site: http://www.fsf.org.
- --><title>Dashboard configuration</title>
- <section id="sect-Reference_Guide-Dashboard_configuration-Parameters_in_edit_mode">
- <title>Parameters (in edit mode)</title>
- <para>
- Stuff Goes Here?
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Dashboard_configuration-owner">
- <title>owner</title>
- <itemizedlist>
- <listitem>
- <para>
- if empty, everyone share the same dashboard and can edit it
+ <section id="sect-Reference_Guide-Dashboard_configuration-owner">
+ <title>owner</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ if empty, everyone share the same dashboard and can edit it
</para>
- </listitem>
- <listitem>
- <para>
- if set to <emphasis>CURRENTUSER</emphasis> , every user has his own dashboard
+ </listitem>
+ <listitem>
+ <para>
+ if set to
+ <emphasis>CURRENTUSER</emphasis>
+ , every user has his own dashboard
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if set to a username, everyone will see the dashboard of this person
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Dashboard_configuration-isPrivate">
+ <title>isPrivate</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ if set to 1, only the owner of the dashboard can edit it
</para>
- </listitem>
- <listitem>
- <para>
- if set to a username, everyone will see the dashboard of this person
+ </listitem>
+ <listitem>
+ <para>
+ if set to 0, everyone can edit it
</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Dashboard_configuration-isPrivate">
- <title>isPrivate</title>
- <itemizedlist>
- <listitem>
- <para>
- if set to 1, only the owner of the dashboard can edit it
- </para>
- </listitem>
- <listitem>
- <para>
- if set to 0, everyone can edit it
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,188 +2,210 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Data_Injector_Configuration">
- <!--
+ <title>Data Injector Configuration</title>
+ <section
+ id="sect-Reference_Guide-Data_Injector_Configuration-Data_Injector">
+ <title>Data Injector</title>
+ <para>
+ <emphasis>Data-injector</emphasis>
+ is an utility to initialize enterprise data for Portal. It is
+ packed as a .jar.
+<!--
+ and deployed under $TOMCATHOME/lib. It is started
+ automatically when Tomcat starts.
+ -->
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ </para>
+ </section>
- --> <title>Data Injector Configuration</title>
- <section id="sect-Reference_Guide-Data_Injector_Configuration-Data_Injector">
- <title>Data Injector</title>
- <para>
- <emphasis>Data-injector</emphasis> is an utility to initialize enterprise data for Portal. It is packed in a .jar and deployed under $TOMCATHOME/lib. It is started automatically when Tomcat starts.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Data_Injector_Configuration-OrganizationInitializer">
- <title>OrganizationInitializer</title>
- <para>
- <emphasis>OrganizationInitializer</emphasis> is the service that allows creating a large organization with many groups and users. It also creates portal navigation and page(s) for each group, each user.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Data_Injector_Configuration-Service_configuration_file">
- <title>Service configuration file</title>
-
-<programlisting>
-<configuration>
- <component>
- <key>org.exoplatform.portal.initializer.organization.OrganizationInitializer</key>
- <type>org.exoplatform.portal.initializer.organization.OrganizationInitializer</type>
- <init-params>
- <value-param>
- <name>auto.create.group.page.navigation</name>
- <description>true or false</description>
- <value>true</value>
- </value-param>
+ <section
+ id="sect-Reference_Guide-Data_Injector_Configuration-OrganizationInitializer">
+ <title>OrganizationInitializer</title>
+ <para>
+ <emphasis>OrganizationInitializer</emphasis>
+ is the service that allows creating a large organization with
+ many groups and users. It also creates portal navigation and
+ page(s) for each group, each user.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Data_Injector_Configuration-Service_configuration_file">
+ <title>Service configuration file</title>
+
+ <programlisting role="XML"><![CDATA[<configuration>
+ <component>
+ <key>org.exoplatform.portal.initializer.organization.OrganizationInitializer</key>
+ <type>org.exoplatform.portal.initializer.organization.OrganizationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>auto.create.group.page.navigation</name>
+ <description>true or false</description>
+ <value>true</value>
+ </value-param>
- <value-param>
- <name>auto.create.user.page.navigation</name>
- <description>number of pages per user</description>
- <value>10</value>
- </value-param>
- <object-param>
- <name>organization</name>
- <description>description</description>
- <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig"> <field name="groups">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig$GroupsConfig"> <field name="group">
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>province</string></field>
- <field name="parentId"><string>/africa/tanzania</string></field>
- <field name="description"><string>Tanzania's province</string></field>
- <field name="label"><string>Province</string></field>
- </object>
- </field>
- <field name="from"><string>1</string></field>
- <field name="to"><string>10</string></field>
- </object>
- </value>
- </collection>
- </field>
- <field name="users">
- <collection type="java.util.ArrayList">
-
- <value>
- <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig$UsersConfig">
- <field name="user">
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>user</string></field>
- <field name="password"><string>GateInPlatform</string></field>
- <field name="firstName"><string>First-Name</string></field>
- <field name="lastName"><string>Last-Name</string></field>
- <field name="email"><string>exo@localhost</string></field>
- <field name="groups"><string>member:/africa</string></field>
- </object>
- </field>
- <field name="from"><string>0</string></field>
- <field name="to"><string>9</string></field>
- </object>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component>
-
-</configuration>
-</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_Group">
- <title>Parameters for Group</title>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>name</emphasis>: The name of group.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>parentId</emphasis>: The id of parent group. If the parent id is null, it means that the group is at the first level. If parent groups do not exist, it will be created automatically.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>description</emphasis>: The description of group.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>label</emphasis>: The label of group.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>from and to</emphasis>: This group can be cloned to may copies and each copy is marked a number from!images/number.png!images/ to!images/ number.png!.
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_User">
- <title>Parameters for User</title>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>userName</emphasis>: The ID of user.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>password</emphasis>: The password of user.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>firstName</emphasis>: The first name of user.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>lastName</emphasis>: The last name of user.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>email</emphasis>: The email of user.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>groups</emphasis>: The list of groups that user join with membership type
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>from and to</emphasis>: This user can be cloned to may copies and each copy is marked a number from!images/number.png!images/ to!images/ number.png!. With this configuration we can create a range of users and put them to various groups and other range to other groups.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The " <emphasis>auto.create.group.page.navigation</emphasis> " Parameter Value is true or false. If TRUE it automatically create portal navigation and page for each group. If FALSE it does not create portal navigation and page for each group.
- </para>
- <para>
- The "<emphasis>auto.create.user.page.navigation</emphasis> " Parameter Value is number of pages that automatically created for each user.
- </para>
- </section>
+ <value-param>
+ <name>auto.create.user.page.navigation</name>
+ <description>number of pages per user</description>
+ <value>10</value>
+ </value-param>
+
+ <object-param>
+ <name>organization</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig">
+ <field name="groups">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig$GroupsConfig">
+ <field name="group">
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>province</string></field>
+ <field name="parentId"><string>/africa/tanzania</string></field>
+ <field name="description"><string>Tanzania's province</string></field>
+ <field name="label"><string>Province</string></field>
+ </object>
+ </field>
+ <field name="from"><string>1</string></field>
+ <field name="to"><string>10</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="users">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.portal.initializer.organization.OrganizationConfig$UsersConfig">
+ <field name="user">
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>user</string></field>
+ <field name="password"><string>GateInPlatform</string></field>
+ <field name="firstName"><string>First-Name</string></field>
+ <field name="lastName"><string>Last-Name</string></field>
+ <field name="email"><string>exo@localhost</string></field>
+ <field name="groups"><string>member:/africa</string></field>
+ </object>
+ </field>
+ <field name="from"><string>0</string></field>
+ <field name="to"><string>9</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>]]></programlisting>
+ </section>
+ <section
+ id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_Group">
+ <title>Parameters for Group</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>
+ : The name of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>parentId</emphasis>
+ : The id of parent group. If the parent id is null, it
+ means that the group is at the first level. If parent
+ groups do not exist, it will be created automatically.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>description</emphasis>
+ : The description of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>label</emphasis>
+ : The label of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>from and to</emphasis>
+ : This group can be cloned to may copies and each copy is
+ marked a number from!images/number.png!images/ to!images/
+ number.png!.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_User">
+ <title>Parameters for User</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>userName</emphasis>
+ : The ID of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>password</emphasis>
+ : The password of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>firstName</emphasis>
+ : The first name of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>lastName</emphasis>
+ : The last name of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>email</emphasis>
+ : The email of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>groups</emphasis>
+ : The list of groups that user join with membership type
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>from and to</emphasis>
+ : This user can be cloned to may copies and each copy is
+ marked a number from!images/number.png!images/ to!images/
+ number.png!. With this configuration we can create a
+ range of users and put them to various groups and other
+ range to other groups.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The "
+ <emphasis>auto.create.group.page.navigation</emphasis>
+ " Parameter Value is true or false. If TRUE it automatically
+ create portal navigation and page for each group. If FALSE it
+ does not create portal navigation and page for each group.
+ </para>
+ <para>
+ The "
+ <emphasis>auto.create.user.page.navigation</emphasis>
+ " Parameter Value is number of pages that automatically created
+ for each user.
+ </para>
+ </section>
+
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,199 +2,211 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Database_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Database Configuration</title>
- <section id="sect-Reference_Guide-Database_Configuration-Overview">
- <title>Overview</title>
- <para>
- GateIn Portal has two different database dependencies. One is the Hibernate service configuration, which depends on the the Hibernate and c3p0 projects. The other database dependency is Java content repository (JCR) service, which depends on the native JDBC API and it can integrate with any existing datasource implementation.
+ <title>Database Configuration</title>
+ <section id="sect-Reference_Guide-Database_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ GateIn Portal has two different database dependencies. One is the Hibernate
+ service configuration, which depends on the the Hibernate and
+ c3p0 projects. The other database dependency is Java content
+ repository (JCR) service, which depends on the native JDBC API
+ and it can integrate with any existing datasource
+ implementation.
</para>
- <para>
- When you change the database configuration for the first time, GateIn will automatically generate the proper schema (assuming that the database user has the appropriate permissions).
+ <para>
+ When you change the database configuration for the first time, GateIn
+ will automatically generate the proper schema (assuming that
+ the database user has the appropriate permissions).
</para>
- <para>
- Currently (as of GateIn r23239 or GateIn Portal 2.5 and later), GateIn assumes the default encoding for your database is <code>latin1</code>. You will need to change this parameter for your database in order to work properly.
+ <para>
+ GateIn assumes the default encoding for your database is
+ <literal>latin1</literal>
+ . You will need to change this parameter for your database in
+ order to work properly.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Database_Configuration-DB_and_datasource_configuration">
+ <title>DB and datasource configuration</title>
+ <para>
+ You can find the database configuration in the
+ portal/WEB-INF/conf/database/database-configuration.xml file
+ (located in your application server's web application
+ directory).
</para>
- </section>
-
- <section id="sect-Reference_Guide-Database_Configuration-DB_and_datasource_configuration">
- <title>DB and datasource configuration</title>
- <para>
- You can find the database configuration in the portal/WEB-INF/conf/database/database-configuration.xml file (located in your application server's web application directory).
- </para>
-
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<configuration>
+
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<configuration>
[...]
- <component>
- <key>org.exoplatform.services.database.HibernateService</key>
- <jmx-name>database:type=HibernateService</jmx-name>
- <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
- <init-params>
- <properties-param>
- <name>hibernate.properties</name>
- <description>Default Hibernate Service</description>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
- </init-params>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcexo</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
[...]
-</configuration>
-</programlisting>
- <para>
- The first component configuration is for the Hibernate service. You can enter any additional properties in a hibernate.properties file, but GateIn will override hibernate.properties with values read in from this configuration file.
+</configuration>]]></programlisting>
+ <para>
+ The first component configuration is for the Hibernate service. You can
+ enter any additional properties in a hibernate.properties file,
+ but GateIn will override hibernate.properties with values read
+ in from this configuration file.
</para>
- <para>
- The second component configuration is for the JCR datasource. The InitialContextInitializer component will load the factory class, use the factory object to create a datasource, and bind that datasource in the JNDI tree with the value of the "bind-name" parameter. If you want to change the bind-name, for example "jdbcexo" to "myjdbc", you also need to change JCR repository configuration in order that the service picks up the right datasource.
+ <para>
+ The second component configuration is for the JCR datasource. The
+ InitialContextInitializer component will load the factory
+ class, use the factory object to create a datasource, and bind
+ that datasource in the JNDI tree with the value of the
+ "bind-name" parameter. If you want to change the bind-name, for
+ example "jdbcexo" to "myjdbc", you also need to change JCR
+ repository configuration in order that the service picks up the
+ right datasource.
</para>
- <para>
- Make sure you update the database connection properties and dialect for both of these component configurations.
+ <para>
+ Make sure you update the database connection properties and dialect for
+ both of these component configurations.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Database_Configuration-JCR_database_configuration">
- <title>JCR database configuration</title>
- <para>
- There are two JCR configuration files that must be changed to support a different database. In both files, <emphasis role="bold">edit the dialect (and the data source name if necessary)</emphasis>.
- </para>
- <para>
- The first file is portal/WEB-INF/conf/jcr/jcr-configuration.xml:
- </para>
-
-<programlisting>[...]
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>war:/conf/jcr/repository-configuration.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="persisterClassName" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- <property name="sourceName" value="jdbcexo"/>
- <property name="dialect" value="hsqldb"/>
- </properties-param>
- </init-params>
- </component>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Database_Configuration-JCR_database_configuration">
+ <title>JCR database configuration</title>
+ <para>
+ There are two JCR configuration files that must be changed to
+ support a different database. In both files,
+ <emphasis role="bold">edit the dialect (and the data source
+ name if necessary)</emphasis>
+ .
+ </para>
+ <para>
+ The first file is
+ <filename>02portal.war:/WEB-INF/conf/jcr/jcr-configuration.xml</filename>
+ :
+ </para>
+
+ <programlisting><![CDATA[[...]
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persisterClassName" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="sourceName" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+[...]]]></programlisting>
+ <para>
+ The second file is
+ <filename>02portal.war:/WEB-INF/conf/jcr/repository-configuration.xml</filename>
+ :
+ </para>
+
+ <programlisting role="XML"> <![CDATA[...]
+ <workspaces>
+ <workspace name="system" auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName" value="jdbcexo"/>
+ <property name="dialect" value="hsql"/>
+ <!-- property name="db-type" value="mysql"/ -->
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/system"/>
+ </properties>
[...]
-</programlisting>
- <para>
- The second file is portal/WEB-INF/conf/jcr/repository-configuration.xml:
- </para>
-
-<programlisting>[...]
- <workspaces>
- <workspace name="system" auto-init-root-nodetype="nt:unstructured"
- auto-init-permissions="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="sourceName" value="jdbcexo"/>
- <property name="dialect" value="hsql"/>
- <!-- property name="db-type" value="mysql"/ -->
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system"/>
- </properties>
+ </workspace>
+ <workspace name="collaboration" auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/collaboration"/>
+ </properties>
[...]
- </workspace>
- <workspace name="collaboration" auto-init-root-nodetype="nt:unstructured"
- auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="sourceName" value="jdbcexo"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/collaboration"/>
- </properties>
+ </workspace>
+ <workspace name="backup" auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName" value="jdbcexo"/>
+ <property name="dialect" value="mysql"/>
+ <!-- property name="db-type" value="mysql"/ -->
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size" value="204800"/>
+ <property name="swap-directory" value="../temp/swap/backup"/>
+ </properties>
+ </workspace>
[...]
- </workspace>
- <workspace name="backup" auto-init-root-nodetype="nt:unstructured"
- auto-init-permissions="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" >
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="sourceName" value="jdbcexo"/>
- <property name="dialect" value="mysql"/>
- <!-- property name="db-type" value="mysql"/ -->
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/backup"/>
- </properties>
- </workspace>
-[...]
- </workspaces>
-[...]
-</programlisting>
- </section>
+ </workspaces>
+[...]]]></programlisting>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,64 +2,51 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Default_Portal_Configuration">
- <!--
+ <title>Default Portal Configuration</title>
+ <section id="sect-Reference_Guide-Default_Portal_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ default portal will be accessed when the user doesn't specify the
+ portal. For example: <literal>http://hostname:port/portal/</literal>. And the
+ default portal be used for checking at starting of tomcat to
+ determine whether database is empty or not, too.
+ </para>
+ </section>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ <section
+ id="sect-Reference_Guide-Default_Portal_Configuration-Configuration">
+ <title>Configuration</title>
+ <para>
+ Configuration file path : "02portal.war:/WEB-INF/conf/portal/portal-configuration.xml"
+ </para>
- --> <title>Default Portal Configuration</title>
- <section id="sect-Reference_Guide-Default_Portal_Configuration-Overview">
- <title>Overview</title>
- <para>
- default portal will be accessed by default when user doesn't specify the portal. For example: http://hostname:port/portal/. And the default portal be used for checking at starting of tomcat to determine whether database is empty or not, too.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Default_Portal_Configuration-Configuration">
- <title>Configuration</title>
- <para>
- Configuration file path : "portal/WEB-INF/conf/portal/portal-configuration.xml"
- </para>
-
-<programlisting> <component>
- <key>org.exoplatform.portal.config.UserPortalConfigService</key>
- <type>org.exoplatform.portal.config.UserPortalConfigService</type>
- <component-plugins>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <description>this listener init the portal configuration</description>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <description>The default portal for checking db is empty or not</description>
- <value>classic</value>
- </value-param>
+ <programlisting role="XML"><![CDATA[<component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or not</description>
+ <value>classic</value>
+ </value-param>
..........
- </init-params>
- </component-plugin>
- </component-plugins>
- </component>
-</programlisting>
- <para>
- You can see in the configuration above, we defined the classic as a default portal. Notes that the definition should be as a initial parameter of the NewPortalConfigListener component-plugin
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>]]></programlisting>
+ <para>
+ You can see in the configuration above, we defined the classic as a
+ default portal. Notes that the definition should be as a
+ initial parameter of the NewPortalConfigListener
+ component-plugin
</para>
- </section>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,77 +2,95 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-JBoss_Identity_IDM_integration">
- <title>JBoss Identity IDM integration</title>
- <para>
- GateIn by default uses JBoss Identity IDM component to persist identity information (user, groups, memberships and etc.). While still legacy exo interfaces are used (org.exoplatform.services.organization) for identity management the wrapper implementation delegates to the JBoss Identity IDM framework. This section won't provide information about JBoss Identity IDM and its configuration - please refer to proper project documentation. It is important to fully understand concepts behind this framework design before changing configuration
+ <title>PicketLink IDM integration</title>
+ <para>
+ GateIn by default uses PicketLink IDM component to persist identity
+ information (user, groups, memberships and etc.). While still
+ legacy exo interfaces are used
+ (org.exoplatform.services.organization) for identity management
+ the wrapper implementation delegates to the PicketLink IDM
+ framework. This section won't provide information about PicketLink
+ IDM and its configuration - please refer to proper
+ project documentation (<ulink url="http://jboss.org/picketlink/IDM.html"/>).
+ It is important to fully understand concepts behind this framework
+ design before changing configuration
</para>
- <para>
- Identity model represented in 'org.exoplatform.services.organization' interfaces and one used in JBoss Identity IDM have some major differences. JBoss Identity IDM provides greater abstraction - for example it is possible for groups in IDM framework to form memberships with many parents while GateIn model allows only pure tree like membership structures - this requires recursive ID translation. Additionally GateIn membership concept needs to be translated into IDM Role concept. Therefore JBoss Identity IDM model is used in a limited way. All those translations are applied by the integration layer
+ <para>
+ Identity model represented in 'org.exoplatform.services.organization'
+ interfaces and one used in JBoss Identity IDM have some major
+ differences. JBoss Identity IDM provides greater abstraction - for
+ example it is possible for groups in IDM framework to form
+ memberships with many parents while GateIn model allows only pure
+ tree like membership structures - this requires recursive ID
+ translation. Additionally GateIn membership concept needs to be
+ translated into IDM Role concept. Therefore JBoss Identity IDM
+ model is used in a limited way. All those translations are applied
+ by the integration layer
</para>
- <section id="sect-Reference_Guide-JBoss_Identity_IDM_integration-Configuration_files">
- <title>Configuration files</title>
- <para>
- Main configuration file is <emphasis role="bold">idm-configuration</emphasis>:
- </para>
-
-<programlisting>
-
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <section
+ id="sect-Reference_Guide-JBoss_Identity_IDM_integration-Configuration_files">
+ <title>Configuration files</title>
+ <para>
+ Main configuration file is
+ <emphasis role="bold">idm-configuration</emphasis>
+ :
+ </para>
+
+ <programlisting role="XML"><![CDATA[<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
- <init-params>
- <value-param>
- <name>config</name>
- <value>war:/conf/organization/idm-config.xml</value>
- </value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- <property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />
- </properties-param>
+ <component>
+ <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
+ <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+ <value>war:/conf/organization/idm-config.xml</value>
+ </value-param>
+ <values-param>
+ <name>hibernate.annotations</name>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+ <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ </values-param>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <property name="hibernate.hbm2ddl.auto" value="update"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ <property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />
+ </properties-param>
- </init-params>
- </component>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.organization.OrganizationService</key>
+ <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ </component>
-</configuration>
-</programlisting>
+</configuration>]]></programlisting>
<para>
<emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis> is a main entrypoint implementing <emphasis role="bold">org.exoplatform.services.organization.OrganizationService</emphasis> and is dependant on <emphasis role="bold">org.exoplatform.services.organization.jbidm.JBossIDMService</emphasis>
</para>
@@ -160,82 +178,79 @@
Sample JBoss Identity IDM configuration file is shown below. To understand all options present in it please refer to the JBoss Identity IDM Reference Guide
</para>
-<programlisting>
-
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<programlisting><![CDATA[<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
- <realms>
- <realm>
- <id>PortalRealm</id>
- <repository-id-ref>PortalRepository</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>HibernateStore</default-identity-store-id>
- <default-attribute-store-id>HibernateStore</default-attribute-store-id>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
- <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>hibernateSessionFactoryRegistryName</name>
- <value>hibernateSessionFactory</value>
- </option>
- <option>
- <name>allowNotDefinedIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- </identity-stores>
- </stores>
-</jboss-identity>
-</programlisting>
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ <realms>
+ <realm>
+ <id>PortalRealm</id>
+ <repository-id-ref>PortalRepository</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>PortalRepository</id>
+ <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>HibernateStore</default-identity-store-id>
+ <default-attribute-store-id>HibernateStore</default-attribute-store-id>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>HibernateStore</id>
+ <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+ <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>hibernateSessionFactoryRegistryName</name>
+ <value>hibernateSessionFactory</value>
+ </option>
+ <option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>]]></programlisting>
</section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,93 +2,93 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Javascript_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Javascript Configuration</title>
- <para>
- Manaing Javascript scripts in an application like GateIn Platform is a critical part of the configuration work if you want to get good response time.
+ <title>Javascript Configuration</title>
+ <para>
+ Manaing Javascript scripts in an application like GateIn
+ Platform is a
+ critical part of the configuration work if you want
+ to get good
+ response time.
</para>
- <para>
- Every portlet can have its own javscript code but in many cases it is more convenient to reuse some existing shared libraries. For that reason, GateIn has a mechanism to easily register the libraries that will be loaded when the first page will be rendered. To do so, every WAR deployed in GateIn can register the js files thanks to a groovy script "WEB-INF/conf/script/groovy/JavascriptScript.groovy". The next file is the one you can find in the GateInResources.war
+ <para>
+ Every portlet can have its own javscript code but in many cases
+ it is more
+ convenient to reuse some existing shared libraries. For
+ that
+ reason, GateIn has a mechanism to easily register the
+ libraries
+ that will be loaded when the first page will be rendered.
+ To do
+ so, every WAR deployed in GateIn can register the js files
+ thanks
+ to a groovy script
+ "WEB-INF/conf/script/groovy/JavascriptScript.groovy". The next
+ file is the one you can find in the GateInResources.war
</para>
-
-<programlisting>JavascriptService.addJavascript("GateIn", "/javascript/GateIn.js", ServletContext);
+
+ <programlisting>JavascriptService.addJavascript("eXo", "/javascript/eXo.js", ServletContext);
/* Animation Javascripts */
-JavascriptService.addJavascript("GateIn.animation.ImplodeExplode", "/javascript/GateIn/animation/ImplodeExplode.js", ServletContext);
+JavascriptService.addJavascript("eXo.animation.ImplodeExplode", "/javascript/eXo/animation/ImplodeExplode.js", ServletContext);
/* Application descriptor */
-JavascriptService.addJavascript("GateIn.application.ApplicationDescriptor", "/javascript/GateIn/application/ApplicationDescriptor.js", ServletContext);
+JavascriptService.addJavascript("eXo.application.ApplicationDescriptor", "/javascript/eXo/application/ApplicationDescriptor.js", ServletContext);
/* CORE Javascripts */
-JavascriptService.addJavascript("GateIn.core.Utils", "/javascript/GateIn/core/Util.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.DOMUtil", "/javascript/GateIn/core/DOMUtil.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.Browser", "/javascript/GateIn/core/Browser.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.MouseEventManager", "/javascript/GateIn/core/MouseEventManager.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.UIMaskLayer", "/javascript/GateIn/core/UIMaskLayer.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.Skin", "/javascript/GateIn/core/Skin.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.DragDrop", "/javascript/GateIn/core/DragDrop.js", ServletContext);
-JavascriptService.addJavascript("GateIn.core.TemplateEngine", "/javascript/GateIn/core/TemplateEngine.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.Utils", "/javascript/eXo/core/Util.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.DOMUtil", "/javascript/eXo/core/DOMUtil.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.Browser", "/javascript/eXo/core/Browser.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.MouseEventManager", "/javascript/eXo/core/MouseEventManager.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.UIMaskLayer", "/javascript/eXo/core/UIMaskLayer.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.Skin", "/javascript/eXo/core/Skin.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.DragDrop", "/javascript/eXo/core/DragDrop.js", ServletContext);
+JavascriptService.addJavascript("eXo.core.TemplateEngine", "/javascript/eXo/core/TemplateEngine.js", ServletContext);
/* Widget Javascripts */
-JavascriptService.addJavascript("GateIn.widget.UIWidget", "/javascript/GateIn/widget/UIWidget.js", ServletContext);
-JavascriptService.addJavascript("GateIn.widget.UIAddWidget", "/javascript/GateIn/widget/UIAddWidget.js", ServletContext);
-JavascriptService.addJavascript("GateIn.widget.UIExoWidget", "/javascript/GateIn/widget/UIExoWidget.js", ServletContext);
+JavascriptService.addJavascript("eXo.widget.UIWidget", "/javascript/eXo/widget/UIWidget.js", ServletContext);
+JavascriptService.addJavascript("eXo.widget.UIAddWidget", "/javascript/eXo/widget/UIAddWidget.js", ServletContext);
+JavascriptService.addJavascript("eXo.widget.UIExoWidget", "/javascript/eXo/widget/UIExoWidget.js", ServletContext);
/* Desktop Javascripts */
-JavascriptService.addJavascript("GateIn.desktop.UIDockbar", "/javascript/GateIn/desktop/UIDockbar.js", ServletContext);
-JavascriptService.addJavascript("GateIn.desktop.UIDesktop", "/javascript/GateIn/desktop/UIDesktop.js", ServletContext);
+JavascriptService.addJavascript("eXo.desktop.UIDockbar", "/javascript/eXo/desktop/UIDockbar.js", ServletContext);
+JavascriptService.addJavascript("eXo.desktop.UIDesktop", "/javascript/eXo/desktop/UIDesktop.js", ServletContext);
/* WebUI Javascripts */
-JavascriptService.addJavascript("GateIn.webui.UIItemSelector", "/javascript/GateIn/webui/UIItemSelector.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIForm", "/javascript/GateIn/webui/UIForm.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIPopup", "/javascript/GateIn/webui/UIPopup.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIPopupSelectCategory", "/javascript/GateIn/webui/UIPopupSelectCategory.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIPopupWindow", "/javascript/GateIn/webui/UIPopupWindow.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIVerticalScroller", "/javascript/GateIn/webui/UIVerticalScroller.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIHorizontalTabs", "/javascript/GateIn/webui/UIHorizontalTabs.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIPopupMenu", "/javascript/GateIn/webui/UIPopupMenu.js", ServletContext);
-JavascriptService.addJavascript("GateIn.webui.UIDropDownControl", "/javascript/GateIn/webui/UIDropDownControl.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIItemSelector", "/javascript/eXo/webui/UIItemSelector.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIForm", "/javascript/eXo/webui/UIForm.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIPopup", "/javascript/eXo/webui/UIPopup.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIPopupSelectCategory", "/javascript/eXo/webui/UIPopupSelectCategory.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIPopupWindow", "/javascript/eXo/webui/UIPopupWindow.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIVerticalScroller", "/javascript/eXo/webui/UIVerticalScroller.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIHorizontalTabs", "/javascript/eXo/webui/UIHorizontalTabs.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIPopupMenu", "/javascript/eXo/webui/UIPopupMenu.js", ServletContext);
+JavascriptService.addJavascript("eXo.webui.UIDropDownControl", "/javascript/eXo/webui/UIDropDownControl.js", ServletContext);
/* Portal Javascripts */
-JavascriptService.addJavascript("GateIn.portal.PortalHttpRequest", "/javascript/GateIn/portal/PortalHttpRequest.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIPortal", "/javascript/GateIn/portal/UIPortal.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIWorkspace", "/javascript/GateIn/portal/UIWorkspace.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIPortalControl", "/javascript/GateIn/portal/UIPortalControl.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.PortalDragDrop", "/javascript/GateIn/portal/PortalDragDrop.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIPortalNavigation", "/javascript/GateIn/portal/UIPortalNavigation.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIMaskWorkspace", "/javascript/GateIn/portal/UIMaskWorkspace.js", ServletContext);
-JavascriptService.addJavascript("GateIn.portal.UIExoStartMenu", "/javascript/GateIn/portal/UIExoStartMenu.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.PortalHttpRequest", "/javascript/eXo/portal/PortalHttpRequest.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIPortal", "/javascript/eXo/portal/UIPortal.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIWorkspace", "/javascript/eXo/portal/UIWorkspace.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIPortalControl", "/javascript/eXo/portal/UIPortalControl.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.PortalDragDrop", "/javascript/eXo/portal/PortalDragDrop.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIPortalNavigation", "/javascript/eXo/portal/UIPortalNavigation.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIMaskWorkspace", "/javascript/eXo/portal/UIMaskWorkspace.js", ServletContext);
+JavascriptService.addJavascript("eXo.portal.UIExoStartMenu", "/javascript/eXo/portal/UIExoStartMenu.js", ServletContext);
/* Desktop Javascripts 2 */
-JavascriptService.addJavascript("GateIn.desktop.UIWindow", "/javascript/GateIn/desktop/UIWindow.js", ServletContext);
+JavascriptService.addJavascript("eXo.desktop.UIWindow", "/javascript/eXo/desktop/UIWindow.js", ServletContext);
</programlisting>
+ <para>
+ Note that even if the you register dedicated javascripts, they
+ will be merged into a single
+ <literal>merged.js</literal>
+ file when the server will load in order to reduce the number of
+ HTTP calls as seen in the home page source code:
+ </para>
+
+ <programlisting><script type="text/javascript" src="/portal/javascript/merged.js"></script></programlisting>
<para>
- Note that even if the you register dedicated javascripts, they will be merged into a single <literal>merged.js</literal> file when the server will load in order to reduce the number of HTTP calls as seen in the home page source code:
+ Although this optimization is useful for a production environment, you may find it easier to deactivate this optimization while debugging your javascript. For that, you simply need to set the java system property <literal>exo.product.developing</literal> to <literal>true</literal>. But if you <emphasis>want to see or use the merged file</emphasis> you have to set this property to <literal>false</literal>.
+ You can pass the property as a JVM parameter with the <literal>-D</literal> option in your <literal>GateIn.sh</literal> or <literal>GateIn.bat</literal> startup script:
</para>
-
-<programlisting> <script type="text/javascript" src="/portal/javascript/merged.js"></script>
-</programlisting>
<para>
- Although this optimization is useful for a production environment, you may find it easier to deactivate this optimization while debugging your javascript. For that, you simply need to set the java system property <literal>exo.product.developing</literal> to <literal>true</literal>. But if you <emphasis>want to see or use the merged file</emphasis> you have to set this property to <literal>false</literal>. You can pass the property as a JVM parameter with the <literal>-D</literal> option in your <literal>GateIn.sh</literal> or <literal>GateIn.bat</literal> startup script: {code} EXO{code}
+ Every javascript file is referenced with a module name of type "eXo.core.DragDrop" which acts like a namespace. Inside the associated files, global javascript functions are used following the same namespace convention:
</para>
- <para>
- Every javascript file is referenced with a module name of type "GateIn.core.DragDrop" which acts like a namespace. Inside the associated files, global javascript functions are used following the same namespace convention:
- </para>
-<programlisting>GateIn.core.DragDrop = new DragDrop() ;
-</programlisting>
+<programlisting>eXo.core.DragDrop = new DragDrop() ;</programlisting>
<para>
- It is also possible to use the GateIn.require() javascript method to lazy load and evaluate some javascript code. This is quite useful from the portlet or widget applications that will use this javascript only once. Otherwise, if the library is reusable in several places it is better to reference it in the groovy file.
+ It is also possible to use the eXo.require() javascript method to lazy load and evaluate some javascript code. This is quite useful from the portlet or widget applications that will use this javascript only once. Otherwise, if the library is reusable in several places it is better to reference it in the groovy file.
</para>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,124 +2,126 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Portal_Default_Permission_Configuration">
- <!--
+ <title>Portal Default Permission Configuration</title>
+ <section
+ id="sect-Reference_Guide-Portal_Default_Permission_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ The permission configuration for the portal is defined in the
+ file
+ <filename>02portal.war:/WEB-INF/conf/portal/portal-configuration.xml
+ </filename>
+ . The component UserACL is described there along with other
+ portal component configurations.
+ </para>
+ <para>
+ It defines 5 permissions types:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>super.user</emphasis>
+ : The super user has all the rights on the platform, by
+ default this user is called root
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>portal.creator.groups</emphasis>
+ : This list defines all groups that will be able to
+ manage the different portals, they also have the
+ permission to create new portals. The format is
+ "membership:/group/subgroup".
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>navigation.creator.membership.type</emphasis>
+ : Defines the membership type of the group managers. The
+ group managers have the permission to create and edit
+ group pages and they can modify the group navigation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>guests.group</emphasis>
+ : Contains the name of the group that is used as guest
+ group. Any anonymous user becomes automatically member of
+ this group when he enters the public pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>access.control.workspace</emphasis>
+ : Defines the users that have access to the control
+ workspace. In the demo version the control workspace is
+ accessible only to 'root' and 'john'. They can
+ expand/collapse the workspace at the left hand side. The
+ format is "membership:/group/subgroup", An asterisk ''
+ gives permission to all memberships.
+ </para>
+ </listitem>
+ </itemizedlist>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --> <title>Portal Default Permission Configuration</title>
- <section id="sect-Reference_Guide-Portal_Default_Permission_Configuration-Overview">
- <title>Overview</title>
- <para>
- The permission configuration for the portal is defined in the file portal/WEB-INF/conf/portal/portal-configuration.xml. The component UserACL is described there along with other portal component configurations.
- </para>
- <para>
- It defines 5 permissions types:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>super.user</emphasis>: The super user has all the rights on the platform, by default this user is called root
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>portal.creator.groups</emphasis>: This list defines all groups that will be able to manage the different portals, they also have the permission to create new portals. The format is "membership:/group/subgroup".
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>navigation.creator.membership.type</emphasis>: Defines the membership type of the group managers. The group managers have the permission to create and edit group pages and they can modify the group navigation.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>guests.group</emphasis>: Contains the name of the group that is used as guest group. Any anonymous user becomes automatically member of this group when he enters the public pages.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>access.control.workspace</emphasis>: Defines the users that have access to the control workspace. In the demo version the control workspace is accessible only to 'root' and 'john'. They can expand/collapse the workspace at the left hand side. The format is "membership:/group/subgroup", An asterisk '' gives permission to all memberships.
- </para>
- </listitem>
- </itemizedlist>
-
-<programlisting> <component>
- <key>org.exoplatform.portal.config.UserACL</key>
- <type>org.exoplatform.portal.config.UserACL</type>
- <init-params>
- <value-param>
- <name>super.user</name>
- <description>administrator</description>
- <value>root</value>
- </value-param>
+ <programlisting role="XML"><![CDATA[<component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <description>administrator</description>
+ <value>root</value>
+ </value-param>
- <value-param>
- <name>portal.creator.groups</name>
- <description>groups with membership type have permission to manage portal</description>
- <value>*:/platform/administrators,*:/organization/management/executive-board</value>
- </value-param>
+ <value-param>
+ <name>portal.creator.groups</name>
+ <description>groups with membership type have permission to manage portal</description>
+ <value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
- <value-param>
- <name>navigation.creator.membership.type</name>
- <description>specific membership type have full permission with group navigation</description>
- <value>manager</value>
- </value-param>
- <value-param>
- <name>guests.group</name>
- <description>guests group</description>
- <value>/platform/guests</value>
- </value-param>
- <value-param>
- <name>access.control.workspace</name>
- <description>groups with memberships that have the right to access the User Control Workspace</description>
- <value>*:/platform/administrators,*:/organization/management/executive-board</value>
- </value-param>
- </init-params>
- </component>
-</programlisting>
- <para>
- 1 Overwrite Portal Default Permissions In GateIn Portal 2.5 and later the UserACL component supports adding a PortalACLPlugin plugin that allows to overwrite portal default permissions.
- </para>
+ <value-param>
+ <name>navigation.creator.membership.type</name>
+ <description>specific membership type have full permission with group navigation</description>
+ <value>manager</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <description>guests group</description>
+ <value>/platform/guests</value>
+ </value-param>
+ <value-param>
+ <name>access.control.workspace</name>
+ <description>groups with memberships that have the right to access the User Control Workspace</description>
+ <value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
+ </init-params>
+</component>]]></programlisting>
+ </section>
+ <section>
+ <title>Overwrite Portal Default Permissions</title>
-<programlisting> <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserACL</target-component>
- <component-plugin>
- <name>addPortalACLPlugin</name>
- <set-method>addPortalACLPlugin</set-method>
- <type>org.exoplatform.portal.config.PortalACLPlugin</type>
- <description>setting some permission for portal</description>
- <init-params>
- <values-param>
- <name>access.control.workspace.roles</name>
- <value>*:/platform/administrators</value>
- <value>*:/organization/management/executive-board</value>
- </values-param>
- <values-param>
- <name>portal.creation.roles</name>
- <value>*:/platform/administrators</value>
- <value>*:/organization/management/executive-board</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</programlisting>
+<programlisting role="XML"><![CDATA[<external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserACL</target-component>
+ <component-plugin>
+ <name>addPortalACLPlugin</name>
+ <set-method>addPortalACLPlugin</set-method>
+ <type>org.exoplatform.portal.config.PortalACLPlugin</type>
+ <description>setting some permission for portal</description>
+ <init-params>
+ <values-param>
+ <name>access.control.workspace.roles</name>
+ <value>*:/platform/administrators</value>
+ <value>*:/organization/management/executive-board</value>
+ </values-param>
+ <values-param>
+ <name>portal.creation.roles</name>
+ <value>*:/platform/administrators</value>
+ <value>*:/organization/management/executive-board</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>]]></programlisting>
</section>
-
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,391 +2,523 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Portal_Navigation_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Portal Navigation Configuration</title>
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Overview">
- <title>Overview</title>
- <para>
- When a user logs in he sees three types of navigation tree:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Portal Navigation
+ <title>Portal Navigation Configuration</title>
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ When a user logs in he sees three types of navigation tree:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Portal Navigation
</para>
- </listitem>
- <listitem>
- <para>
- Group Navigation
+ </listitem>
+ <listitem>
+ <para>
+ Group Navigation
</para>
- </listitem>
- <listitem>
- <para>
- User Navigation
+ </listitem>
+ <listitem>
+ <para>
+ User Navigation
</para>
- </listitem>
- </itemizedlist>
- <para>
- they all are configured thanks to the usual XML configuration syntax in a file: "portal/WEB-INF/conf/portal/portal-configuration.xml"
+ </listitem>
+ </itemizedlist>
+ <para>
+ they all are configured thanks to the usual XML
+ configuration syntax in a
+ file:
+ "02portal.war:/WEB-INF/conf/portal/portal-configuration.xml"
+ </para>
+
+ <programlisting role="XML"><![CDATA[<component>
+ <key>org.exoplatform.portal.config.UserPortalConfigService</key>
+ <type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or not</description>
+ <value>classic</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>classic</string></value>
+ <value><string>webos</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>portal</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>platform/administrators</string></value>
+ <value><string>platform/users</string></value>
+ <value><string>platform/guests</string></value>
+ <value><string>organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>group</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value><string>root</string></value>
+ <value><string>john</string></value>
+ <value><string>mary</string></value>
+ <value><string>demo</string></value>
+ </collection>
+ </field>
+ <field name="ownerType"><string>user</string></field>
+ <field name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+</component-plugins>]]></programlisting>
+ <para>
+ In the previous XML file we define, for the 3 navigation
+ types, some
+ sets of predefined portal, groups or users that will
+ have some
+ XML files inside the war. Those files will be used to
+ create an
+ initial navigation the first time the portal is
+ launched. That
+ information will then be stored in the JCR and
+ hence only
+ modifiable from the portal UI.
</para>
-
-<programlisting> <component>
- <key>org.exoplatform.portal.config.UserPortalConfigService</key>
- <type>org.exoplatform.portal.config.UserPortalConfigService</type>
- <component-plugins>
- <component-plugin>
- <name>new.portal.config.user.listener</name>
- <set-method>initListener</set-method>
- <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
- <description>this listener init the portal configuration</description>
- <init-params>
- <value-param>
- <name>default.portal</name>
- <description>The default portal for checking db is empty or not</description>
- <value>classic</value>
- </value-param>
- <object-param>
- <name>portal.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value><string>classic</string></value>
- <value><string>webos</string></value>
- </collection>
- </field>
- <field name="ownerType"><string>portal</string></field>
- <field name="templateLocation"><string>war:/conf/portal</string></field>
- </object>
- </object-param>
- <object-param>
- <name>group.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value><string>platform/administrators</string></value>
- <value><string>platform/users</string></value>
- <value><string>platform/guests</string></value>
- <value><string>organization/management/executive-board</string></value>
- </collection>
- </field>
- <field name="ownerType"><string>group</string></field>
- <field name="templateLocation"><string>war:/conf/portal</string></field>
- </object>
- </object-param>
- <object-param>
- <name>user.configuration</name>
- <description>description</description>
- <object type="org.exoplatform.portal.config.NewPortalConfig">
- <field name="predefinedOwner">
- <collection type="java.util.HashSet">
- <value><string>root</string></value>
- <value><string>john</string></value>
- <value><string>marry</string></value>
- <value><string>demo</string></value>
- </collection>
- </field>
- <field name="ownerType"><string>user</string></field>
- <field name="templateLocation"><string>war:/conf/portal</string></field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </component-plugins>
-</programlisting>
- <para>
- In the previous XML file we define, for the 3 navigation types, some sets of predefined portal, groups or users that will have some XML files inside the war. Those files will be used to create an initial navigation the first time the portal is launched. That information will then be stored in the JCR and hence only modifiable from the portal UI.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal_Navigation">
+ <title>Portal Navigation</title>
+ <para>
+ The portal navigation incorporates the pages that can be
+ accessed even
+ when the user is not logged in (if the permission
+ allow a
+ public access). Several portal navigations are used for
+ example
+ when a company has several trademarks and each trade
+ would have
+ its own website.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal_Navigation">
- <title>Portal Navigation</title>
- <para>
- The portal navigation incorporates the pages that can be accessed even when the user is not logged in (if the permission allow a public access). Several portal navigations are used for example when a company has several trademarks and each trade would have its own website.
+ <para>
+ The configuration of a portal called "classic" is made by
+ providing 4
+ XML files under the directory
+ portal/WEBINF/conf/portal/portal/classic:
</para>
- <para>
- The configuration of a portal called "classic" is made by providing 4 XML files under the directory portal/WEBINF/conf/portal/portal/classic:
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal.xml">
+ <title>Portal.xml</title>
+ <para>
+ That file describes the layout and portlets that will be
+ shown for all
+ pages. Usually the layout contains the banner,
+ footer, menu,
+ breadcrumbs portlets. Indeed, in GateIn, every
+ area is a
+ portlet even the banner and footer which makes the
+ platform
+ extremely configurable.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal.xml">
- <title>Portal.xml</title>
- <para>
- That file describes the layout and portlets that will be shown for all pages. Usually the layout contains the banner, footer, menu, breadcrumbs portlets. Indeed, in GateIn, every area is a portlet even the banner and footer which makes the platform extremely configurable.
- </para>
-
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<portal-config>
- <portal-name>classic</portal-name>
- <locale>en</locale>
- <factory-id>office</factory-id>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <creator>root</creator>
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <factory-id>office</factory-id>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <creator>root</creator>
- <portal-layout>
- <application>
- <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
- <show-info-bar>false</show-info-bar>
- </application>
- <application>
- <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
- <show-info-bar>false</show-info-bar>
- </application>
+ <portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ <application>
+ <instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
- <application>
- <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
- <show-info-bar>false</show-info-bar>
- </application>
+ <application>
+ <instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
- <page-body> </page-body>
+ <page-body> </page-body>
- <application>
- <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
- <show-info-bar>false</show-info-bar>
- </application>
- </portal-layout>
+ <application>
+ <instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
-</portal-config>
-</programlisting>
- <para>
- Even if not shown in the previous XML file, it is also possible to apply a nested container that can also contain portlets. Containers are then responsible of the layout of their children (row, column or tabs containers exist).
+</portal-config>]]></programlisting>
+ <para>
+ Even if not shown in the previous XML file, it is also
+ possible to apply
+ a nested container that can also contain
+ portlets. Containers
+ are then responsible of the layout of their
+ children (row,
+ column or tabs containers exist).
</para>
- <para>
- Each application references a portlet using the id portal#{portalName}:/{portletWarName}/{portletName}/{uniqueId}
+ <para>
+ Each application references a portlet using the id
+ portal#{portalName}:/{portletWarName}/{portletName}/{uniqueId}
+ </para>
+ <para>
+ In order to define at which location GateIn Portal shall
+ render the
+ current page use the page-body tag.
</para>
- <para>
- In order to define at which location GateIn Portal shall render the current page use the page-body tag.
+ <para>
+ The defined classic portal is accessible to "Everyone" (that
+ means it
+ can be accessed through the URL /portal/public/classic)
+ but
+ only members of the group /platform/administrators can edit
+ it.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Navigation.xml">
+ <title>Navigation.xml</title>
+ <para>
+ This file defines all the navigation nodes the portal will
+ have. The
+ syntax is simple as we get nested node tags. Each node
+ references a page that is defined in the next XML file.
</para>
- <para>
- The defined classic portal is accessible to "Everyone" (that means it can be accessed through the URL /portal/public/classic) but only members of the group /platform/administrators can edit it.
+ <para>
+ If the label #{} is used then it means the i18n mechanism is
+ activated
+ and that the real label to render is taken from an
+ associated
+ properties file for the current locale.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Navigation.xml">
- <title>Navigation.xml</title>
- <para>
- This file defines all the navigation nodes the portal will have. The syntax is simple as we get nested node tags. Each node references a page that is defined in the next XML file.
+
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+ <page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+ <page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>]]></programlisting>
+ <para>
+ This navigation tree can have multiple views inside portlets
+ such as the
+ breadcrumbs that render the current view node, the
+ site map or
+ the menu portlets.
</para>
- <para>
- If the label #{} is used then it means the i18n mechanism is activated and that the real label to render is taken from an associated properties file for the current locale.
+ <warning>
+ <para>
+ For top nodes, the
+ <emphasis role="bold">uri</emphasis>
+ and the
+ <emphasis role="bold">name</emphasis>
+ of your navigation nodes must have the
+ <emphasis role="bold">same</emphasis>
+ value. For the other nodes the uri is composed like
+ <emphasis>
+ <uri>contentmanagement/fileexplorer</uri>
+ </emphasis>
+ where 'contentmanagement' is the name of the parent node and
+ 'fileexplorer' the name of the node (
+ <emphasis><name>fileexplorer</name> </emphasis>
+ ).
+ </para>
+ </warning>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Pages.xml">
+ <title>Pages.xml</title>
+ <para>
+ This XML file structure is very similar to portal.xml and it
+ can also
+ contain container tags. Each application can decide if
+ it
+ wishes to render the portlet border, the window state icons
+ or
+ the mode.
</para>
-
-<programlisting><?xml version="1.0" encoding="UTF-8"?>
-<node-navigation>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <priority>1</priority>
- <page-nodes>
- <node>
- <uri>home</uri>
- <name>home</name>
- <label>#{portal.classic.home}</label>
- <page-reference>portal::classic::homepage</page-reference>
- </node>
- <node>
- <uri>webexplorer</uri>
- <name>webexplorer</name>
- <label>#{portal.classic.webexplorer}</label>
- <page-reference>portal::classic::webexplorer</page-reference>
- </node>
- </page-nodes>
-</node-navigation>
-</programlisting>
- <para>
- This navigation tree can have multiple views inside portlets such as the breadcrumbs that render the current view node, the site map or the menu portlets.
- </para>
- <para>
- +Warning+: For top nodes, the <emphasis role="bold">uri</emphasis> and the <emphasis role="bold">name</emphasis> of your navigation nodes must have the <emphasis role="bold">same</emphasis> value. For the other nodes the uri is composed like <emphasis><uri>contentmanagement/fileexplorer</uri></emphasis> where 'contentmanagement' is the name of the parent node and 'fileexplorer' the name of the node (<emphasis><name>fileexplorer</name></emphasis>).
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Pages.xml">
- <title>Pages.xml</title>
- <para>
- This XML file structure is very similar to portal.xml and it can also contain container tags. Each application can decide if it wishes to render the portlet border, the window state icons or the mode.
- </para>
-
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<page-set>
- <page>
- <page-id>portal::classic::homepage</page-id>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <name>homepage</name>
- <title>Home Page</title>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <application>
- <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
- <title>Home Page portlet</title>
- <show-info-bar>false</show-info-bar>
- <show-application-state>false</show-application-state>
- <show-application-mode>false</show-application-mode>
- </application>
- </page>
+
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<page-set>
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ </application>
+ </page>
- <page>
- <page-id>portal::classic::webexplorer</page-id>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <name>webexplorer</name>
- <title>Web Explorer</title>
- <access-permissions>*:/platform/users</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <application>
- <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
- <title>Web Explorer</title>
- <show-info-bar>false</show-info-bar>
- </application>
- </page>
-</page-set>
-</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Portlet_preferences.xml">
- <title>Portlet-preferences.xml</title>
- <para>
- Porlet instances can be associated with portlet-preferences that override the one defined in the usual portlet.xml file of the portlet application WAR.
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+ <access-permissions>*:/platform/users</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+ <instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>]]></programlisting>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Portlet_preferences.xml">
+ <title>Portlet-preferences.xml</title>
+ <para>
+ Porlet instances can be associated with portlet-preferences
+ that override
+ the one defined in the usual portlet.xml file of
+ the portlet
+ application WAR.
</para>
-
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<portlet-preferences-set>
- <portlet-preferences>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <window-id>portal#classic:/web/BannerPortlet/banner</window-id>
- <preference>
- <name>template</name>
- <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
- <portlet-preferences>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <window-id>portal#classic:/web/NavigationPortlet/toolbar</window-id>
- <preference>
- <name>useAJAX</name>
- <value>true</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
- <portlet-preferences>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <window-id>portal#classic:/web/FooterPortlet/footer</window-id>
- <preference>
- <name>template</name>
- <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
+
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/NavigationPortlet/toolbar</window-id>
+ <preference>
+ <name>useAJAX</name>
+ <value>true</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
- <portlet-preferences>
- <owner-type>portal</owner-type>
- <owner-id>classic</owner-id>
- <window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
- <preference>
- <name>template</name>
- <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
- <read-only>false</read-only>
- </preference>
- </portlet-preferences>
-</portlet-preferences-set>
-</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Group_Navigation">
- <title>Group Navigation</title>
- <para>
- Group navigations are dynamically added (mounted) to the user navigation when he logs in. This means that a user sees in his menu also all the pages that are assigned to the groups to which he belongs to.
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+ <value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>]]></programlisting>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-Group_Navigation">
+ <title>Group Navigation</title>
+ <para>
+ Group navigations are dynamically added (mounted) to the
+ user navigation
+ when he logs in. This means that a user sees in
+ his menu also
+ all the pages that are assigned to the groups to
+ which he
+ belongs to.
</para>
- <para>
- Here only 3 XML files are necessary: navigation.xml, pages.xml and portlet-preferences.xml. The syntax is the same as for portal navigations.
+ <para>
+ Here only 3 XML files are necessary: navigation.xml,
+ pages.xml and
+ portlet-preferences.xml. The syntax is the same as
+ for portal
+ navigations.
</para>
- <para>
- The 3 files are located in the directory: "portal/WEB-INF/conf/portal/group/group-name-path/" like for example "portal/WEB-INF/conf/portal/group/platform/administrators/"
+ <para>
+ The 3 files are located in the directory:
+ "portal/WEB-INF/conf/portal/group/group-name-path/" like for
+ example
+ "portal/WEB-INF/conf/portal/group/platform/administrators/"
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Portal_Navigation_Configuration-User_Navigation">
+ <title>User Navigation</title>
+ <para>
+ The user navigation is the set of nodes and pages that is owned
+ by a user. You can see that part as the user dashboard. The
+ files needed are navigation.xml, pages.xml,
+ portlet-preferences.xml. You will also find gadgets.xml
+ (formerly called widgets.xml) which defines the gadgets
+ (widgets) that will be located in the user workspace. The user
+ workspace is located at the left hand side, the access is
+ restricted to some privileged users, see
+ <xref linkend="sect-Reference_Guide-Predefined_User_Configuration" />
+ </para>
+ <para>
+ Those files are located in the directory
+ "portal/WEB-INF/conf/portal/users/{userName}"
</para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-User_Navigation">
- <title>User Navigation</title>
- <para>
- The user navigation is the set of nodes and pages that is owned by a user. You can see that part as the user dashboard. The files needed are navigation.xml, pages.xml, portlet-preferences.xml. You will also find gadgets.xml (formerly called widgets.xml) which defines the gadgets (widgets) that will be located in the user workspace. The user workspace is located at the left hand side, the access is restricted to some privileged users, see <xref linkend="sect-Reference_Guide-Predefined_User_Configuration" />
- </para>
- <para>
- Those files are located in the directory "portal/WEB-INF/conf/portal/users/{userName}"
- </para>
-
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<widgets>
- <owner-type>user</owner-type>
- <owner-id>root</owner-id>
+
+ <programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<widgets>
+ <owner-type>user</owner-type>
+ <owner-id>root</owner-id>
- <container id="Information">
- <name>Information</name>
- <description>Information's Description</description>
- <application>
- <instance-id>user#root:/GateInWidgetWeb/WelcomeWidget/WelcomeWidget1</instance-id>
- <application-type>GateInWidget</application-type>
- </application>
+ <container id="Information">
+ <name>Information</name>
+ <description>Information's Description</description>
+ <application>
+ <instance-id>user#root:/GateInWidgetWeb/WelcomeWidget/WelcomeWidget1</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
- <application>
- <instance-id>user#root:/GateInWidgetWeb/StickerWidget/StickerWidget</instance-id>
- <application-type>GateInWidget</application-type>
- </application>
+ <application>
+ <instance-id>user#root:/GateInWidgetWeb/StickerWidget/StickerWidget</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
- <application>
- <instance-id>user#root:/GateInWidgetWeb/InfoWidget/InfoWidget1</instance-id>
- <application-type>GateInWidget</application-type>
- </application>
- </container>
+ <application>
+ <instance-id>user#root:/GateInWidgetWeb/InfoWidget/InfoWidget1</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+ </container>
- <container id="Calendar">
- <name>Calendar</name>
- <description>Calendar's Description</description>
- <application>
- <instance-id>user#root:/GateInWidgetWeb/CalendarWidget/CalendarWidget</instance-id>
- <application-type>GateInWidget</application-type>
- </application>
- </container>
+ <container id="Calendar">
+ <name>Calendar</name>
+ <description>Calendar's Description</description>
+ <application>
+ <instance-id>user#root:/GateInWidgetWeb/CalendarWidget/CalendarWidget</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+ </container>
-</widgets>
-</programlisting>
- <para>
- Note that when you develop a portal, we advise you to use the XML instead of the User Interface as XML will allow you to provide a preconfigured package to your customer. But as each time you start the server the first time, the XML files are stored in the JCR, it will be necessary to remove the database (the jcr leverages a database). During the development phase using tomcat it simply means to delete the directory: exo-tomcat/temp
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Tips">
- <title>Tips</title>
- <para>
- Stuff Goes Here?
- </para>
- </section>
+</widgets>]]></programlisting>
+ <para>
+ Note that when you develop a portal, we advise you to use
+ the XML instead
+ of the User Interface as XML will allow you to
+ provide a
+ preconfigured package to your customer. But as each
+ time you
+ start the server the first time, the XML files are
+ stored in
+ the JCR, it will be necessary to remove the database
+ (the jcr
+ leverages a database). During the development phase
+ using
+ tomcat it simply means to delete the directory:
+ exo-tomcat/temp
+ </para>
+ </section>
+ <section id="sect-Reference_Guide-Portal_Navigation_Configuration-Tips">
+ <title>Tips</title>
+ <section>
+ <title>Direct External Links</title>
+ <para>
+ If you wish to add a link to a URL outside the portal you
+ you first
+ have to define a "page" which will not be used.
+ Then add
+ the URL to the navigation.
+ pages.xml:
+ </para>
+ <programlisting><![CDATA[<page>
+ <owner-type>portal</owner-type>
+ <owner-id>website</owner-id>
+ <name>documentation</name>
+ <title>Documentation</title>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+</page>]]></programlisting>
+ <para>
+ naviguation.xml:</para>
+
+ <programlisting><![CDATA[<node>
+ <uri>http://wiki.exoplatform.com/xwiki/bin/view/Main/WebHome</uri>
+ <name>documentation</name>
+ <label>#{portal.classic.documentation}</label>
+ <page-reference>portal::website::documentation</page-reference>
+</node>]]></programlisting>
+
+ <warning>
+ <title>Direct external links were not a design goal</title>
+ <para>Currently you cannot modify the URL using the portal
+ interface, you
+ must change it in the configuration files
+ or modify the underlying
+ database table.</para>
+ </warning>
+ </section>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,129 +2,212 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Predefined_User_Configuration">
- <!--
+ <title>Predefined User Configuration</title>
+ <section
+ id="sect-Reference_Guide-Predefined_User_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ To specify the initial Organization configuration, the content
+ of
+ <literal>02portal.war:/WEB-INF/conf/organization/organization-configuration.xml
+ </literal>
+ should be edited. This file complies with the XML GateIn
+ configuration schema. It lists several configuration plugins.
+ </para>
+ </section>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ <section
+ id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_adding_users_groups_and_membership_types">
+ <title>Plugin for adding users, groups and membership types
+ </title>
+ <para>
+ The plugin of type
+ <literal>org.exoplatform.services.organization.OrganizationDatabaseInitializer
+ </literal>
+ specifies the list of users, groups and membership types to be
+ created. The initialization parameter named
+ "checkDatabaseAlgorithm" determines how the creation is
+ triggered. Thus, the value "entry" means that each user, group
+ and membership listed in the configuration is checked each time
+ GateIn is started. If not existing, it is created. The value
+ "empty" means that the whole list of preconfigured users,
+ groups and memberships is processed only if the database is
+ empty.
+ </para>
+ </section>
- --> <title>Predefined User Configuration</title>
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Overview">
- <title>Overview</title>
- <para>
- To specify the initial Organization configuration, the content of <literal>portal.war:WEB-INF/conf/organization/organization-configuration.xml</literal> should be edited. This file complies with the XML GateIn configuration schema. It lists several configuration plugins.
+ <section
+ id="sect-Reference_Guide-Predefined_User_Configuration-Membership_types">
+ <title>Membership types</title>
+ <para>
+ The predefined membership types are specified in the
+ "membershipType"
+ field of the "OrganizationConfig" plugin
+ parameter.
+ </para>
+ <programlisting role="XML"><![CDATA[<field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type">
+ <string>member</string>
+ </field>
+ <field name="description">
+ <string>member membership type</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type">
+ <string>owner</string>
+ </field>
+ <field name="description">
+ <string>owner membership type</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type">
+ <string>validator</string>
+ </field>
+ <field name="description">
+ <string>validator membership type</string>
+ </field>
+ </object>
+ </value>
+ </collection>
+</field>]]></programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Predefined_User_Configuration-Groups">
+ <title>Groups</title>
+ <para>
+ The predefined groups are specified in the "group" field of
+ the
+ "OrganizationConfig" plugin parameter.
+ </para>
+ <programlisting role="XML"><![CDATA[<field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name">
+ <string>portal</string>
+ </field>
+ <field name="parentId">
+ <string></string>
+ </field>
+ <field name="type">
+ <string>hierachy</string>
+ </field>
+ <field name="description">
+ <string>the /portal group</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name">
+ <string>community</string>
+ </field>
+ <field name="parentId">
+ <string>/portal</string>
+ </field>
+ <field name="type">
+ <string>hierachy</string>
+ </field>
+ <field name="description">
+ <string>the /portal/community group</string>
+ </field>
+ </object>
+ </value>
+ ...
+ </collection>
+</field>]]></programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Predefined_User_Configuration-Users">
+ <title>Users</title>
+ <para>
+ The predefined users are specified in the "membershipType"
+ field of the
+ "OrganizationConfig" plugin parameter.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_adding_users_groups_and_membership_types">
- <title>Plugin for adding users, groups and membership types</title>
- <para>
- The plugin of type <literal>org.exoplatform.services.organization.OrganizationDatabaseInitializer</literal> specifies the list of users, groups and membership types to be created. The initialization parameter named "checkDatabaseAlgorithm" determines how the creation is triggered. Thus, the value "entry" means that each user, group and membership listed in the configuration is checked each time GateIn is started. If not existing, it is created. The value "empty" means that the whole list of preconfigured users, groups and memberships is processed only if the database is empty.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Membership_types">
- <title>Membership types</title>
- <para>
- The predefined membership types are specified in the "membershipType" field of the "OrganizationConfig" plugin parameter. {code} <field name="membershipType"> <collection type="java.util.ArrayList"> <value> <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType"> <field name="type"><string>member</string></field> <field name="description"><string>member membership type</string></field> </object> </value> <value> <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType"> <field name="type"><string>owner</string></field> <field name="description"><string>owner membership type</string></field> </object> </value> <value> <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType"> <field name="type"><string>valid!
ator</string></field> <field name="description"><string>validator membership type</string></field> </object> </value> </collection> </field> {code}
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Groups">
- <title>Groups</title>
- <para>
- The predefined groups are specified in the "group" field of the "OrganizationConfig" plugin parameter. {code} <field name="group"> <collection type="java.util.ArrayList"> <value> <object type="org.exoplatform.services.organization.OrganizationConfig$Group"> <field name="name"><string>portal</string></field> <field name="parentId"><string></string></field> <field name="type"><string>hierachy</string></field> <field name="description"><string>the /portal group</string></field> </object> </value> <value> <object type="org.exoplatform.services.organization.OrganizationConfig$Group"> <field name="name"><string>community</string></field> <field name="parentId"><string>/portal</string></field> <field name="type"><string>hierachy</string></field> <field name="desc!
ription"><string>the /portal/community group</string></field> </object> </value> ... </collection> </field> {code}
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Users">
- <title>Users</title>
- <para>
- The predefined users are specified in the "membershipType" field of the "OrganizationConfig" plugin parameter.
- </para>
-
-<programlisting> <field name="user">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>root</string></field>
- <field name="password"><string>exo</string></field>
- <field name="firstName"><string>root</string></field>
- <field name="lastName"><string>root</string></field>
- <field name="email"><string>exoadmin@localhost</string></field>
- <field name="groups"><string>member:/admin,member:/user,owner:/portal/admin</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>exo</string></field>
- <field name="password"><string>exo</string></field>
- <field name="firstName"><string>site</string></field>
- <field name="lastName"><string>site</string></field>
- <field name="email"><string>exo@localhost</string></field>
- <field name="groups"><string>member:/user</string></field>
- </object>
- </value>
- ...
- </collection>
- </field>
-</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_monitoring_user_creation">
- <title>Plugin for monitoring user creation</title>
- <para>
- The plugin of type <literal>org.exoplatform.services.organization.impl.NewUserEventListener</literal> specifies which groups should join all newly created users. It notably specifies the groups and memberships to be used. It also specifies a list of users that should be excepted.
- </para>
-
-<programlisting> <component-plugin>
- <name>new.user.event.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
- <description>this listener assign group and membership to a new created user</description>
- <init-params>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig">
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
- <field name="groupId"><string>/user</string></field>
- <field name="membership"><string>member</string></field>
- </object>
- </value>
- </collection>
- </field>
- <field name="ignoredUser">
- <collection type="java.util.HashSet">
- <value><string>exo</string></value>
- <value><string>root</string></value>
- <value><string>company</string></value>
- <value><string>community</string></value>
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
-</programlisting>
- </section>
+ <programlisting role="XML"><![CDATA[<field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>root</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>root</string></field>
+ <field name="lastName"><string>root</string></field>
+ <field name="email"><string>exoadmin@localhost</string></field>
+ <field name="groups"><string>member:/admin,member:/user,owner:/portal/admin</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>exo</string></field>
+ <field name="password"><string>exo</string></field>
+ <field name="firstName"><string>site</string></field>
+ <field name="lastName"><string>site</string></field>
+ <field name="email"><string>exo@localhost</string></field>
+ <field name="groups"><string>member:/user</string></field>
+ </object>
+ </value>
+ ...
+ </collection>
+</field>]]></programlisting>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_monitoring_user_creation">
+ <title>Plugin for monitoring user creation</title>
+ <para>
+ The plugin of type
+ <literal>org.exoplatform.services.organization.impl.NewUserEventListener
+ </literal>
+ specifies which groups should join all newly created users. It
+ notably specifies the groups and memberships to be used. It
+ also specifies a list of users that should be excepted.
+ </para>
+
+ <programlisting role="XML"><![CDATA[<component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <description>this listener assign group and membership to a new created user</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field name="groupId"><string>/user</string></field>
+ <field name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+ <value><string>exo</string></value>
+ <value><string>root</string></value>
+ <value><string>company</string></value>
+ <value><string>community</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+</component-plugin>]]></programlisting>
+ </section>
+
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -2,26 +2,7 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Skin_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Skin Configuration</title>
+ <title>Skin Configuration</title>
<section id="sect-Reference_Guide-Skin_Configuration-Overview">
<title>Overview</title>
<para>
@@ -32,7 +13,7 @@
<section id="sect-Reference_Guide-Skin_Configuration-Skin_Switching">
<title>Skin Switching</title>
<para>
- Skins can be switched dynamically at runtime by the <emphasis>Skin Settings</emphasis> action in <emphasis> "User Workspace" </emphasis> <!-- <link linkend="User Workspace">User Workspace</link> --> .
+ Skins can be switched dynamically at runtime.
</para>
<mediaobject>
<imageobject>
@@ -50,16 +31,15 @@
An GateIn skin contains css styles for GateIn portal's components but also shares components that may be reused in portlets. When GateIn generates a portal page markup, it inserts stylesheet links in the page's <literal>head</literal> tag.
</para>
-<programlisting><head>
+<programlisting><![CDATA[<head>
...
-<link id="CoreSkin" rel="stylesheet" type="text/css" href="/GateInResources/skin/Stylesheet.css" />
-<link id="web_FooterPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css" />
-<link id="web_NavigationPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UINavigationPortlet/DefaultStylesheet.css" />
-<link id="web_HomePagePortlet" rel="stylesheet" type="text/css" href= "/portal/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css" />
-<link id="web_BannerPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UIBannerPortlet/DefaultStylesheet.css" />
+<link id="CoreSkin" rel="stylesheet" type="text/css" href="/eXoResources/skin/Stylesheet.css" />
+<link id="web_FooterPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css" />
+<link id="web_NavigationPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UINavigationPortlet/DefaultStylesheet.css" />
+<link id="web_HomePagePortlet" rel="stylesheet" type="text/css" href= "/portal/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css" />
+<link id="web_BannerPortlet" rel="stylesheet" type="text/css" href= "/web/skin/portal/webui/component/UIBannerPortlet/DefaultStylesheet.css" />
...
-</head>
-</programlisting>
+</head>]]></programlisting>
<para>
In the snipped code above, you can see two types of links :
</para>
@@ -102,11 +82,12 @@
</listitem>
</orderedlist>
<para>
- This is revealed easily by the main portal skin stylesheets. For example <emphasis role="bold">/GateInVistaSkin/skin/Stylesheet.css</emphasis>
+ This is revealed easily by the main portal skin stylesheets. For example <emphasis role="bold">/eXoVistaSkin/skin/Stylesheet.css</emphasis>
</para>
-<programlisting>{code} @import url(/GateInResources/skin/PortletThemes/Stylesheet.css) ; @import url(VistaSkin/portal/webui/component/UIPortalApplicationSkin.css) ; @import url(VistaSkin/webui/component/Stylesheet.css) ; {code}
-</programlisting>
+<programlisting>@import url(/eXoResources/skin/PortletThemes/Stylesheet.css) ;
+@import url(VistaSkin/portal/webui/component/UIPortalApplicationSkin.css) ;
+@import url(VistaSkin/webui/component/Stylesheet.css) ;</programlisting>
</section>
<section id="sect-Reference_Guide-Skin_Configuration-Portlet_Styles">
@@ -124,18 +105,14 @@
<section id="sect-Reference_Guide-Skin_Configuration-How_to_Configure_a_Portal_Skin">
<title>How to Configure a Portal Skin</title>
- <para>
- Stuff Goes Here?
- </para>
- </section>
-
+
<section id="sect-Reference_Guide-Skin_Configuration-SkinService">
<title>SkinService</title>
<para>
The <ulink url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/webui/portal/...">SkinService</ulink> is an GateIn service that manages portal skin, portlet styles and portlet themes (windows borders). The code snippet below is an excerpt of the API offered by this service.
</para>
-<programlisting> /**
+<programlisting role="JAVA"><![CDATA[/**
* Register the stylesheet for a portal Skin.
* @param module skin module identifier
* @param skinName skin name
@@ -169,10 +146,9 @@
* @param categoryName portlet theme category
* @param themesName names of the themes
*/
- public void addTheme(String categoryName, List<String> themesName) {
+ public void addTheme(String categoryName, List<String> themesName) {
[...]
- }
-</programlisting>
+ }]]></programlisting>
<para>
Use the skin service to register your own portal skins, portlet styles and portlet themes.
</para>
@@ -184,23 +160,22 @@
GateIn provides a servlet listener that allows you to register your own skins and styles when your webapp starts up. Your first step is to add the listener to your portlet app <literal>web.xml</literal>.
</para>
-<programlisting> <web-app>
+<programlisting role="XML"><![CDATA[<web-app>
[::]
- <listener>
- <listener-class>org.exoplatform.portal.webui.skin.SkinConfigListener</listener-class>
- </listener>
+ <listener>
+ <listener-class>org.exoplatform.portal.webui.skin.SkinConfigListener</listener-class>
+ </listener>
[::]
- </web-app>
-</programlisting>
+ </web-app>]]></programlisting>
+</section>
+ <section>
+ <title>SkinConfigScript.groovy</title>
<para>
- 1.1 SkinConfigScript.groovy
+ The <literal>SkinListener</literal> looks for the groovy script file located in your war under: <filename>/WEB-INF/conf/script/groovy/SkinConfigScript.groovy</filename>
</para>
<para>
- The <tt>SkinListener</tt> looks for the groovy script file located in your war under: <filename>/WEB-INF/conf/script/groovy/SkinConfigScript.groovy</filename>
+ In this script, you have full access to the <literal>SkinService</literal> and <literal>ServletContext</literal> which are bound as scripting variables under the same name. As an example, take a look at the following script. It can be found in the <literal>GateInResources.war</literal> and is used by GateIn to register the <literal>Default</literal> portal skin and some portlet themes.
</para>
- <para>
- In this script, you have full access to the <tt>SkinService</tt> and <tt>ServletContext</tt> which are bound as scripting variables under the same name. As an example, take a look at the following script. It can be found in the <tt>GateInResources.war</tt> and is used by GateIn to register the <tt>Default</tt> portal skin and some portlet themes.
- </para>
<programlisting>SkinService.addPortalSkin("CoreSkin","Default", "/GateInResources/skin/Stylesheet.css", ServletContext);
SkinService.addTheme("Simple", ["SimpleBlue","SimpleViolet","SimpleOrange","SimplePink","SimpleGreen"]);
@@ -210,46 +185,45 @@
SkinService.addTheme("VistaStyle", ["VistaTheme","VistaBlue"]);
</programlisting>
<para>
- The syntax of addTheme() is:<!-- LB --> <tt>addTheme(String categoryName, List<String> themesName)</tt>
+ The syntax of addTheme() is: <programlisting><![CDATA[addTheme(String categoryName, List<String> themesName)]]></programlisting>
</para>
<para>
- So, to provide your own skin you could use the following: {code} SkinService.addSkin("mywebapp/MyPortlet", "MyPortalSkin", "/mywebapp/skin/Stylesheet.css", ServletContext); {code}
+ So, to provide your own skin you could use the following: <programlisting><![CDATA[SkinService.addSkin("mywebapp/MyPortlet", "MyPortalSkin", "/mywebapp/skin/Stylesheet.css", ServletContext);]]></programlisting>
</para>
<para>
- This simple line would register a styleesheet for a portlet named <tt>MyPortlet</tt> in a portlet app named <tt>mywebapp</tt>. The stylesheet would be used when a skin named <tt>MyPortalSkin</tt> is selected in portal.
+ This simple line would register a styleesheet for a portlet named <literal>MyPortlet</literal> in a portlet app named <literal>mywebapp</literal>. The stylesheet would be used when a skin named <literal>MyPortalSkin</literal> is selected in portal.
</para>
<para>
- The syntax of addSkin() is:<!-- LB --> <tt>addSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite)</tt>
+ The syntax of addSkin() is: <programlisting><![CDATA[addSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite)]]></programlisting>
</para>
<para>
- <parameter>~~overwrite~~</parameter> is optional, its default value is "false". If its value is true, the later call of addSkin() for the same skin key (combination of module + skinName) replaces the skin of the previous call.
+ <literal>overwrite</literal> is optional, its default value is "false". If its value is true, the later call of addSkin() for the same skin key (combination of module + skinName) replaces the skin of the previous call.
</para>
<para>
Similarly, to configure a particular portal you can use the following :
</para>
-<programlisting> {code} SkinService.addSkin("myportalname", "skin", "/path/to/skin/Stylesheet.css", ServletContext); {code}
-</programlisting>
+<programlisting>SkinService.addSkin("myportalname", "skin", "/path/to/skin/Stylesheet.css", ServletContext);</programlisting>
<para>
- The syntax of addPortalSkin() is:<!-- LB --> <tt>addPortalSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite)</tt>
+ The syntax of addPortalSkin() is: <programlisting><![CDATA[addPortalSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite)]]></programlisting>
</para>
+ </section>
+ </section>
+ <section>
+ <title>Tips and Tricks</title>
+ <section>
+ <title>Easier css debuggin</title>
<para>
- 1 Tips and Tricks
- </para>
- <para>
- 1.1 Easier css debugging
- </para>
- <para>
By default, CSS files are cached and their imports are merged, at the server side, into a single CSS file to reduce the number of HTTP requests from the browser to the server.
</para>
<para>
- The <tt>ServletContext</tt> parameter is there to allow the direct access to the CSS files from the <tt>SkinService</tt>. The optimization code is quite simple as all the CSS files are parsed at the server startup time and all the @import and url(...) references are rewritten to support a single flat file. The result is stored in a cache directly used from the <tt>ResourceRequestFilter</tt>.
+ The <literal>ServletContext</literal> parameter is there to allow the direct access to the CSS files from the <literal>SkinService</literal>. The optimization code is quite simple as all the CSS files are parsed at the server startup time and all the @import and url(...) references are rewritten to support a single flat file. The result is stored in a cache directly used from the <literal>ResourceRequestFilter</literal>.
</para>
<para>
- Although the optimization is useful for a production environments, you may find it easier to deactivate this optimization while debugging your stylesheets. For that, you simply need to set the java system property <tt>exo.product.developing</tt> to <tt>true</tt>.
+ Although the optimization is useful for a production environments, you may find it easier to deactivate this optimization while debugging your stylesheets. For that, you simply need to set the java system property <literal>exo.product.developing</literal> to <literal>true</literal>.
</para>
<para>
- For example, you can pass the property as a JVM parameter with the <tt>-D</tt> option in your <tt>GateIn.sh</tt> startup script: {code} EXO{code}
+ For example, you can pass the property as a JVM parameter with the <literal>-D</literal> option in your <literal>GateIn.sh</literal> startup script: {code} EXO{code}
</para>
<orderedlist numeration="arabic">
<listitem>
@@ -258,10 +232,12 @@
</para>
</listitem>
</orderedlist>
+ </section>
+ <section>
+ <title>
+ Change portlet icons
+ </title>
<para>
- 1.1 Change portlet icons
- </para>
- <para>
Each portlet is represented by an icon that you can see in the portlet registry, or the webos dock. You can change this icon by adding an image in the directory :
</para>
<itemizedlist>
@@ -281,29 +257,23 @@
</para>
</listitem>
</itemizedlist>
+ </section>
+ <section>
+ <title>
+ Set the default skin for Portal
+ </title>
<para>
- 1.1 Set the default skin for Portal
+ When not configured, the default skin of portal is Default. If you want to change this value (to Mac skin, Vista skin, or your own), add a skin tag in the <literal>portal.xml</literal> that defines your portal:
</para>
- <para>
- When not configured, the default skin of portal is Default. If you want to change this value (to Mac skin, Vista skin, or your own), add a skin tag in the <tt>portal.xml</tt> that defines your portal:
- </para>
-<programlisting><portal-config>
- <portal-name>classic</portal-name>
- <locale>en</locale>
- <factory-id>office</factory-id>
- <access-permissions>Everyone</access-permissions>
- <edit-permission>*:/platform/administrators</edit-permission>
- <skin>Mac</skin>
- <creator>root</creator>
-...
-</programlisting>
- <para>
- factory-id was removed since Portal 2.5
- </para>
- <para>
- Portal 2.6 and after will not take the order of the tags into account. Before 2.6, the order must be the same as in the example.
- </para>
+<programlisting role="XML"><![CDATA[<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <access-permissions>Everyone</access-permissions>
+ <edit-permission>*:/platform/administrators</edit-permission>
+ <skin>Mac</skin>
+ <creator>root</creator>
+...]]></programlisting>
</section>
<section id="sect-Reference_Guide-Skin_Configuration-Some_CSS_techniques">
@@ -314,7 +284,6 @@
<para>
GateIn relies heavily on CSS to create the layout and special effects for the UI. Below we explain some common techniques you may find often inside GateIn's markup. We explain them here to help you better understand GateIn generated markup, ease css issues fixing or get inspration for styling your own apps.
</para>
- </section>
<section id="sect-Reference_Guide-Skin_Configuration-Decorator_pattern">
<title>Decorator pattern</title>
@@ -322,39 +291,37 @@
The decorator is a pattern to create a contour or a curve around an area. In order to achieve this effect you need to create 9 cells. The BODY is the central area that you want to decorate. The other 8 cells are distributed around the BODY cell. You can use the width, height and background image properties to achieve any decoration effect that you want.
</para>
-<programlisting>
-~UWC_TOKEN_START~1255420331338~UWC_TOKEN_END~
+<programlisting role="HTML"><![CDATA[
+-----------------------------------------------------------------------
| | | |
| TopLeft | TopCenter | TopRight |
| | | |
-----
+-----------------------------------------------------------------------
| | | |
-| | | |
| CenterLeft | BODY | CenterRight |
| | | |
+-----------------------------------------------------------------------
| | | |
-~UWC_TOKEN_START~1255420331340~UWC_TOKEN_END~
-| | | |
| BottomLeft | BottomCenter | BottomRight |
| | | |
-~UWC_TOKEN_START~1255420331341~UWC_TOKEN_END~
-<div class="Parent">
- <div class="TopLeft">
- <div class="TopRight">
- <div class="TopCenter"><span></span></div>
- </div>
- </div>
- <div class="CenterLeft">
- <div class="CenterRight">
- <div class="CenterCenter">BODY</div>
- </div>
- </div>
- <div class="BottomLeft">
- <div class="BottomRight">
- <div class="BottomCenter"><span></span></div>
- </div>
- <div>
-</div>
+-----------------------------------------------------------------------
+<div class="Parent">
+ <div class="TopLeft">
+ <div class="TopRight">
+ <div class="TopCenter"><span></span></div>
+ </div>
+ </div>
+ <div class="CenterLeft">
+ <div class="CenterRight">
+ <div class="CenterCenter">BODY</div>
+ </div>
+ </div>
+ <div class="BottomLeft">
+ <div class="BottomRight">
+ <div class="BottomCenter"><span></span></div>
+ </div>
+ <div>
+</div>]]>
</programlisting>
</section>
@@ -364,24 +331,24 @@
Left margin left pattern is a technique to create 2 blocks side by side. The left block will have a fixed size and the right block will take the rest of the available space. When the user resizes the browser the added or removed space will be taken from the right block.
</para>
-<programlisting>~UWC_TOKEN_START~1255420331342~UWC_TOKEN_END~
+<programlisting role="HTML"><![CDATA[
| | |
| | |
-| |<--- fixed width --->| | will expand to right ----> |
+| |<--- fixed width --->| | will expand to right ----> |
| | |
| | |
| | |
----
-<div class="Parent">
- <div style="float: left; width: 100px">
- </div>
- <div style="margin-left: 105px;">
- <div>
- <div style="clear: left"><span></span></div>
-</div>
-</programlisting>
+<div class="Parent">
+ <div style="float: left; width: 100px">
+ </div>
+ <div style="margin-left: 105px;">
+ <div>
+ <div style="clear: left"><span></span></div>
+</div>]]></programlisting>
</section>
-
+ </section>
+ </section>
<section id="sect-Reference_Guide-Skin_Configuration-How_to_create_a_new_skin">
<title>How to create a new skin</title>
<para>
@@ -403,7 +370,7 @@
Finally, you have to definy the name of new skin and the image preview for the <emphasis>Skin Settings</emphasis> action in <emphasis> "User Workspace" </emphasis> <!-- <link linkend="User Workspace">User Workspace</link> -->.
</para>
<para>
- By default, if you don not set new name for skin, its name is <t>label></tt>. Looking in the file and add yout new name here.
+ By default, if you don not set new name for skin, its name is <literal>label></literal>. Looking in the file and add yout new name here.
</para>
<programlisting>
@@ -434,7 +401,7 @@
}
</programlisting>
<para>
- And now, you copy your image <literal>MyPortal.jpg</literal> (that you definy above) to the folder <literal>ressource/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/background</literal> and test your new skin.
+ And now, you copy your image <literal>MyPortal.jpg</literal> (that you defined above) to the folder <literal>ressource/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/background</literal> and test your new skin.
</para>
</section>
@@ -444,16 +411,12 @@
Firstly, you have to definy the new theme in <literal>WEB-INF/conf/script/groovy/SkinConfigScript.groovy</literal> in your <literal>Ressource</literal> (for example, in the project MyPortal, you can put it in <literal>GateInResourcesCp060508</literal>).
</para>
-<programlisting>
-SkinService.addTheme("MyPortal-MacTheme", ["MacGray","MacBlue","MacBlack"]);
-</programlisting>
+<programlisting>SkinService.addTheme("MyPortal-MacTheme", ["MacGray","MacBlue","MacBlack"]);</programlisting>
<para>
Secondly, you put all your new theme into <literal>folder skinyourSkin</literal> and create new file <literal>Stylesheet.css</literal> here. In this file, you will import all links to your CSS. For example in MyPortal project.
</para>
-<programlisting>
-@import url(MyPortalSkin/PortletThemes/Stylesheet.css) ;
-</programlisting>
+<programlisting>@import url(MyPortalSkin/PortletThemes/Stylesheet.css) ;</programlisting>
<para>
You can see here, in the <literal>GateInResourcesCp060508/skin/MyPortalSkin/PortletThemes/Stylesheet.css</literal>, you put all your CSS of new theme.
</para>
Deleted: portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -1,99 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
-<section id="sect-Reference_Guide-User_Workspace_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --> <title>User Workspace Configuration</title>
- <section id="sect-Reference_Guide-User_Workspace_Configuration-Overview">
- <title>Overview</title>
- <para>
- The User Workspace is give privileged users access to administration actions. Please refer to the <emphasis>"User Workspace"</emphasis> <!-- <link linkend="Portal:User Workspace">User Workspace Guide</link> --> to know more details.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-User_Workspace_Configuration-Default_Configuration">
- <title>Default Configuration</title>
- <para>
- The default configuration defines two groups:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <code>:/platform/administrators</code> and
- </para>
- </listitem>
- <listitem>
- <para>
- <code>:/platform/organization/management/executive-board</code>
- </para>
- </listitem>
- </itemizedlist>
- <para>
- anyone in these groups can access and use the User Workspace. The asterisk symbol stands for "any membership type".
- </para>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- user that wants to access the User Workspace he or she a member of at least one of these groups with the appropriate membership.
- </para>
- </listitem>
- </orderedlist>
- </section>
-
- <section id="sect-Reference_Guide-User_Workspace_Configuration-Customize_the_Configuration">
- <title>Customize the Configuration</title>
- <para>
- If an administrator wants to allow someone to access the User Workspace, the admin can add the user to one of these groups or he or she modifies the workspace access configuration. This permission is set in the <emphasis>portal-configuration.xml</emphasis> file.
- </para>
-
-<programlisting> <component>
- <key>org.exoplatform.portal.config.UserACL</key>
- <type>org.exoplatform.portal.config.UserACL</type>
- <init-params>
-...
-<value-param>
- <name>access.control.workspace</name>
- <description>groups with memberships that have the right to access the User Control Workspace</description>
- <value>*:/platform/administrators,*:/organization/management/executive-board</value>
-</value-param>
-</programlisting>
- <para>
- Modify the content of the <code>value</code> tag depending on your needs. The configuration is taken into account after you restarted the application server.
- </para>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- info(" Remember to specify the groups in <code>organization-configuration.xml</code>" )
- </para>
- </listitem>
- </orderedlist>
- </section>
-
- <section id="sect-Reference_Guide-User_Workspace_Configuration-Related_links">
- <title>Related links</title>
- <para>
- Please refer to <emphasis>"User Workspace"</emphasis> <!-- <link linkend="Portal:User Workspace">User Workspace Guide</link> --> to see the user workspace.
- </para>
- </section>
-
-</section>
-
-
Deleted: portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
+++ portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml 2009-12-09 17:56:51 UTC (rev 982)
@@ -1,464 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
-<section id="sect-Reference_Guide-Varnish_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Varnish Configuration</title>
- <section id="sect-Reference_Guide-Varnish_Configuration-Introduction">
- <title>Introduction</title>
- <para>
- This document is an overview of Varnish configuration for GateIn SEA Portal. It is organized as follows:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Section one gives an introduction to Varnish software (version 1.1.2)
- </para>
- </listitem>
- <listitem>
- <para>
- Section two explains how to install it, we are using Linux kernel version 2.6.27.
- </para>
- </listitem>
- <listitem>
- <para>
- The third section gives a brief description of Varnish configuration files for GateIn Portal
- </para>
- </listitem>
- <listitem>
- <para>
- Whereas the last one discusses some of the practical issues encountered during the deployment of Varnish, the last section analyzes the speed gain by Varnish.
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The configuration given below is more convenient for static content such as images, css ,javascript and html files. By this way after modifying an object belonging to static content you must refresh the varnish cache. To do this, first off all, connect to varnish administration port, it can easily be done this way: <emphasis>telnet localhost 6083</emphasis> ( <emphasis role="bold">Note:</emphasis><emphasis>this command should be typed on the machine where Varnish is installed</emphasis> ). And then write the following in the command line. <emphasis>url.purge ^/$</emphasis> This purge your <emphasis>/</emphasis> document. As you can see that <emphasis>url.purge</emphasis> takes an regular expression as its argument. Hence the <emphasis>^</emphasis> and <emphasis>$</emphasis> at the front and end. If the <emphasis>^</emphasis> is omitted, all the documents ending in a <emphasis>/</emphasis> in the cache would be deleted. So to delete all the documents in the cache, type in!
the command line.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Overview">
- <title>Overview</title>
- <para>
- Varnish is a HTTP/web accelerator, it was written from the beginning to be a high-performance open source reverse proxy caching implementation. Varnish, like other caching reverse HTTP proxy implementations, is most frequently used to alleviate/reduce origin web servers of undue load, giving you the ability to handle a higher number of concurrent hits.
- </para>
- <para>
- Nowadays, more and more web sites present dynamic web pages consisting of a number of different elements. Combining these elements is both time consuming and CPU intensive. The bad news is that the same process is repeated for every individual user, even when the content is identical. Fortunately in such a case a solution like Varnish can help to improve web server performance. How can Varnish accomplish this? Varnish temporarily stores the most frequently requested pages in its cache. It is more effective to present these pages from the Varnish cache. Therefore, users are offered an improved service, and Content/Document Management System server requirements are reduced.
- </para>
- <para>
- Why are we using Varnish? In contrast with other HTTP accelerators, many of which began life as client-side proxies or origin servers, Varnish was designed from the scratch as an accelerator for incoming traffic. In addition, Varnish via his DSL (Domain Specific Language) is very flexible. In fact, this way, it provides users not only with a means of modifying and rewriting client requests or in certain cases server responses. But Varnish also enable the user to load multiple configurations concurrently. So users can instantaneously switch from one VCL (Varnish Configuration Language) to another. It is not all, Varnish TTL (Time to Live) parameter enables users to decide how long an object should be cached.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Installation_of_Varnish">
- <title>Installation of Varnish</title>
- <para>
- Stuff Goes Here?
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Prerequisite">
- <title>Prerequisite</title>
- <para>
- Before building Varnish, make sure that the following tools are installed :
- </para>
- <itemizedlist>
- <listitem>
- <para>
- GCC compiler
- </para>
- </listitem>
- <listitem>
- <para>
- A POSIX-compatible make
- </para>
- </listitem>
- <listitem>
- <para>
- GNU autotools (automake, autoconf, libtool, ncurses)
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Installation">
- <title>Installation</title>
- <para>
- If you are using a system with a graphical user interface, installation of Varnish 1.1.2 is quite easy via synaptic package manager. If not, you can run in a terminal by the following command to install Varnish on your computer:
- </para>
-
-<programlisting>sudo apt-get install varnish
-</programlisting>
- <para>
- You can also install Varnish from source, see the following web site for more information:
- </para>
- <para>
- <ulink type="http" url="http://varnish.projects.linpro.no">http://varnish.projects.linpro.no</ulink>.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Varnish_configuration_for_GateIn_Portal">
- <title>Varnish configuration for GateIn Portal</title>
- <para>
- Varnish uses Varnish Configuration Language (VCL). The VCL language is a small domain-specific language designed to be used to define request handling and document caching policies for the Varnish HTTP accelerator. When a new configuration is loaded, the varnished management process translates the VCL code to C and compiles it to a shared object which is then dynamically linked into the server process.
- </para>
- <para>
- Installation of Varnish automatically create two files named default.vcl and varnish in the repositories <emphasis>/etc/varnish/</emphasis> and <emphasis>/etc/default</emphasis> respectively. One is VCL and another one contains values that will be passed as parameters to <emphasis>varnished</emphasis> . We will not make use of the first one, that is default.vcl. Create a new file named vcl.conf in /etc/varnish with the following contents:
- </para>
- <para>
- Backend declaration, here we need to specify the web server host name and the listening http port.
- </para>
-
-<programlisting>backend default {
- set backend.host = "127.0.0.1";
- set backend.port = "8080";
-}
-#
-## Called when a client request is received
-#
-sub vcl_recv {
- if (req.url ~ "^/$") {
- set req.url = regsub(req.url,"^/$","/portal");
- set req.http.Accept-Language = "vi";
- }
- if (req.url ~ ".*vnwebsite.*"){
- set req.http.Accept-Language = "vi";
- } else {
- set req.http.Accept-Language = "en";
- }
- if (req.request!images/= "GET" && req.request!images/ = "HEAD") {
- pipe;
- }
- if (req.http.Expect) {
- pipe;
- }
- if (req.request == "GET" && req.url ~ "\.(jpg|jpeg|gif|ico|tiff|tif|svg|css|js|html)$") {
- set req.url = regsub(req.url, "\?.*", "");
- remove req.http.cookie;
- remove req.http.authenticate;
- lookup;
- }
- if (req.http.Authenticate || req.http.Authorization) {
- pass;
- }
- if (req.http.Cache-Control ~ "no-cache") {
- set req.http.Cache-Control = regsub(req.http.Cache-Control, "no-cache", "set-cookie2");
- }
- # force lookup even when cookies are present
- if (req.request == "GET" && req.http.cookie) {
- lookup;
- }
- lookup;
-}
-</programlisting>
- <para>
- In order to specify the default language for each web site, that is Vietnamese (vi) for vnwebsite and English (en) for enwebsite; the following statement <emphasis>set req.http.Accept-Language = "language code"</emphasis> is useful.
- </para>
-
-<programlisting>#
-## Called when entering pipe mode
-#
-sub vcl_pipe {
- pipe;
-}
-#
-## Called when entering pass mode
-#
-sub vcl_pass {
- pass;
-}
-#
-## Called when the requested object was found in the cache
-#
-sub vcl_hit {
- if (req.url ~ ".*vnwebsite.*"){
- set req.http.Accept-Language = "vi";
- } else {
- set req.http.Accept-Language = "en";
- }
- deliver;
-}
-## Called when the requested object has been retrieved from the
-## backend, or the request to the backend has failed
-sub vcl_fetch {
- if (!obj.valid) {
- error;
- }
- if (req.url ~ ".*vnwebsite.*"){
- set req.http.Accept-Language = "vi";
- } else {
- set req.http.Accept-Language = "en";
- }
- if (req.http.Cache-Control ~ "no-cache") {
- set req.http.Cache-Control = regsub(req.http.Cache-Control, "no-cache", "set-cookie2");
- }
- if(obj.cacheable){
- remove req.http.Set-Cookie;
- set obj.http.Cache-Control = "no-cache";
- remove obj.http.Etag;
- if(obj.ttl < 7d){
- set obj.ttl = 7d;
- }
- insert;
- }
- insert;
-}
-</programlisting>
- <para>
- If the cookie is intended for use by a single user, the Set-Cookie2 header <emphasis>should not</emphasis> be cached. A Set-Cookie2 header that is intended to be shared by multiple users <emphasis role="bold">may</emphasis> be cached.
- </para>
- <note>
- <title>Note</title>
- <para>
- Since <emphasis role="bold">Etag</emphasis> (entity tag) in an HTTP response header that may be returned by an HTTP/1.1 compliant web server is used by the user-agent to determine change in content at a given URL. It is removed in order to instruct the user-agent that there is no change in content of cacheable objects. In fact, when a new HTTP response contains the same ETag as an older HTTP response, the client can conclude that the content is the same without further downloading.
- </para>
- </note>
-
-<programlisting>## Called before a cached object is delivered to the client
-sub vcl_deliver {
- deliver;
-}
-## Called when an object nears its expiry time
-sub vcl_timeout {
- discard;
-}
-## Called when an object is about to be discarded
-sub vcl_discard {
- discard;
-}
-</programlisting>
- <para>
- This configuration tells Varnish to always cache all cacheable objects and don't invalidate them for at least one week.
- </para>
- <para>
- Then modify the file <emphasis>/etc/default/varnish</emphasis> and make yourself sure that its content is not too different to this one, particularly the DAEMONOPTS part. Note that we are using the advanced configuration, that is alternative 3.
- </para>
-
-<programlisting># Configuration file for varnish
-#
-# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this
-# shell script fragment.
-#
-# Maximum number of open files (for ulimit -n)
-NFILES=131072
-# Default varnish instance name is the local nodename. Can be overridden with
-# the -n switch, to have more instances on a single server.
-INSTANCE=$(uname -n)
-## Alternative 3, Advanced configuration
-## We choose advance configuration
-#
-# See varnishd(1) for more information.
-#
-# # Main configuration file. You probably want to change it :)
-VARNISH_VCL_CONF=/etc/varnish/default.vcl
-#
-# # Default address and port to bind to
-# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
-# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
-VARNISH_LISTEN_ADDRESS=0.0.0.0
-VARNISH_LISTEN_PORT=80
-#
-# # Telnet admin interface listen address and port
-VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
-VARNISH_ADMIN_LISTEN_PORT=6082
-#
-# # The minimum number of worker threads to start
-VARNISH_MIN_THREADS=1
-#
-# # The Maximum number of worker threads to start
-VARNISH_MAX_THREADS=2048
-#
-# # Idle timeout for worker threads
-VARNISH_THREAD_TIMEOUT=120
-#
-# # Cache file location
-VARNISH_STORAGE_FILE=/var/lib/varnish/$INSTANCE/varnish_storage.bin
-#
-# # Cache file size: in bytes, optionally using k / M / G / T suffix,
-# # or in percentage of available disk space using the % suffix.
-VARNISH_STORAGE_SIZE=5G
-#
-# # Backend storage specification
-VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"
-#
-# # Default TTL used when the backend does not specify one
-VARNISH_TTL=7d
-#
-# # DAEMON_OPTS is used by the init script. If you add or remove options, make
-# # sure you update this section, too.
-DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
- -f ${VARNISH_VCL_CONF} \
- -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
- -t ${VARNISH_TTL} \
- -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
- -s ${VARNISH_STORAGE}"
-</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-How_fast_is_Varnish">
- <title>How fast is Varnish?</title>
- <para>
- When using an HTTP accelerator, it is important to know whether our web server performance has improved or not. Thus, this section shows the performance gained by the use of Varnish.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Varnish_testbed_configuration">
- <title>Varnish testbed configuration</title>
- <para>
- Our Varnish testbed consists of a desktop PC acting as a web server (WS), and 10 PC-based Linux acting as clients stations. The system hardware configuration is summarized in the following table. All machines except the WS use a Linux 2.6.27 kernel. The user-agent used on client stations is <emphasis role="bold">wget</emphasis>
- </para>
- <para>
- The following table is the testbed summary:
- </para>
- <informaltable colsep="0" frame="none" rowsep="0">
- <tgroup cols="3">
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <tbody>
- <row>
- <entry>
- <emphasis role="bold"> Hardware </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Processor </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Frequency </emphasis>
- </entry>
- </row>
- <row>
- <entry>
- One x (WS)
- </entry>
- <entry>
- Intel(R) Pentium(R) 4
- </entry>
- <entry>
- 3.00GHz
- </entry>
- </row>
- <row>
- <entry>
- Two x (PC)
- </entry>
- <entry>
- Intel(R) Core(TM)2 Duo
- </entry>
- <entry>
- 2.00GHz
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <para>
- It is well known that performance of a software like varnish depends on part on the communication link between server host and client stations. So, without loss of generality, we assume that our wireless connection is fair.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Varnish_analyzes_method">
- <title>Varnish analyzes method</title>
- <para>
- In other to evaluate Vanish performance, we first access all pages of our web site through Varnish to ensure that all cacheable objects can be found in Varnish cache. It takes in average 6.9s. Then we simultaneously send 100 download requests from each of our 2 client stations to the web server using wget user-agent through Varnish. After this operation, we evaluate the average time required by each client station to perform a download request. The same process is done without using Varnish. We then compare the obtained results.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Varnish_Configuration-Varnish_performance_analyzes">
- <title>Varnish performance analyzes</title>
- <para>
- This part discuss about Varnish performance in term of time of response. That is the time that a given client should wait to get the requested object (or the server response). In this case the requested object is our entire web site. The collected measurements are summarized in the below table:
- </para>
- <informaltable colsep="0" frame="none" rowsep="0">
- <tgroup cols="5">
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <tbody>
- <row>
- <entry>
- <emphasis role="bold"> Host </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Average waiting time using Varnish as reverse proxy </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Average waiting time without use of Varnish </emphasis>
- </entry>
- <entry>
- <emphasis role="bold">Number of trials </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Data size </emphasis>
- </entry>
- </row>
- <row>
- <entry>
- First
- </entry>
- <entry>
- 02. 791070
- </entry>
- <entry>
- 26.889563
- </entry>
- <entry>
- 100
- </entry>
- <entry>
- 104 files, 1.4M
- </entry>
- </row>
- <row>
- <entry>
- Second
- </entry>
- <entry>
- 02.708190
- </entry>
- <entry>
- 26. 378669
- </entry>
- <entry>
- 100
- </entry>
- <entry>
- 104 files, 1.4M
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <note>
- <title>Note</title>
- <para>
- All times above are in second, these times include the time needed by the client to connect to the server.
- </para>
- </note>
- <para>
- Measurements listed above obviously shows that our web server performance are considerably improved by the use of Varnish software. In average per user request, we gain from Varnish 24 (twenty-four) seconds. That is using Varnish, user requests are at least 10 times faster than previously (without Varnish).
- </para>
- </section>
-
-</section>
-
-
15 years
gatein SVN: r981 - in portal/branches/wsrp-integration: web/portal/src/main/webapp/WEB-INF/conf/jcr and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-09 09:50:00 -0500 (Wed, 09 Dec 2009)
New Revision: 981
Added:
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
Log:
- Added JCR nodetype definition for producer-side consumer registrations.
- Added MappedBy annotations to ConsumersAndGroupsMapping.
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-09 13:07:58 UTC (rev 980)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-09 14:50:00 UTC (rev 981)
@@ -33,19 +33,20 @@
* @version $Revision$
*/
@NodeMapping(name = ConsumersAndGroupsMapping.NODE_NAME)
-public abstract class ConsumersAndGroupsMapping
-{
- public static final String NODE_NAME = "wsrp:consumersandgroups";
+public abstract class ConsumersAndGroupsMapping {
+ public static final String NODE_NAME = "wsrp:consumersandgroups";
- @OneToMany
- public abstract Map<String, ConsumerMapping> getConsumers();
+ @OneToMany
+ @MappedBy("consumers")
+ public abstract Map<String, ConsumerMapping> getConsumers();
- @OneToMany
- public abstract Map<String, ConsumerGroupMapping> getConsumerGroups();
+ @OneToMany
+ @MappedBy("consumergroups")
+ public abstract Map<String, ConsumerGroupMapping> getConsumerGroups();
- @Create
- public abstract ConsumerMapping createConsumer(String id);
+ @Create
+ public abstract ConsumerMapping createConsumer(String id);
- @Create
- public abstract ConsumerGroupMapping createConsumerGroup(String name);
+ @Create
+ public abstract ConsumerGroupMapping createConsumerGroup(String name);
}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-09 13:07:58 UTC (rev 980)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-09 14:50:00 UTC (rev 981)
@@ -21,113 +21,114 @@
-->
<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>war:/conf/jcr/repository-configuration.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="persister-class-name"
- value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- </properties-param>
- </init-params>
- </component>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="${dialect}"/>
+ </properties-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
- </component>
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="portal-system"/>
+ </properties-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
- <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
- <init-params>
+ <component>
+ <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
+ <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
+ <init-params>
- <value-param>
- <name>auto-mix-lockable</name>
- <value>false</value>
- </value-param>
+ <value-param>
+ <name>auto-mix-lockable</name>
+ <value>false</value>
+ </value-param>
- <value-param>
- <name>def-folder-node-type</name>
- <value>nt:folder</value>
- </value-param>
+ <value-param>
+ <name>def-folder-node-type</name>
+ <value>nt:folder</value>
+ </value-param>
- <value-param>
- <name>def-file-node-type</name>
- <value>nt:file</value>
- </value-param>
+ <value-param>
+ <name>def-file-node-type</name>
+ <value>nt:file</value>
+ </value-param>
- <value-param>
- <name>def-file-mimetype</name>
- <value>text/plain</value>
- </value-param>
+ <value-param>
+ <name>def-file-mimetype</name>
+ <value>text/plain</value>
+ </value-param>
- <value-param>
- <name>update-policy</name>
- <value>create-version</value>
- </value-param>
- </init-params>
- </component>
+ <value-param>
+ <name>update-policy</name>
+ <value>create-version</value>
+ </value-param>
+ </init-params>
+ </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/ext-nodetypes-config.xml</value>
- <value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
- <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
- <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ <value>jar:/conf/organization-nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
+ <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-09 13:07:58 UTC (rev 980)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-09 14:50:00 UTC (rev 981)
@@ -21,113 +21,114 @@
-->
<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>war:/conf/jcr/repository-configuration.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="persister-class-name"
- value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- </properties-param>
- </init-params>
- </component>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persister-class-name"
+ value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="source-name" value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ </component>
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
- </component>
+ <component>
+ <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
+ <init-params>
+ <properties-param>
+ <name>locations</name>
+ <property name="repository" value="portal-system"/>
+ </properties-param>
+ </init-params>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
- <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
- </component>
+ <component>
+ <key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
+ <type>org.exoplatform.services.jcr.ext.hierarchy.impl.NodeHierarchyCreatorImpl</type>
+ </component>
- <component>
- <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
- <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
- <init-params>
+ <component>
+ <key>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</key>
+ <type>org.exoplatform.services.jcr.webdav.WebDavServiceImpl</type>
+ <init-params>
- <value-param>
- <name>auto-mix-lockable</name>
- <value>false</value>
- </value-param>
+ <value-param>
+ <name>auto-mix-lockable</name>
+ <value>false</value>
+ </value-param>
- <value-param>
- <name>def-folder-node-type</name>
- <value>nt:folder</value>
- </value-param>
+ <value-param>
+ <name>def-folder-node-type</name>
+ <value>nt:folder</value>
+ </value-param>
- <value-param>
- <name>def-file-node-type</name>
- <value>nt:file</value>
- </value-param>
+ <value-param>
+ <name>def-file-node-type</name>
+ <value>nt:file</value>
+ </value-param>
- <value-param>
- <name>def-file-mimetype</name>
- <value>text/plain</value>
- </value-param>
+ <value-param>
+ <name>def-file-mimetype</name>
+ <value>text/plain</value>
+ </value-param>
- <value-param>
- <name>update-policy</name>
- <value>create-version</value>
- </value-param>
- </init-params>
- </component>
+ <value-param>
+ <name>update-policy</name>
+ <value>create-version</value>
+ </value-param>
+ </init-params>
+ </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
- <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
- <!-- WSRP namespace -->
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/ext-nodetypes-config.xml</value>
- <value>jar:/conf/organization-nodetypes.xml</value>
- <value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
- <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
- <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="wsrp" value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ <!-- WSRP namespace -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/ext-nodetypes-config.xml</value>
+ <value>jar:/conf/organization-nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
+ <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+ <value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Added: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml (rev 0)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2009-12-09 14:50:00 UTC (rev 981)
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This 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; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:consumersandgroups" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="consumers" defaultPrimaryType="wsrp:consumer"
+ autoCreated="true" mandatory="false" onParentVersion="COPY" protected="false"
+ sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="consumergroups" defaultPrimaryType="wsrp:consumergroup"
+ autoCreated="true" mandatory="false" onParentVersion="COPY" protected="false"
+ sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumergroup</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:consumer" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="id" requiredType="String" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="consumeragent" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="String"
+ autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="group" requiredType="Path" autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
+ protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:registration" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registration</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="capabilities" defaultPrimaryType="wsrp:consumercapabilities" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumercapabilities</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registration" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="status" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="registrationhandle" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="consumer" requiredType="Path" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="properties" defaultPrimaryType="wsrp:registrationproperties" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registrationproperties</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperties" isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="wsrp:consumergroup" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="String"
+ autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:consumer" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
15 years
gatein SVN: r980 - in portal/trunk/docs/reference-guide/en/modules: gadgets and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 08:07:58 -0500 (Wed, 09 Dec 2009)
New Revision: 980
Modified:
portal/trunk/docs/reference-guide/en/modules/SSO.xml
portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml
portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml
Log:
More cleanup/fix
Modified: portal/trunk/docs/reference-guide/en/modules/SSO.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/SSO.xml 2009-12-09 12:27:57 UTC (rev 979)
+++ portal/trunk/docs/reference-guide/en/modules/SSO.xml 2009-12-09 13:07:58 UTC (rev 980)
@@ -1,102 +1,100 @@
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/sgml/4.4/docbookx.dtd">
<chapter>
-<title>Single Sign On</title>
-
+ <title>Single Sign On</title>
+
<section>
- <title>Overview of SSO</title>
- <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
- the portal you gain access to many systems through portlets using a single identity. Still in many cases you
- need to integrate the portal infrastructure with other SSO enabled systems. There are many different Identity Management
- solutions on the market. In most cases each SSO framework provides its own way to plug into Java EE application.
- </para>
+ <title>Overview of SSO</title>
+ <para>Portal as an integration and aggregation platform provides
+ some form of SSO by itself. When you log into
+ the portal you gain access to many systems through portlets using a
+ single identity. Still in many cases you
+ need to integrate the portal infrastructure with other SSO enabled
+ systems. There are many different Identity Management
+ solutions on the market. In most cases each SSO framework provides its own way
+ to plug into Java EE application.
+ </para>
</section>
-
+
<section>
<title>CAS - Central Authentication Service</title>
- <para>This Single Sign On plugin enables seamless integration between GateIn Portal and the CAS Single Sign On Framework.
- Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink>
+ <para>
+ This Single Sign On plugin enables seamless integration between
+ GateIn Portal and the CAS Single Sign On Framework.
+ Details
+ about CAS can be found
+ <ulink url="http://www.ja-sig.org/products/cas/">here</ulink>
</para>
<section>
<title>Integration</title>
<section>
- <title>From source</title>
- <itemizedlist>
- <listitem>
- <para>
- Check out the GateIn SSO component from SVN using the following command:
- <programlisting>
+ <title>From source</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Check out the GateIn SSO component from SVN using
+ the following command:
+ <programlisting>
<![CDATA[
svn co http://anonsvn.jboss.org/repos/gatein/components/sso/tags/<appropriate sso component version>
]]>
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- Update <emphasis>packaging/profiles.xml</emphasis> to reflect the directories where your local JBoss AS 5.1.0.GA and Tomcat 6.0.2 are installed
- </para>
- </listitem>
- </itemizedlist>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Update
+ <emphasis>packaging/profiles.xml</emphasis>
+ to reflect the directories where your local JBoss
+ AS 5.1.0.GA and Tomcat 6.0.2 are installed
+ </para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
- <title>Install CAS plugin into a designated CAS (3.3.4) server</title>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting>
+ <title>Install CAS plugin into a designated CAS (3.3.4)
+ server</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting>
<![CDATA[
mvn -Pplugin-cas-install install
]]>
- </programlisting>
- </para>
- </listitem>
- </itemizedlist>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
- <title>Install CAS GateIn Agent into the designated GateIn server</title>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting>
+ <title>Install CAS GateIn Agent into the designated GateIn
+ server</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting>
<![CDATA[
mvn -Pgatein-cas-install install
]]>
- </programlisting>
- </para>
- </listitem>
- </itemizedlist>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
</section>
</section>
<section>
- <title>CAS Server Plugin Configuration</title>
- <para>
- The CAS Server Plugin makes secure authentication callbacks to a RESTful service installed on the remote GateIn server in order to authenticate a user.
- In order for the plugin to function correctly, it needs to be properly configured to connect to this service. This configuration is done via the
- <emphasis>cas.war/WEB-INF/deployerConfigContext.xml</emphasis> file.
- </para>
- <para>
- <programlisting>
+ <title>CAS Server Plugin Configuration</title>
+ <para>
+ The CAS Server Plugin makes secure authentication callbacks
+ to a RESTful service installed on the remote GateIn server
+ in order to authenticate a user.
+ In order for the plugin to function correctly, it needs to be properly
+ configured to connect to this service. This configuration is
+ done via the
+ <emphasis>cas.war/WEB-INF/deployerConfigContext.xml</emphasis>
+ file.
+ </para>
+ <para>
+ <programlisting>
<![CDATA[
<!--
Note: Modify the Plugin Configuration based on the actual information of a GateIn instance.
@@ -108,32 +106,36 @@
<property name="gateInContext"><value>portal</value></property>
</bean>
]]>
- </programlisting>
- </para>
+ </programlisting>
+ </para>
</section>
<section>
- <title>GateIn Agent Configuration</title>
- <para>
- In a Single Sign On usecase, the GateIn server re-directs all "private" resource requests to the CAS server for authentication first. The CAS server can be
- located anywhere on the Internet, and this information must be properly configured within the GateIn instance. This configuration needs to be done in 3 files
- <itemizedlist>
- <listitem>
- <emphasis>gatein.ear/02portal.war/groovy/portal/webui/UILoginForm.gtmpl</emphasis>
- <para>
- <programlisting>
+ <title>GateIn Agent Configuration</title>
+ <para>
+ In a Single Sign On usecase, the GateIn server re-directs
+ all "private" resource requests to the CAS server for
+ authentication first. The CAS server can be
+ located anywhere on the Internet, and this information must be properly
+ configured within the GateIn instance. This configuration
+ needs to be done in 3 files
+ <itemizedlist>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/groovy/portal/webui/UILoginForm.gtmpl</emphasis>
+ <para>
+ <programlisting>
<![CDATA[
<script>
<%=uicomponent.event("Close");%>
window.location = 'http://localhost:8888/cas/login?service=http://localhost:8080/portal/priv...';
</script>
]]>
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <emphasis>gatein.ear/02portal.war/login/jsp/login.jsp</emphasis>
- <para>
- <programlisting>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/login/jsp/login.jsp</emphasis>
+ <para>
+ <programlisting>
<![CDATA[
<html>
<head>
@@ -145,13 +147,13 @@
</body>
</html>
]]>
- </programlisting>
- </para>
- </listitem>
- <listitem>
- <emphasis>gatein.ear/02portal.war/WEB-INF/web.xml</emphasis>
- <para>
- <programlisting>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/WEB-INF/web.xml</emphasis>
+ <para>
+ <programlisting>
<![CDATA[
<servlet>
<servlet-name>InitiateLoginServlet</servlet-name>
@@ -162,12 +164,12 @@
</init-param>
</servlet>
]]>
- </programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
-
- </section>
- </section>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ </section>
+ </section>
</chapter>
\ No newline at end of file
Modified: portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml 2009-12-09 12:27:57 UTC (rev 979)
+++ portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml 2009-12-09 13:07:58 UTC (rev 980)
@@ -2,138 +2,129 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Gadgets">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Gadgets</title>
- <section id="sect-Reference_Guide-Gadgets-Overview">
- <title>Overview</title>
- <para>
- An gadget is a mini web application running on a platform and you can put it in a web page. This is a small application that helps users to do some private actions.
+ <title>Gadgets</title>
+ <section id="sect-Reference_Guide-Gadgets-Overview">
+ <title>Overview</title>
+ <para>
+ An gadget is a mini web application running on a platform and you can
+ put it in a web page. This is a small application that helps
+ users to do some private actions.
</para>
- <para>
- GateIn Portal supports some gadgets such as: Todo gadget, Calendar gadget, Calculator gadget, Weather Forecasts, RSS Reader gadget.
+ <para>
+ GateIn Portal supports some gadgets such as: Todo gadget, Calendar gadget,
+ Calculator gadget, Weather Forecasts, RSS Reader gadget.
</para>
- <itemizedlist>
- <listitem>
- <para>
- Todo: This mini - application helps you to organize your day and work group.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Todo: This mini - application helps you to organize your day and work
+ group.
</para>
- </listitem>
- <listitem>
- <para>
- Calendar: A cool calendar to keep track of date in style.
+ </listitem>
+ <listitem>
+ <para>
+ Calendar: A cool calendar to keep track of date in style.
</para>
- </listitem>
- <listitem>
- <para>
- Calculator: This is the coolest calculator for your page.
+ </listitem>
+ <listitem>
+ <para>
+ Calculator: This is the coolest calculator for your page.
</para>
- </listitem>
- <listitem>
- <para>
- RSS Reader: This gadget lets you het a sneak preview of your favourite feeds around web
+ </listitem>
+ <listitem>
+ <para>
+ RSS Reader: This gadget lets you het a sneak preview of your favourite
+ feeds around web
</para>
- </listitem>
- <listitem>
- <para>
- Weather Forecasts: This gadget notifies you of current weather condition and gives tomorrow's forecast.
+ </listitem>
+ <listitem>
+ <para>
+ Weather Forecasts: This gadget notifies you of current weather condition
+ and gives tomorrow's forecast.
</para>
- </listitem>
- </itemizedlist>
- </section>
+ </listitem>
+ </itemizedlist>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Existing_Gadgets">
- <title>Existing Gadgets</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Liste.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <section id="sect-Reference_Guide-Gadgets-Existing_Gadgets">
+ <title>Existing Gadgets</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Liste.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Create_a_new_Gadget">
- <title>Create a new Gadget</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/New.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <section id="sect-Reference_Guide-Gadgets-Create_a_new_Gadget">
+ <title>Create a new Gadget</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/New.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Remote_Gadget">
- <title>Remote Gadget</title>
- <para>
- This is the reference to a remote gadget (stock one).
+ <section id="sect-Reference_Guide-Gadgets-Remote_Gadget">
+ <title>Remote Gadget</title>
+ <para>
+ This is the reference to a remote gadget (stock one).
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Import.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Import.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Gadget_Importing">
- <title>Gadget Importing</title>
- <para>
- After referencing the gadget successfully, then import it into the local repository.
+ <section id="sect-Reference_Guide-Gadgets-Gadget_Importing">
+ <title>Gadget Importing</title>
+ <para>
+ After referencing the gadget successfully, then import it into the local
+ repository.
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Imported.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Imported.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Gadget_Web_Editing">
- <title>Gadget Web Editing</title>
- <para>
- Edit it from the Web the imported Gadget to modify it:
+ <section id="sect-Reference_Guide-Gadgets-Gadget_Web_Editing">
+ <title>Gadget Web Editing</title>
+ <para>
+ Edit it from the Web the imported Gadget to modify it:
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/EditImportedOnline.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditImportedOnline.png"
+ format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Gadget_IDE_Editing">
- <title>Gadget IDE Editing</title>
- <para>
- Edit it from your IDE thanks to the WebDAV protocol:
+ <section id="sect-Reference_Guide-Gadgets-Gadget_IDE_Editing">
+ <title>Gadget IDE Editing</title>
+ <para>
+ Edit it from your IDE thanks to the WebDAV protocol:
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/EditImportedWebDAV.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditImportedWebDAV.png"
+ format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
- <section id="sect-Reference_Guide-Gadgets-Dashboard_Viewing">
- <title>Dashboard Viewing</title>
- <para>
- View it from the Dashboard when you drag and drop the Gadget from listing to the dashboard.
+ <section id="sect-Reference_Guide-Gadgets-Dashboard_Viewing">
+ <title>Dashboard Viewing</title>
+ <para>
+ View it from the Dashboard when you drag and drop the Gadget from listing
+ to the dashboard.
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Dashboard.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </section>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Dashboard.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml 2009-12-09 12:27:57 UTC (rev 979)
+++ portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml 2009-12-09 13:07:58 UTC (rev 980)
@@ -2,65 +2,98 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Setup_a_Gadget_Server">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Setup a Gadget Server</title>
- <section id="sect-Reference_Guide-Setup_a_Gadget_Server-Setup_virtual_servers_for_the_gadget_rendering">
- <title>Setup virtual servers for the gadget rendering</title>
- <para>
- GateIn recommend you to setup 2 different virtual hosts because it's the basis of the security model of gadgets. Having the gadget running on a different domain than the container (the website that 'contains' the app), the gadget can't read / modify / do anything nasty to GateIn Portal (like adding spam messages, stealing your cookies, whatever).
+ <title>Setup a Gadget Server</title>
+ <section
+ id="sect-Reference_Guide-Setup_a_Gadget_Server-Setup_virtual_servers_for_the_gadget_rendering">
+ <title>Setup virtual servers for the gadget rendering</title>
+ <para>
+ GateIn recommend you to setup 2 different virtual hosts
+ because it's the
+ basis of the security model of gadgets. Having
+ the gadget
+ running on a different domain than the container (the
+ website
+ that 'contains' the app), the gadget can't read / modify
+ / do
+ anything nasty to GateIn Portal (like adding spam messages,
+ stealing your cookies, whatever).
</para>
- <para>
- For example you can server the portal from <emphasis role="bold">http://www.sample.com</emphasis> and the gadgets from <emphasis role="bold">http://www.samplemodules.com</emphasis>
+ <para>
+ For example you can server the portal from
+ <emphasis role="bold">http://www.sample.com</emphasis>
+ and the gadgets from
+ <emphasis role="bold">http://www.samplemodules.com</emphasis>
+ </para>
+ <para>
+ To do this, we need to configure a parameter with the name is
+ <emphasis>gadgets.hostName</emphasis>
+ , the value is the
+ <emphasis>path/to/gadgetServer</emphasis>
+ in GadgetRegisteryService service like following:
+ <programlisting><![CDATA[<component>
+ <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
+ <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>gadgets.hostName</name>
+ <description>Gadget server url</description>
+ <value>http://localhost:8080/GateInGadgetServer/gadgets/</value>
+ </value-param>
+ </init-params>
+</component>]]></programlisting>
+ </para>
+ <para>
+ It's possible to have multiple rendering servers. That would
+ help to
+ balance the load across multiple servers.
</para>
- <para>
- To do this, we need to configure a parameter with the name is <emphasis>gadgets.hostName</emphasis>, the value is the <emphasis>path/to/gadgetServer</emphasis> in GadgetRegisteryService service like following:
-<programlisting> {code:xml} <component> <key>org.exoplatform.application.gadget.GadgetRegistryService</key> <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type> <init-params> <value-param> <name>gadgets.hostName</name> <description>Gadget server url</description> <value>http://localhost:8080/GateInGadgetServer/gadgets/</value> </value-param> </init-params> </component> {code}</programlisting>
+ <para>
+ If you still want to deploy it on the same server, make sure
+ that it
+ starts before anything that use the gadgets (for example
+ the
+ webapp GateInGadgets that use
+ org.exoplatform.application.gadget.GadgetRegister)
</para>
- <warning>
- <title>Warning</title>
- <para>
- This has only been possible since Portal 2.6
- </para>
- </warning>
- <para>
- It's possible to have multiple rendering servers. That would help to balance the load across multiple servers.
+ </section>
+ <section>
+ <title>Configuration</title>
+ <section>
+ <title>Security key</title>
+ <para>
+ A file
+ <emphasis role="bold">key.txt</emphasis>
+ has to be generated
+ <emphasis role="bold">for every installation of GateIn to
+ be
+ secure</emphasis>
+ . This file contains a secret key used to crypt the security
+ token used for authenticating the user. On Linux this can be
+ generated such as:
+ </para>
+ <programlisting>dd if=/dev/random bs=32 count=1 | openssl base64 > /tmp/key.txt</programlisting>
+ </section>
+ <section>
+ <title>Gadget proxy and concat configuration</title>
+ <para>These servers have to be on the same domain as the gadget server. You can configure it in: <filename>eXoGadgetServer:/WEB-INF/classes/containers/default/container.js</filename>.
+<programlisting><![CDATA["gadgets.content-rewrite" : {
+ "include-urls": ".*",
+ "exclude-urls": "",
+ "include-tags": ["link", "script", "embed", "img", "style"],
+ "expires": "86400",
+ "proxy-url": "http://localhost:8080/eXoGadgetServer/gadgets/proxy?url=",
+ "concat-url": "http://localhost:8080/eXoGadgetServer/gadgets/concat?"
+},]]></programlisting>
</para>
- <para>
- If you still want to deploy it on the same server, make sure that it starts before anything that use the gadgets (for example the webapp GateInGadgets that use org.exoplatform.application.gadget.GadgetRegister)
- </para>
- <para>
- 1 Config 1.1 Security key A file <emphasis role="bold">key.txt</emphasis> has to be generated <emphasis role="bold">for every installation of GateIn to be secure</emphasis>. This file contains a secret key used to crypt the security token used for authenticating the user. in Tomcat this file is in nix command line will create an excellent key:
- </para>
-
-<programlisting>dd if=/dev/random bs=32 count=1 | openssl base64 > /tmp/key.txt
-</programlisting>
- <para>
- 1.1 Gadget proxy and concat configuration These servers have to be on the same domain as the gadget server. You can configure it in:
-<programlisting>{code}
-{, "expires": "86400", "proxy-url": "http://localhost:8080/GateInGadgetServer/gadgets/proxy?url=", "concat-url": "http://localhost:8080/GateInGadgetServer/gadgets/concat?"
-}{code}</programlisting>
- </para>
- <para>
- 1.1 Proxy if your server is behind a proxy and you want to allow external gadgets, you should configure the proxy of your JVM adding this code at the begining. {code}-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword {code}
- </para>
+ </section>
+ <section>
+ <title>Proxy</title>
+ <para>
+ if your server is behind a proxy and you want to allow external gadgets, you should configure the proxy of your JVM adding this code at the begining.
+ </para>
+ <programlisting>-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword</programlisting>
+ </section>
+
</section>
</section>
15 years
gatein SVN: r979 - in portal/trunk/docs/reference-guide/en: images/tutorials and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 07:27:57 -0500 (Wed, 09 Dec 2009)
New Revision: 979
Added:
portal/trunk/docs/reference-guide/en/images/tutorials/
portal/trunk/docs/reference-guide/en/images/tutorials/SpecPortalDef.png
portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/
portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/deployed.png
portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/output.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/exploded.gif
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_deploy.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_explode.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_deploy.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_explode.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/output.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_42x.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces42.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_sunri.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/
portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/output.png
portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/process.png
portal/trunk/docs/reference-guide/en/modules/portlets/Standard.xml
Modified:
portal/trunk/docs/reference-guide/en/modules/Portlets.xml
Log:
Adding the tutorial chapter form JBoss Portal (Will require new screenshots)
Added: portal/trunk/docs/reference-guide/en/images/tutorials/SpecPortalDef.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/SpecPortalDef.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/deployed.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/deployed.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/output.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/first_portlet/output.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/exploded.gif
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/exploded.gif
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_deploy.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_deploy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_explode.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/jsf_ant_explode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_deploy.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_deploy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_explode.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/myfaces_ant_explode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/output.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/output.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_42x.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_42x.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces42.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_myfaces42.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_sunri.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsf_portlet/package_sunri.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/output.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/output.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/process.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/tutorials/jsp_portlet/process.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: portal/trunk/docs/reference-guide/en/modules/Portlets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Portlets.xml 2009-12-09 11:43:22 UTC (rev 978)
+++ portal/trunk/docs/reference-guide/en/modules/Portlets.xml 2009-12-09 12:27:57 UTC (rev 979)
@@ -6,7 +6,8 @@
<xi:include href="portlets/WebUI.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/AJAX_in_GateIn_Framework.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/Groovy_Templates.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="portlets/Create_a_WebUI_Portlet.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/Portlet_Lifecycle.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Standard.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Create_a_WebUI_Portlet.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
Added: portal/trunk/docs/reference-guide/en/modules/portlets/Standard.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Standard.xml (rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Standard.xml 2009-12-09 12:27:57 UTC (rev 979)
@@ -0,0 +1,1036 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<section id="tutorials">
+ <title>Portlet Primer</title>
+ <section id="portlet_primer">
+ <title>JSR-168 and JSR-286 overview</title>
+ <para>
+ The Portlet Specifications aims at defining portlets that can
+ be used by any
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=168">
+ JSR-168 (Portlet 1.0)
+ </ulink>
+ or
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 (Portlet 2.0)
+ </ulink>
+ portlet container. Most Java EE portals include one, it is
+ obviously the case for
+ GateIn Portal which includes the GateIn
+ Portlet Container supporting the two
+ versions. This chapter
+ gives a brief overview of the Portlet Specifications but
+ portlet developers are strongly encouraged to read the
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 Portlet Specification
+ </ulink>
+ .
+ </para>
+ <para>
+ GateIn Portal is fully JSR-286 compliant, which means any
+ JSR-168 or JSR-286
+ portlet behaves as it is mandated by the
+ respective specifications inside the
+ portal.
+ </para>
+ <section>
+ <title>Portal Pages</title>
+ <para>
+ A portal can be seen as pages with different areas, and
+ inside areas,
+ different windows, and each window having one
+ portlet:
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tutorials/SpecPortalDef.png"
+ format="PNG" scalefit="1" />
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>Rendering Modes</title>
+ <para>
+ A portlet can have different view modes. Three modes are
+ defined by the
+ JSR-286 specification:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>view</emphasis>
+ - generates markup reflecting the current state of
+ the portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>edit</emphasis>
+ - allows a user to customize the behavior of the
+ portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>help</emphasis>
+ - provides information to the user as to how to use
+ the portlet.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Window States</title>
+ <para>
+ Window states are an indicator of how much page
+ real-estate a portlet consumes
+ on any given page. The three
+ states defined by the JSR-168 specification are:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>normal</emphasis>
+ - a portlet shares this page with other portlets.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>minimized</emphasis>
+ -a portlet may show very little information, or
+ none at all.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>maximized</emphasis>
+ - a portlet may be the only portlet displayed on
+ this page.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ <section id="tutorials_tutorials">
+ <title>Tutorials</title>
+ <para>
+ The tutorials contained in this chapter are targeted toward
+ portlet developers.
+ Although they are a good starting and
+ reference point, it is highly recommend
+ that portlet developers
+ read and understand the
+ <ulink url="http://www.jcp.org/en/jsr/detail?id=286">
+ JSR-286 Portlet Specification
+ </ulink>
+ .
+ </para>
+ <section>
+ <title>Deploying your first Portlet</title>
+ <section>
+ <title>Introduction</title>
+ <para>
+ This section describes how to deploy a portlet in GateIn
+ Portal. You will
+ find the
+ <emphasis>SimplestHelloWorld</emphasis>
+ portlet in the
+ <literal>examples</literal>
+ directory at the root of your GateIn Portal binary
+ package.
+ </para>
+ </section>
+ <section>
+ <title>Compiling</title>
+ <para>
+ This example is using Maven to compile and build the web
+ archive. If you
+ don't have Maven already installed, you
+ will find a version for your
+ operating system
+ <ulink url="http://maven.apache.org/download.html">here</ulink>
+ </para>
+ <para>
+ To compile and package the application, go to the
+ SimplestHelloWorld
+ directory and type
+ <literal>mvn package</literal>
+ .
+ </para>
+ <para>
+ Once successfully packaged, the result should be
+ available in:
+ <literal>SimplestHelloWorld/target/SimplestHelloWorld-0.0.1.war
+ </literal>
+ . Simply copy that file into
+ <literal>JBOSS_HOME/server/default/deploy</literal>
+ , then start JBoss Application Server if it was not
+ already started.
+ </para>
+ <para>
+ Now you will need to create a new page and add that portlet on it.
+ </para>
+ <para>
+ <mediaobject>
+ <imageobject>
+ <objectinfo>
+ <title>SimplestHelloWorldPortlet deployed on a
+ new page</title>
+ </objectinfo>
+ <imagedata
+ fileref="images/tutorials/first_portlet/deployed.png" />
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>Package Structure</title>
+ <bridgehead>
+ Now that we have seen how to deploy an existing
+ web application, let's have
+ a look inside.
+ </bridgehead>
+ <para>
+ Like other Java Platform, Enterprise Edition (Java EE)
+ applications,
+ portlets are packaged in WAR files. A
+ typical portlet WAR file can include
+ servlets, resource
+ bundles, images, HTML,
+ <trademark class="trade">JavaServer</trademark>
+ Pages (
+ <trademark class="trade">JSP</trademark>
+ ), and other static or dynamic files. The following is an
+ example of the
+ directory structure of the
+ HelloWorldPortlet portlet:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.javaclass" coords='9' />
+ <area id="tutorials.simplest.portlet" coords='10' />
+ <area id="tutorials.simplest.web" coords='11' />
+ </areaspec>
+ <programlisting><![CDATA[|-- SimplestHelloWorld-0.0.1.war
+| `-- WEB-INF
+| |-- classes
+| | `-- org
+| | `-- gatein
+| | `-- portal
+| | `-- examples
+| | `-- portlets
+| | `-- SimplestHelloWorldPortlet.class
+| |-- portlet.xml
+| `-- web.xml]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.javaclass">
+ <para>
+ The compiled Java class implementing
+ <emphasis>javax.portlet.Portlet</emphasis>
+ (through
+ <emphasis>javax.portlet.GenericPortlet
+ </emphasis>
+ )
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portlet">
+ <para>
+ This is the mandatory descriptor files for
+ portlets. It is used
+ during deployment..
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.web">
+ <para>This is the mandatory descriptor for web
+ applications.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+
+ <section>
+ <title>Portlet Class</title>
+ <bridgehead>Let's study the Java class in detail.
+ </bridgehead>
+ <para>
+ The following file is the
+ <filename>
+ SimplestHelloWorldPortlet/src/main/java/org/gatein/portal/examples/portlets/SimplestHelloWorldPortlet.java
+ </filename>
+ Java source.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.extends" coords='10' />
+ <area id="tutorials.simplest.doview" coords='13' />
+ <area id="tutorials.simplest.writer" coords='15' />
+ <area id="tutorials.simplest.write" coords='16' />
+ <area id="tutorials.simplest.close" coords='17' />
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[package org.gatein.portal.examples.portlets;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+public class SimplestHelloWorldPortlet extends GenericPortlet
+{
+ public void doView(RenderRequest request,
+ RenderResponse response) throws IOException
+ {
+ PrintWriter writer = response.getWriter();
+ writer.write("Hello World !");
+ writer.close();
+ }
+}]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.extends">
+ <para>
+ All portlets must implement the
+ <literal>javax.portlet.Portlet</literal>
+ interface. The portlet API provides a convenient
+ implementation of
+ this interface, in the form of
+ the
+ <literal>javax.portlet.GenericPortlet</literal>
+ class, which among other things, implements the
+ <literal>Portlet render</literal>
+ method to dispatch to abstract mode-specific
+ methods to make it
+ easier to support the standard
+ portlet modes. As well, it provides
+ a default
+ implementation for the
+ <literal>processAction</literal>
+ ,
+ <literal>init</literal>
+ and
+ <literal>destroy</literal>
+ methods. It is recommended to extend
+ <literal>GenericPortlet</literal>
+ for most cases.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.doview">
+ <para>
+ As we extend from
+ <literal>GenericPortlet</literal>
+ , and are only interested in supporting the
+ <literal>view</literal>
+ mode, only the
+ <literal>doView</literal>
+ method needs to be implemented, and the
+ <literal>GenericPortlet</literal>
+ <literal>render</literal>
+ implemention calls our implementation when the
+ <literal>view</literal>
+ mode is requested.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.writer">
+ <para>
+ Use the
+ <emphasis>RenderResponse</emphasis>
+ to obtain a writer to be used to produce
+ content.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.write">
+ <para>Write the markup to display.</para>
+ </callout>
+ <callout arearefs="tutorials.simplest.close">
+ <para>Closing the writer.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ <note>
+ <title>Markup Fragments</title>
+ <para>
+ Portlets are responsible for generating markup
+ fragments, as they are
+ included on a page and are
+ surrounded by other portlets. In
+ particular, this
+ means that a portlet outputting HTML must not
+ output
+ any markup that cannot be found in a
+ <literal><body></literal>
+ element.
+ </para>
+ </note>
+ </para>
+ </section>
+ <section id="first_portlet_descriptors">
+ <title>Application Descriptors</title>
+ <para>
+ GateIn Portal requires certain descriptors to be
+ included in a portlet WAR
+ file. Thise descriptors are
+ defined by the Jave EE (web.xml) and Portlet
+ Specification (portlet.xml).
+ </para>
+ <para>
+ The following is an example of the
+ <filename>SimplestHelloWorldPortlet/WEB-INF/portlet.xml
+ </filename>
+ file. This file must adhere to its definition in the
+ JSR-286 Portlet
+ Specification. You may define more than
+ one portlet application in this
+ file:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.simplest.portletname" coords='8' />
+ <area id="tutorials.simplest.portletclass"
+ coords='9' />
+ <area id="tutorials.simplest.supports" coords='12' />
+ <area id="tutorials.simplest.portletinfo" coords='15' />
+ </areaspec>
+ <programlisting><![CDATA[
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>SimplestHelloWorldPortlet</portlet-name>
+ <portlet-class>
+ org.gatein.portal.examples.portlets.SimplestHelloWorldPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Simplest Hello World Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]>
+ </programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.simplest.portletname">
+ <para>
+ Define the portlet name. It does not have to
+ be the class name.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portletclass">
+ <para>
+ The Fully Qualified Name (FQN) of your
+ portlet class must be
+ declared here.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.supports">
+ <para>
+ The
+ <computeroutput><supports>
+ </computeroutput>
+ element declares all of the markup types that a
+ portlet supports
+ in the
+ <literal>render</literal>
+ method. This is accomplished via the
+ <computeroutput><mime-type>
+ </computeroutput>
+ element, which is required for every portlet.
+ The declared MIME
+ types must match the capability
+ of the portlet. As well, it allows
+ you to pair
+ which modes and window states are supported for
+ each
+ markup type. All portlets must support the
+ <computeroutput>view</computeroutput>
+ portlet mode, so this does not have to be
+ declared. Use the
+ <computeroutput><mime-type>
+ </computeroutput>
+ element to define which markup type your portlet
+ supports, which
+ in this example, is
+ <computeroutput>text/html</computeroutput>
+ . This section tells the portal that it only
+ outputs HTML.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.simplest.portletinfo">
+ <para>
+ When rendered, the portlet's title is displayed
+ as the header in
+ the portlet window, unless it is
+ overridden programmatically. In
+ this example, the
+ title would be
+ <computeroutput>Simplest Hello World Portlet
+ </computeroutput>
+ .
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JavaServer</trademark>
+ Pages Portlet Example
+ </title>
+ <section>
+ <title>Introduction</title>
+ <para>
+ Now we will add more features to the previous example and
+ also use a JSP
+ page to render the markup. We will use the
+ portlet tag library to generate
+ links to our portlet in
+ different ways and use the other standard portlet
+ modes.
+ This example can be found in the directory
+ <literal>JSPHelloUser</literal>
+ .
+ Use
+ <literal>mvn package</literal>
+ then copy
+ <filename>JSPHelloUser/target/JSPHelloUser-0.0.1.war
+ </filename>
+ in the
+ <literal>deploy</literal>
+ directory of JBoss Application Server.
+ Point your brwoser
+ to
+ <literal></literal>
+ , you should see the following:
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/tutorials/jsp_portlet/output.png"
+ align="center" scalefit="1" />
+ </imageobject>
+ </mediaobject>
+ <note>
+ <para>
+ The
+ <literal>EDIT</literal>
+ button only appears with logged-in users, which is
+ not the case
+ on the screenshot
+ </para>
+ </note>
+ </para>
+ </section>
+ <section>
+ <title>Package Structure</title>
+ <para>
+ The structure doesn't change much at the exception of
+ adding some JSP files
+ detailed later.
+ </para>
+ <para>
+ The JSPHelloUser portlet contains the mandatory
+ portlet application descriptors.
+ The following is an example of the
+ directory structure of
+ the JSPHelloUser portlet:
+ </para>
+ <programlisting><![CDATA[JSPHelloUser-0.0.1.war
+ |-- META-INF
+ | |-- MANIFEST.MF
+ |-- WEB-INF
+ | |-- classes
+ | | `-- org
+ | | `-- gatein
+ | | `-- portal
+ | | `-- examples
+ | | `-- portlets
+ | | `-- JSPHelloUserPortlet.class
+ | |-- portlet.xml
+ | `-- web.xml
+ `-- jsp
+ |-- edit.jsp
+ |-- hello.jsp
+ |-- help.jsp
+ `-- welcome.jsp]]>
+ </programlisting>
+ </section>
+ <section>
+ <title>Portlet Class</title>
+ <bridgehead>Let's study the Java class in detail.
+ </bridgehead>
+ <para>
+ The following file is the
+ <filename>
+ JSPHelloUser/src/main/java/org/gatein/portal/examples/portlets/JSPHelloUserPortlet.java
+ </filename>
+ Java source. It is split in different pieces.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.doView" coords='18' />
+ <area id="tutorials.jsphello.renderParameter"
+ coords='21' />
+ <area id="tutorials.jsphello.requestDispatcher"
+ coords='25' />
+ <area id="tutorials.jsphello.include" coords='26' />
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[package org.gatein.portal.examples.portlets;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+
+public class JSPHelloUserPortlet extends GenericPortlet
+{
+
+ public void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException
+ {
+ String sYourName = (String) request.getParameter("yourname");
+ if (sYourName != null)
+ {
+ request.setAttribute("yourname", sYourName);
+ PortletRequestDispatcher prd =
+ getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
+ prd.include(request, response);
+ }
+ else
+ {
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+ }
+ }
+...]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.doView">
+ <para>
+ As in the first portlet, we override the
+ <emphasis>doView</emphasis>
+ method.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.renderParameter">
+ <para>
+ Here we try to obtain the value of the render
+ parameter names
+ <literal>yourname</literal>
+ . If defined we want to redirect to the
+ <filename>hello.jsp</filename>
+ JSP page, otherwise to the
+ <filename>welcome.jsp</filename>
+ JSP page.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.requestDispatcher">
+ <para>
+ Very similar to the Servlet way, we get a
+ request dispatcher on a
+ file located within the
+ web archive.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.include">
+ <para>
+ The last step is to perform the inclusion of
+ the markup obtained
+ from the JSP.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ <para>
+ We have seen the
+ <literal>VIEW</literal>
+ portlet mode, the spec defines two other modes that can
+ be used called
+ <literal>EDIT</literal>
+ and
+ <literal>HELP</literal>
+ . In order to enable those modes, they will need to be
+ defined in the
+ <filename>portlet.xml</filename>
+ descriptor as we will see later. Having those modes
+ defined will enable the
+ corresponding buttons on the
+ portlet's window.
+ </para>
+ <para>
+ The generic portlet that is inherited dispatches the
+ different views to
+ methods named:
+ <literal>doView</literal>
+ ,
+ <literal>doHelp</literal>
+ and
+ <literal>doEdit</literal>
+ . Let's watch the code for those two last portlet modes.
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+ protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
+ prd.include(rRequest, rResponse);
+ }
+...]]></programlisting>
+
+ <para>
+ If you have read the portlet specification carefully
+ you should have notice
+ that portlet calls happen in one or
+ two phases. One when the portlet is
+ just rendered, two
+ when the portlet is actionned then rendered. An action
+ phase is a phase where some state change. The render
+ phase will have access
+ to render parameters that will be
+ passed each time the portlet is refreshed
+ (with the
+ exception of caching capabilities).
+ </para>
+ <para>
+ The code to be executed during an action has to be
+ implemented in the
+ <emphasis>processAction</emphasis>
+ method of the portlet.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.processAction"
+ coords='2' />
+ <area id="tutorials.jsphello.getActionParameter"
+ coords='5' />
+ <area id="tutorials.jsphello.setRenderParameter"
+ coords='6' />
+ </areaspec>
+ <programlisting role="JAVA"><![CDATA[...
+ public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("yourname", sYourname);
+ }
+...]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.processAction">
+ <para>
+ <literal>processAction</literal>
+ is the method from GernericPorlet to override
+ for the
+ <emphasis>action</emphasis>
+ phase.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.getActionParameter">
+ <para>
+ Here we retrieve the parameter obtained through
+ an
+ <emphasis>action URL</emphasis>
+ .
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.setRenderParameter">
+ <para>
+ Here we need to keep the value of
+ <literal>yourname</literal>
+ to make it available in the rendering phase.
+ With the previous
+ line, we are simply copying an
+ action parameter to a render
+ parameter for the
+ sake of this example.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JSP</trademark>
+ files and the Portlet Tag Library
+ </title>
+ <bridgehead>Let's have a look inside the JSP pages.
+ </bridgehead>
+ <para>
+ The
+ <filename>help.jsp</filename>
+ and
+ <filename>edit.jsp</filename>
+ files are very simple, they simply display some text.
+ Note that we used CSS
+ styles as defined in the portlet
+ specification. It ensures that the portlet
+ will look
+ "good" within the theme and accross portal vendors.
+ </para>
+ <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Help mode</div>
+<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>]]></programlisting>
+ <programlisting role="XHTML"><![CDATA[<div class="portlet-section-header">Edit mode</div>
+<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>]]></programlisting>
+ <para>
+ Now let's have a look at the landing page, it contains
+ the links and form
+ to call our portlet:
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsphello.taglib" coords='1' />
+ <area id="tutorials.jsphello.method1" coords='13' />
+ <area id="tutorials.jsphello.method2.1" coords='20' />
+ <area id="tutorials.jsphello.method2.2" coords='24' />
+ <area id="tutorials.jsphello.method3.1" coords='30' />
+ <area id="tutorials.jsphello.method3.2" coords='31' />
+ </areaspec>
+
+ <programlisting><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+
+<div class="portlet-section-header">Welcome !</div>
+
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is GateIn Portal. What's yours ?</div>
+
+<br/>
+
+<div class="portlet-font">Method 1: We simply pass the parameter to the render phase:<br/>
+<a href="<portlet:renderURL><portlet:param name="yourname" value="John Doe"/>
+ </portlet:renderURL>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 2: We pass the parameter to the render phase, using valid XML:
+Please check the source code to see the difference with Method 1.
+<portlet:renderURL var="myRenderURL">
+ <portlet:param name="yourname" value='John Doe'/>
+</portlet:renderURL>
+<br/>
+<a href="<%= myRenderURL %>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 3: We use a form:<br/>
+
+<portlet:actionURL var="myActionURL"/>
+<form action="<%= myActionURL %>" method="POST">
+ <span class="portlet-form-field-label">Name:</span>
+ <input class="portlet-form-input-field" type="text" name="yourname"/>
+ <input class="portlet-form-button" type="Submit"/>
+</form>
+</div>]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsphello.taglib">
+ <para>
+ Since we will use the portlet taglib, we
+ first need to declare it.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method1">
+ <para>
+ The first method showed here is the simplest
+ one,
+ <literal>portlet:renderURL</literal>
+ will create a URL that will call the render
+ phase of the current
+ portlet and append the
+ result at the place of the markup (Here
+ within a
+ tag...). We also added a parameter directly on
+ the URL.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method2.1">
+ <para>
+ In this method instead of having a tag within
+ another tag, which
+ is not XML valid, we use the
+ <literal>var</literal>
+ attribute. Instead of printing the url the
+ <literal>portlet:renderURL</literal>
+ tag will store the result in the referenced
+ variable (
+ <literal>myRenderURL</literal>
+ in our case).
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method2.2">
+ <para>
+ The variable
+ <literal>myRenderURL</literal>
+ is used like any other JSP variable.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method3.1">
+ <para>
+ The third method mixes form submission and
+ action request. Like in
+ the second method, we
+ used a temporary variable to put the created
+ URL
+ into.
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsphello.method3.2">
+ <para>The action URL is used in the HTML form.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+
+ <para>
+ On the third method, first the action phase is triggered
+ then later in the request, the render
+ phase is triggered,
+ which output some content back to the web browser based
+ on the
+ available render parameters.
+ <mediaobject>
+ <imageobject>
+ <imagedata format="PNG"
+ fileref="images/tutorials/jsp_portlet/process.png"
+ scalefit="1" />
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section>
+ <title>
+ <trademark class="trade">JSF</trademark>
+ example using the JBoss Portlet Bridge
+ </title>
+ <bridgehead>In order to write a portlet using JSF we need a
+ piece of software called 'bridge' that
+ lets us write a portlet application as if it was a JSF application, the
+ bridge takes care of the
+ interactions between the two layers.</bridgehead>
+ <para>Such an example is available in examples/JSFHelloUser,
+ it uses the JBoss Portlet Bridge.
+ The configuration is slightly different from a JSP application, since
+ it is a bit tricky it is usally a good
+ idea to copy an existing application that starting from scratch.</para>
+ <para>
+ First, as any JSF application, the file
+ <literal>faces-config.xml</literal>
+ is required. It includes
+ the following required information in it:
+ </para>
+ <programlisting role="XML"><![CDATA[<faces-config>
+...
+ <application>
+ <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
+ <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
+ </application>
+...
+</faces-config> ]]></programlisting>
+ <para>
+ The portlet bridge libraries must be available and are
+ usually bundled with the
+ <literal>WEB-INF/lib</literal>
+ directory of the web archive.
+ </para>
+ <para>
+ The other difference compare to a regular portlet
+ application, can be found in the portlet
+ descriptor. All details about it can be found in the JSR-301 specification
+ that the JBoss Portlet Bridge
+ implements.
+ </para>
+ <programlistingco>
+ <areaspec>
+ <area id="tutorials.jsf.portlet" coords="9" />
+ <area id="tutorials.jsf.view" coords="21" />
+ <area id="tutorials.jsf.edit" coords="26" />
+ <area id="tutorials.jsf.help" coords="31" />
+ </areaspec>
+ <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+ <portlet>
+ <portlet-name>JSFHelloUserPortlet</portlet-name>
+ <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>JSF Hello User Portlet</title>
+ </portlet-info>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/jsf/welcome.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/jsf/edit.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/jsf/help.jsp</value>
+ </init-param>
+
+ </portlet>
+</portlet-app>]]></programlisting>
+ <calloutlist>
+ <callout arearefs="tutorials.jsf.portlet">
+ <para>
+ All JSF portlets define
+ <literal>javax.portlet.faces.GenericFacesPortlet
+ </literal>
+ as portlet class. This class is part of the
+ JBoss Portlet Bridge
+ </para>
+ </callout>
+ <callout arearefs="tutorials.jsf.view">
+ <para>This is a mandatory parameter to define
+ what's the default page to display.</para>
+ </callout>
+ <callout arearefs="tutorials.jsf.edit">
+ <para>This parameter defines which page to
+ display on the 'edit' mode.</para>
+ </callout>
+ <callout arearefs="tutorials.jsf.help">
+ <para>This parameter defines which page to
+ display on the 'help' mode.</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+ </section>
+ </section>
+</section>
15 years
gatein SVN: r978 - in portal/trunk/docs/reference-guide/en/modules: portlets and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 06:43:22 -0500 (Wed, 09 Dec 2009)
New Revision: 978
Removed:
portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml
Modified:
portal/trunk/docs/reference-guide/en/modules/Portlets.xml
portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml
Log:
More cleanup/fix
Modified: portal/trunk/docs/reference-guide/en/modules/Portlets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Portlets.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/Portlets.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -2,31 +2,11 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<chapter id="chap-Reference_Guide-Portlet_development">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Portlet development</title>
+ <title>Portlet development</title>
<xi:include href="portlets/WebUI.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/AJAX_in_GateIn_Framework.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/Groovy_Templates.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/Create_a_WebUI_Portlet.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="portlets/Portlet_Lifecycle.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="portlets/Sample_Basic_Portlet.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -131,7 +131,8 @@
</para>
<para>
Done. Your portlet is ready to accept Ajax calls from
- your client.
+ your
+ client.
</para>
</section>
@@ -154,10 +155,14 @@
</programlisting>
<para>
in a groovy code block. The event function will create an
- url starting
- with <literal>javascript:</literal> so you have to make sure this
- code can be executed in your environment.
- </para>
+ url
+ starting
+ with
+ <literal>javascript:</literal>
+ so you have to make sure this
+ code can be executed in your
+ environment.
+ </para>
<para>
If your operation must update the content of a component,
you have to
@@ -196,57 +201,103 @@
<title>How JavaScript works</title>
<para>
All the javascript is managed by the file
- 02eXoresources:javascript/eXo/portal/PortalHttpRequest.js in the portal project.
+ <filename>02eXoresources:javascript/eXo/portal/PortalHttpRequest.js</filename> in
+ the portal project.
</para>
<para>
In this class, you will find 4 functions/classes (detailed
below):
<itemizedlist>
- <listitem><para>PortletResponse</para></listitem>
- <listitem><para>PortalResponse</para></listitem>
- <listitem><para>AjaxRequest</para></listitem>
- <listitem><para>HttpResponseHandler</para></listitem>
+ <listitem>
+ <para>PortletResponse</para>
+ </listitem>
+ <listitem>
+ <para>PortalResponse</para>
+ </listitem>
+ <listitem>
+ <para>AjaxRequest</para>
+ </listitem>
+ <listitem>
+ <para>HttpResponseHandler</para>
+ </listitem>
</itemizedlist>
</para>
<para>
- and 6 functions : {code}
+ and 6 functions:
</para>
<itemizedlist>
<listitem>
<para>
- ajaxGet // Calls doRequest with an url in GET mode
+ ajaxGet(url, callback)
</para>
+ <para>This is the main entry method for every Ajax calls to
+ the GateIn Portal
+ It is simply a dispatcher method that fills some init fields before
+ calling the doRequest() method</para>
</listitem>
<listitem>
<para>
- ajaxPost // Calls doRequest with an url in POST mode
+ ajaxPost(formElement, callback) // Calls doRequest
+ with an url in POST mode
</para>
+ <para>This method is called when a HTTP POST should be done
+ but in an AJAX
+ case some maniputalions are needed. Once
+ the content of the form is placed
+ into a string object,
+ the call is delegated to the doRequest() method </para>
</listitem>
<listitem>
<para>
- doRequest // Creates the AjaxRequest and
- HttpResponseHandler objects, and
- lauches the request
- process
+ doRequest(method, url, queryString, callback)
</para>
+ <para>
+ The doRequest() method takes incoming request from GET
+ and POST calls
+ The second argument is the URL to target on
+ the server
+ The third argument is the query string object
+ which is created out of a
+ form element, this value is not null only when there is a POST request.
+ <orderedlist>
+ <listitem>
+ <para>An AjaxRequest object is instanciated, it
+ holds the reference to the XHR method</para>
+ </listitem>
+ <listitem>
+ <para>An HttpResponseHandler object is instantiated
+ and its methods like
+ ajaxResponse, ajaxLoading, ajaxTimeout are associated with the one from
+ the AjaxRequest and will be called by the XHR during the process
+ method</para>
+ </listitem>
+ </orderedlist>
+ </para>
</listitem>
<listitem>
<para>
- ajaxAbort // Cancels the current request
- </para>
+ ajaxAbort()
+ </para>
+ <para>Cancels the current request</para>
</listitem>
<listitem>
<para>
- ajaxAsyncGetRequest // Allows to create and execute a
- sync or async GET request
- </para>
+ ajaxAsyncGetRequest(url, async)
+ </para>
+ <para>Allows to create and execute a
+ sync or async GET
+ request
+ </para>
</listitem>
<listitem>
<para>
- ajaxRedirect // A simple javascript redirection with
+ ajaxRedirect(url)
+ </para>
+ <para>A simple javascript redirection with
window.location.href
- {code} that are the entry points of
- these classes. You
+ that are the entry points of
+ these
+ classes. You
shouldn't have to call explicitly these
functions, since
the template file and the portlet class
@@ -265,7 +316,7 @@
gets the
response elements from the xml returned by Ajax, and
store them
- in the corresponding attributes : {code}
+ in the corresponding attributes :
</para>
<itemizedlist>
<listitem>
@@ -303,7 +354,6 @@
<para>
blocksToUpdate // An array containing the containers
to update with this script
- {code}
</para>
</listitem>
</itemizedlist>
@@ -322,7 +372,7 @@
<literal>PortletResponse</literal>
s (
<literal>portletResponses</literal>
- ) and two other attributes : {code}
+ ) and two other attributes :
</para>
<itemizedlist>
<listitem>
@@ -332,7 +382,7 @@
</listitem>
<listitem>
<para>
- script // Javascript code to update {code}
+ script // Javascript code to update
</para>
</listitem>
</itemizedlist>
@@ -356,7 +406,6 @@
<title>HttpResponseHandler</title>
<para>
This class provides methods to handle the Ajax response.
- {code}
</para>
<itemizedlist>
<listitem>
@@ -386,7 +435,6 @@
<listitem>
<para>
ajaxLoading // shows the loading popup and mask layer
- {code}
</para>
</listitem>
</itemizedlist>
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -2,77 +2,78 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet">
- <title>Create a WebUI Portlet</title>
- <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Overview">
- <title>Overview</title>
- <para>
- This example is based on the testPortlet in portal/trunk/portlet/test.
+ <title>Create a WebUI Portlet</title>
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Overview">
+ <title>Overview</title>
+ <para>
+ TODO: Create example (This one doesn't exist anymore). Overall this chapter need to be reviewed, any taker ? :)
+ </para>
+ <para>
+ This example is based on the testPortlet in portal/trunk/portlet/test.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Create_a_WebUI_Portlet-Configure_the_portlet">
+ <title>Configure the portlet</title>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Folder_tree">
+ <title>Folder tree</title>
+ <para>
+ On Eclipse (or any IDE), create a new Java Project, and create this folder tree :
+ </para>
+ <programlisting>src
+ | main
+ | |- java
+ | |- resources
+ | |- webapp</programlisting>
+
+ </section>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-pom.xml">
+ <title>pom.xml</title>
+ <para>
+ Create the pom.xml, at root level of the project, like this :
</para>
- </section>
-
- <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Configure_the_portlet">
- <title>Configure the portlet</title>
+
+ <programlisting role="XML"><![CDATA[<project>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>config</artifactId>
+ <version>trunk</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>org.gatein.example.portlet.testRomain</artifactId>
+ <packaging>war</packaging>
+ <version>1.0.0</version>
+ <name>gatein.portlets.testRomain</name>
+ <description>Romain Test Portlet</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.portal</artifactId>
+ <version>${org.exoplatform.portal.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.eXo</artifactId>
+ <version>${org.exoplatform.portal.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>testRomain</finalName>
+ </build>
+</project>]]></programlisting>
+ </section>
+ <section>
+ <title>UITestRomainPortlet.java</title>
<para>
- Stuff Goes Here?
+ In java/testRomain/portlet/component/, we will create the UITestRomainPortlet.java file for the portlet :
</para>
- </section>
-
- <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Folder_tree">
- <title>Folder tree</title>
- <para>
- On Eclipse, create a new Java Project, and create this folder tree :
- </para>
- <para>
- <pre> src | main | |- java | |- resources | |- webapp </pre>
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-pom.xml">
- <title>pom.xml</title>
- <para>
- Create the pom.xml, at root level of the project, like this :
- </para>
-<programlisting><project>
- <parent>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>config</artifactId>
- <version>trunk</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>exo.portal.portlet.testRomain</artifactId>
- <packaging>war</packaging>
- <version>${org.exoplatform.portal.version}</version>
- <name>exo-portal.portlets.test Romain</name>
- <url>http://www.exoplatform.org</url>
- <description>Romain Test Portlet</description>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.webui.portal</artifactId>
- <version>${org.exoplatform.portal.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.portal</groupId>
- <artifactId>exo.portal.webui.GateIn</artifactId>
- <version>${org.exoplatform.portal.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <finalName>testRomain</finalName>
- </build>
-</project>
-</programlisting>
- <para>
- 1.1 UITestRomainPortlet.java
- </para>
- <para>
- In java/testRomain/portlet/component/, we will create the UITestRomainPortlet.java file of the portlet :
- </para>
-
-<programlisting>package testRomain.portlet.component;
+<programlisting role="JAVA"><![CDATA[package org.gatein.example.portlet.testRomain;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
import org.exoplatform.webui.core.UIPortletApplication;
@@ -85,32 +86,31 @@
public UITestRomainPortlet() throws Exception {
}
-}
-</programlisting>
+}]]></programlisting>
</section>
-
+ <!--
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet-testRomain.xml">
<title>testRomain.xml</title>
<para>
- In src/main/resources/tomcat/, create a testRomain.xml file : {code} <Context path="/test" docBase="../../../GateInProjects/portal/trunk/portlet/testPortletRomain/src/main/webapp" debug="0" reloadable="true" /> {code}
+ In src/main/resources/tomcat/, create a testRomain.xml file :
+ <programlisting><![CDATA[<Context path="/test" docBase="../../../GateInProjects/portal/trunk/portlet/testPortletRomain/src/main/webapp" debug="0" reloadable="true" />]]></programlisting>
</para>
<para>
docBase must be set to webapp path of the portlet when you are in the tomcat bin directory.
</para>
</section>
-
+ -->
+
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Portlet_Groovy_Template">
<title>Portlet Groovy Template</title>
<para>
In src/main/webapp, create the groovy template for the portlet. The path to this file must match the path you set in the java file, in our case : groovy/testRomain/portlet/UITestRomainPortlet.gtmpl
</para>
-<programlisting><div id="<%=uicomponent.getId();%>">
- HelloWorld!images/!!
-</div>
-</programlisting>
+<programlisting role="HTML"><![CDATA[<div id="<%=uicomponent.getId();%>">
+ HelloWorld
+</div>]]></programlisting>
</section>
-
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Skin_Folder">
<title>Skin Folder</title>
<para>
@@ -131,49 +131,47 @@
Create the file configuration.xml in WEB-INF/conf/portlet/testPortletRomain/. Content of tag <ui-component-root> must match your package organization.
</para>
-<programlisting><webui-configuration>
- <application>
- <ui-component-root>testRomain.portlet.component.UITestRomainPortlet</ui-component-root>
- <state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
- </application>
-</webui-configuration>
-</programlisting>
+<programlisting role="XML"><![CDATA[<webui-configuration>
+ <application>
+ <ui-component-root>testRomain.portlet.component.UITestRomainPortlet</ui-component-root>
+ <state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>]]></programlisting>
+ </section>
+ <section>
+ <title>portlet.xml</title>
<para>
- 1.1 portlet.xml
- </para>
- <para>
In WEB-INF, create file portlet.xml :
</para>
-<programlisting><?xml version="1.0" encoding="UTF-8"?>
-<portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app version="1.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
- <portlet>
- <description xml:lang="EN">Test Portlet Romain</description>
- <portlet-name>TestRomain</portlet-name>
- <display-name xml:lang="EN">Test Portlet Romain</display-name>
- <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
- <init-param>
- <name>webui.configuration</name>
- <!-- must match the path to configuration file -->
- <value>/WEB-INF/conf/portlet/testPortletRomain/configuration.xml</value>
- </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>help</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <resource-bundle>locale.testRomainPortlet</resource-bundle>
- <portlet-info>
- <title>TestPortletRomain</title>
- <short-title>TestPortlet</short-title>
- <keywords>test</keywords>
- </portlet-info>
- </portlet>
-</portlet-app>
-</programlisting>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+ <portlet>
+ <description xml:lang="EN">Test Portlet Romain</description>
+ <portlet-name>TestRomain</portlet-name>
+ <display-name xml:lang="EN">Test Portlet Romain</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <!-- must match the path to configuration file -->
+ <value>/WEB-INF/conf/portlet/testPortletRomain/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>locale.testRomainPortlet</resource-bundle>
+ <portlet-info>
+ <title>TestPortletRomain</title>
+ <short-title>TestPortlet</short-title>
+ <keywords>test</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>]]></programlisting>
</section>
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet-web.xml">
@@ -182,126 +180,143 @@
In WEB-INF, create file web.xml :
</para>
-<programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
- <!-If define the Portlet Application name MUST end with .par->
- <display-name>test</display-name>
- <description> This application is a portlet. It can not be used outside a portal.
- This web.xml file is mandatory in each .par archive file. </description>
- <listener>
- <listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
- </listener>
- <servlet>
- <servlet-name>PortletWrapper</servlet-name>
- <servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>PortletWrapper</servlet-name>
- <url-pattern>/PortletWrapper</url-pattern>
- </servlet-mapping>
-</web-app>
-</programlisting>
+<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-If define the Portlet Application name MUST end with .par->
+ <display-name>test</display-name>
+ <description> This application is a portlet. It can not be used outside a portal.
+ This web.xml file is mandatory in each .par archive file. </description>
+ <listener>
+ <listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>PortletWrapper</servlet-name>
+ <servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>PortletWrapper</servlet-name>
+ <url-pattern>/PortletWrapper</url-pattern>
+ </servlet-mapping>
+</web-app>]]></programlisting>
+ </section>
+ </section>
+ <section>
+ <title>Use the Portlet</title>
<para>
- 1 Use the Portlet
- </para>
- <para>
Compile your portlet, deploy it, and add it to the portal.
</para>
<para>
Now, we will add a button in the portlet. This button will open a popup with a message inside.
</para>
+ <section>
+ <title>Add a button</title>
<para>
- 1.1 Add a button In the groovy template, add this code :
+ In the groovy template, add this code :
</para>
-<programlisting><div class="UIAction">
- <div class="ActionContainer">
- <div class="ActionButton">
- <div class="LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="<%=uicomponent.event("OpenPopup", "")%>">Open Popup</a>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-</programlisting>
+<programlisting role="HTML"><![CDATA[<div class="UIAction">
+ <div class="ActionContainer">
+ <div class="ActionButton">
+ <div class="LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="<%=uicomponent.event("OpenPopup", "")%>">Open Popup</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>]]></programlisting>
+ </section>
+ <section>
+ <title>Add a listener</title>
<para>
- 1.1 Add a listener In the java file, in @ComponentConfig, add this code :
+ In the java file, in @ComponentConfig, add this code :
</para>
-<programlisting>events = {
+<programlisting role="JAVA"><![CDATA[events = {
@EventConfig(listeners = UITestRomainPortlet.OpenPopupActionListener.class)
-}
-</programlisting>
+}]]></programlisting>
<para>
Remark : XXXActionLister.class XXX must match the name you set for the event in the groovy.
</para>
-<programlisting>static public class OpenPopupActionListener extends EventListener<UITestRomainPortlet> {
- public void execute(Event<UITestRomainPortlet> event) throws Exception {
+<programlisting role="JAVA"><![CDATA[static public class OpenPopupActionListener extends EventListener<UITestRomainPortlet> {
+ public void execute(Event<UITestRomainPortlet> event) throws Exception {
System.out.println("HelloWorld");
}
-}
-</programlisting>
+}]]></programlisting>
+ </section>
+ <section>
+ <title>Redeploy</title>
<para>
- 1.1 Redeploy
- </para>
- <para>
Redeploy the portlet and click on the button. You will see "HelloWorld" in your console. If you don't change in the portlet, try to redeploy and reboot the tomcat server.
</para>
+ </section>
+ </section>
+ <section>
+ <title>Add a "HelloWorld" popup</title>
<para>
- 1 Add a "HelloWorld" popup
- </para>
- <para>
Now, we will add a popup which say "HelloWorld" when you click on the button.
</para>
<para>
First, create the groovy template of the popup : in webapp/groovy/testRomain/portlet, create UIHelloWorldPopupContent.gtmpl :
</para>
-<programlisting><div id="<%=uicomponent.getId();%>">
- HelloWorld in a popup!images/!!
-</div>
-</programlisting>
+<programlisting role="HTML"><![CDATA[<div id="<%=uicomponent.getId();%>">
+ HelloWorld in a popup
+</div>]]></programlisting>
<para>
In java/testRomain/portlet/component, create the java file for the popup look like : {code} package testRomain.portlet.component;
</para>
+ <programlisting role="JAVA"><![CDATA[package testRomain.portlet.component;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/testRomain/portlet/UIHelloWorldPopupContent.gtmpl"
+ )
+public class UIHelloWorldPopupContent extends UIComponent {
+
+ public UIHelloWorldPopupContent() throws Exception {
+ }
+
+}]]></programlisting>
<para>
- import org.exoplatform.webui.config.annotation.ComponentConfig; import org.exoplatform.webui.core.UIComponent; import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+ In UITestRomainPortlet.java, we will create the popup at the portlet creation (in the constructor) :
</para>
+<programlisting role="JAVA"><![CDATA[public UITestRomainPortlet() throws Exception {
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+
+ UIHelloWorldPopupContent popupContent = createUIComponent(UIHelloWorldPopupContent.class, null, null);
+ popup.setUIComponent(popupContent);
+ popup.setRendered(false);
+ ]]></programlisting>
<para>
- @ComponentConfig( lifecycle = UIApplicationLifecycle.class, template = "app:/groovy/testRomain/portlet/UIHelloWorldPopupContent.gtmpl" )
- </para>
- <para>
- public class UIHelloWorldPopupContent extends UIComponent
- </para>
- <para>
- public UIHelloWorldPopupContent() throws Exception { }{ } {code}
- </para>
- <para>
- In UITestRomainPortlet.java, we will create the popup at the portlet creation (in the constructor) : {code} public UITestRomainPortlet() throws Exception UIPopupWindow popup = addChild(UIPopupWindow.class, null, null); popup.setWindowSize(400, 300);
- </para>
- <para>
- {UIHelloWorldPopupContent popupContent = createUIComponent(UIHelloWorldPopupContent.class, null, null); popup.setUIComponent(popupContent); popup.setRendered(false); } {code}
- </para>
- <para>
At the beginning, we set the popup not visible. As you see, we add a children to the Portlet. So, if we want to see the content of it, we must add this in UITestPortletRomain.gtmpl :
</para>
-<programlisting><% uicomponent.renderChildren(); %>
-</programlisting>
+<programlisting><![CDATA[<% uicomponent.renderChildren(); %>]]></programlisting>
<para>
This makes the portlet generate the content of all child components.
</para>
<para>
- Change the treatment of the event, replace the println by : {code} public static class OpenPopupActionListener extends EventListener<UITestRomainPortlet> public void execute(Event<UITestRomainPortlet> event) throws Exception { UITestRomainPortlet portlet = event.getSource(); UIPopupWindow popup = portlet.getChild(UIPopupWindow.class); popup.setRendered(true); popup.setShow(true); }{ } {code}
+ Change the treatment of the event, replace the println by :
</para>
+ <programlisting role="JAVA"><![CDATA[public static class OpenPopupActionListener extends EventListener<UITestRomainPortlet> {
+ public void execute(Event<UITestRomainPortlet> event) throws Exception {
+ UITestRomainPortlet portlet = event.getSource();
+ UIPopupWindow popup = portlet.getChild(UIPopupWindow.class);
+ popup.setRendered(true);
+ popup.setShow(true);
+ }
+}]]></programlisting>
<para>
When user clicks on the button, the popup is shown.
</para>
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -2,144 +2,237 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Groovy_Templates">
- <!--
+ <title>Groovy Templates</title>
+ <section id="sect-Reference_Guide-Groovy_Templates-Overview">
+ <title>Overview</title>
+ <para>
+ This article gives a glance at the Groovy language, and
+ explains how to
+ configure the portlet and and the groovy
+ template.
+ </para>
+ <para>
+ It's recommended to read also
+ <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" />
+ in order to understand better the communication between the
+ Groovy Template and the portlet.
+ </para>
+ </section>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Groovy Templates</title>
- <section id="sect-Reference_Guide-Groovy_Templates-Overview">
- <title>Overview</title>
- <para>
- This article gives a glance at the Groovy language, and explains how to configure the portlet and and the groovy template.
+ <section id="sect-Reference_Guide-Groovy_Templates-Basic_structure">
+ <title>Basic structure</title>
+ <para>
+ The structure of a template is very easy :
</para>
- <para>
- It's recommended to read also <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" /> in order to understand better the communication between the Groovy Template and the portlet.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Groovy_Templates-Basic_structure">
- <title>Basic structure</title>
- <para>
- The structure of a template is very easy :
- </para>
- <itemizedlist>
- <listitem>
- <para>
- The HTML code
+ <itemizedlist>
+ <listitem>
+ <para>
+ The HTML code
</para>
- </listitem>
- <listitem>
- <para>
- zero or more groovy language code blocks, enclosed by <% ... %>
- </para>
- </listitem>
- </itemizedlist>
- <para>
- The HTML code in the template doesn't have to contain the <code>html</code>, or <code>body</code> tags. Hence, you can use a groovy template for a component that will be rendered in another component.
- </para>
- <para>
- Example : <emphasis role="bold">UIPortalApplication.gtmpl</emphasis> template (<emphasis role="bold">/GateInProjects/portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/</emphasis>)
- </para>
-
-<programlisting><!DOCTYPE html
+ </listitem>
+ <listitem>
+ <para>
+ zero or more groovy language code blocks, enclosed by
+ <% ... %> </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The HTML code in the template doesn't have to contain the
+ <literal>html</literal>
+ , or
+ <literal>body</literal>
+ tags. Hence, you can use a groovy template for a component that
+ will be rendered in another component.
+ </para>
+ <para>
+ Example :
+ </para>
+
+ <programlisting role="HTML"><![CDATA[<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<%
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<%
import org.exoplatform.webui.core.UIComponent;
def currentPage = uicomponent.getCurrentPage();
...
-%>
+%>
...
- <div class="$uicomponent.skin" id="UIPortalApplication">
- <%uicomponent.renderChildren();%>
+ <div class="$uicomponent.skin" id="UIPortalApplication">
+ <%uicomponent.renderChildren();%>
+ </div>]]>
</programlisting>
- </section>
-
- <section id="sect-Reference_Guide-Groovy_Templates-Groovy_language">
- <title>Groovy language</title>
- <para>
- Groovy is a scripting language for Java. Here are a few examples on how to use it, but you can find more information in <ulink url="http://groovy.codehaus.org/Documentation">the full documentation</ulink>.
+ </section>
+
+ <section id="sect-Reference_Guide-Groovy_Templates-Groovy_language">
+ <title>Groovy language</title>
+ <para>
+ Groovy is a scripting language for Java. Here are a few
+ examples on how to use it, but you can find more information in
+ <ulink url="http://groovy.codehaus.org/Documentation">the full documentation</ulink>
+ .
+ </para>
+ <para>
+ This language looks like Java a lot, so it's very easy to
+ use. Examples :
+ </para>
+ <para>
+ Variables definition :
+ </para>
+ <programlisting>int min = 1;
+def totalPage = uicomponent.getAvailablePage();
+String name = "uiPortlet";
+categories = uicomponent.getItemCategories();
+String columns = uicomponent.getColumns();</programlisting>
+ <para>Other expressions :</para>
+ <programlisting><![CDATA[for(category in categories) { ... }
+for(i in min..max) { ... } // min and max are int variables
+println "</div>" ;
+println """
+ <div class="Item">
+ <div class="OverflowContainer">
+""";
+<%=uicomponent.getToolbarStyle();%> // <%= to avoid a call of println method
+import org.exoplatform.portal.config.model.PageNode;]]></programlisting>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Groovy_Templates-Linking_a_portlet_with_a_template">
+ <title>Linking a portlet with a template</title>
+
+ <section
+ id="sect-Reference_Guide-Groovy_Templates-Portlet_configuration">
+ <title>Portlet configuration</title>
+ <para>
+ The configuration of a portlet is partly made with
+ <literal>ComponentConfig</literal> annotations (others are
+ ComponentConfigs, EventConfig, etc). One of the parameters
+ of
+ this annotation is called
+ <literal>template</literal>, where you can define the path
+ to
+ the template file associated with this portlet.
</para>
- <para>
- This language looks like Java a lot, so it's very easy to use. Examples :
+ <para>
+ To specify this parameter to your portlet, just add this
+ statement to your configuration annotation, for example in
+ <emphasis role="bold">src:/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/
+ </emphasis>
+ you find
+ <emphasis role="bold">UIApplicationForm.java</emphasis>
+ :
+ </para>
+
+ <programlisting>@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl",
+ events = {
+ @EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
+ @EventConfig(phase = Phase.DECODE, listeners = UIApplicationForm.CancelActionListener.class)
+ }
+)</programlisting>
+ <para>
+ You see that the path is in the namespace called "system",
+ "system" is a reference to the portal webapp. In this webapp
+ you find some reusable groovy templates, just open the
+ folder
+ <emphasis role="bold">src:/web/portal/src/main/webapp/groovy/webui/form/
+ </emphasis>
+ to see them.
+ </para>
+ <para>
+ As you want to create your own template, create a groovy
+ file
+ in your webbapp and refer to it. Please use the
+ namespace "app"
+ for refering to the same webapp as your
+ component. GateIn
+ always puts the component templates in a
+ folder like
+ "/webapp/groovy/<literal>your_portlet_name</literal>/webui/component".
+ </para>
+ <programlisting>template = "app:/groovy/your_portlet_name/webui/component/your_component.gtmpl"</programlisting>
+ <para>
+ You can now edit your template file.
</para>
- <para>
- Variables definition : {code} int min = 1; def totalPage = uicomponent.getAvailablePage(); String name = "uiPortlet"; categories = uicomponent.getItemCategories(); String columns = uicomponent.getColumns(); {code} Other expressions : {code} for(category in categories) { ... } // easy to use for loop for(i in min..max) { ... } // min and max are int variables println "</div>" ; println """ <div class="Item"> <div class="OverflowContainer"> """; <%=uicomponent.getToolbarStyle();%> // <%= to avoid a call of println method import org.exoplatform.portal.config.model.PageNode; {code}
+ </section>
+
+ <section id="sect-Reference_Guide-Groovy_Templates-The_template_file">
+ <title>The template file</title>
+ <para>
+ As we said before, the template file is composed of HTML
+ code and
+ groovy code blocks. There are a few things more that
+ you
+ need
+ to know to fully link your portlet with your
+ template.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Groovy_Templates-Linking_a_portlet_with_a_template">
- <title>Linking a portlet with a template</title>
- <para>
- Stuff Goes Here?
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Groovy_Templates-Portlet_configuration">
- <title>Portlet configuration</title>
- <para>
- The configuration of a portlet is partly made with {style:type=span|font-family=courier new,courier}ComponentConfig {style}annotations (others are ComponentConfigs, EventConfig, etc). One of the parameters of this annotation is called {style:type=span|font-family=courier new,courier}template{style}, where you can define the path to the template file associated with this portlet.
- </para>
- <para>
- To specify this parameter to your portlet, just add this statement to your configuration annotation, for example in <emphasis role="bold">/GateInProjects/portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/</emphasis> you find <emphasis role="bold">UIApplicationForm.java</emphasis>:
- </para>
-
-<programlisting>@ComponentConfig(
- lifecycle = UIFormLifecycle.class,
- template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl",
- events = {
- @EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
- @EventConfig(phase = Phase.DECODE, listeners = UIApplicationForm.CancelActionListener.class)
- }
-)
-</programlisting>
- <para>
- You see that the path is in the namespace called "system", "system" is a reference to the portal webapp. In this webapp you find some reusable groovy templates, just open the folder <emphasis role="bold">/GateInProjects/portal/trunk/web/portal/src/main/webapp/groovy/webui/form/</emphasis> to see them.
- </para>
- <para>
- As you want to create your own template, create a groovy file in your webbapp and refer to it. Please use the namespace "app" for refering to the same webapp as your component. GateIn always puts the component templates in a folder like "/webapp/groovy/your<emphasis>portlet</emphasis>name/webui/component".
- </para>
-
-<programlisting>template = "app:/groovy/your_portlet_name/webui/component/your_component.gtmpl"
-</programlisting>
- <para>
- You can now edit your template file.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Groovy_Templates-The_template_file">
- <title>The template file</title>
- <para>
- As we said before, the template file is composed of HTML code and groovy code blocks. There are a few things more that you need to know to fully link your portlet with your template.
- </para>
- <para>
- If your template defines the UI of a component, you have an access to this component instance (the java object) using the variable {style:type=span|font-family=courier new,courier}uicomponent{style}. This should be the case almost all the time, but we recommend that you check that your java class inherits from UIComponent before you use this variable. With this {style:type=span|font-family=courier new,courier}uicomponent {style}variable, you can access all the attributes and functions of your component, to use them in your template. Example : UIPageIterator.gtmpl {code} <% def currentPage = uicomponent.getCurrentPage(); %> ... <a href="<%=uicomponent.event("ShowPage","$currentPage")%>" class="Icon LastTopPageIcon"><span></span></a> {code}
- </para>
- <para>
- This example shows that {style:type=span|font-family=courier new,courier}uicomponent {style}can be used to make Ajax calls, thanks to the {style:type=span|font-family=courier new,courier}event {style}method. See <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" /> for more details.
- </para>
- <para>
- Another variable that you can use is {style:type=span|font-family=courier new,courier}{style}<emphasis>ctx. It gives access to the context in which the template is processed. Hence, you can get some elements like the request, the Javscript manager, or the resource resolver (</emphasis>ctx.appRes). Examples : {code} <% def rcontext = <emphasis>ctx.getRequestContext() ; rcontext.getJavascriptManager().importJavascript('GateIn.webui.UIPopupWindow');</emphasis>ctx.appRes(popupId + ".title."+ title); %> {code}
- </para>
- <para>
- If you use your template to define the user interface of a component that includes a form, you can access the instance of UIForm in a variable named {style:type=span|font-family=courier new,courier}uiform{style}. The UIForm class provides the methods, {style:type=span|font-family=courier new,courier}begin(){style} and {style:type=span|font-family=courier new,courier}end(){style}, that write the HTML tags of the form. Your form class must inherit from <literal>UIForm</literal>, in this class you add the input elements (fields, checkboxes, lists) which you wish to use in your form. In your groovy template you can render your input elements using {style:type=span|font-family=courier new,courier}{style}{code}{ uiform.renderField(field) }{code}
- </para>
- </section>
+ <para>
+ If your template defines the UI of a component, you have
+ an access to
+ this component instance (the java object) using
+ the variable
+ <literal>uicomponent</literal>. This should be the case
+ almost
+ all the time, but we recommend that you check that
+ your java
+ class inherits from UIComponent before you use this
+ variable.
+ With this <literal>uicomponent</literal> variable, you can access all
+ the
+ attributes and functions of your component, to use them
+ in your
+ template. Example : UIPageIterator.gtmpl:
+ </para>
+ <programlisting><![CDATA[<%
+ def currentPage = uicomponent.getCurrentPage();
+%>
+...
+<a href="<%=uicomponent.event("ShowPage","$currentPage")%>" class="Icon LastTopPageIcon">
+ <span></span>
+</a>]]></programlisting>
+ <para>
+ This example shows that <literal>uicomponent</literal> can be used to make Ajax
+ calls,
+ thanks to the <literal>event</literal> method. See
+ <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" />
+ for more details.
+ </para>
+ <para>
+ Another variable that you can use is
+ <literal>ctx</literal>. It gives access to the context in which the
+ template is processed. Hence, you can get some elements
+ like
+ the request, the Javscript manager, or the resource
+ resolver (ctx.appRes).
+ Examples :
+ </para>
+ <programlisting><![CDATA[<%
+ def rcontext = ctx.getRequestContext() ;
+ context.getJavascriptManager().importJavascript('GateIn.webui.UIPopupWindow');
+ ctx.appRes(popupId + ".title."+ title);
+%>]]></programlisting>
+ <para>
+ If you use your template to define the user interface of a
+ component that includes a form, you can access the instance
+ of
+ UIForm in a variable named
+ <literal>uiform</literal>. The UIForm class provides the
+ methods, <literal>begin()</literal> and
+ <literal>end()</literal>,
+ that write the HTML tags of the
+ form. Your form class must
+ inherit from
+ <literal>UIForm</literal>
+ , in this class you add the input elements (fields,
+ checkboxes,
+ lists) which you wish to use in your form. In
+ your groovy
+ template you can render your input elements using
+ <literal>uiform.renderField(field)</literal>
+ </para>
+ </section>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -2,70 +2,77 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Portlet_Lifecycle">
- <!--
+ <title>Portlet Lifecycle</title>
+ <section id="sect-Reference_Guide-Portlet_Lifecycle-Overview">
+ <title>Overview</title>
+ <para>
+ The goal of this chapter is not to talk about the Portlet API
+ specification lifecycle but more about GateIn UI framework to
+ easily develop portlets.
+ </para>
+ <para>
+ The web framework used here has been completely developed by GateIn and
+ perfectly suits the portal environment, it even allows to send
+ events from the portlet UIComponents to the Portal ones.
+ </para>
+ <para>
+ Of course using the GateIn web framework to build portlets is not
+ necessary and any other web framework that supports portlet
+ environment can be used. But all GateIn portlets that are part
+ of GateIn products are developed using that framework and we
+ provide several UI components that can be used in different
+ abstracted contexts such as the portal itself or some portlets.
+ </para>
+ <para>
+ This chapter is not a tutorial on how to write portlets, it
+ will go in the details of the code implementation and logic;
+ hence it is intended for advanced developers. It is also
+ advised to read the
+ <xref linkend="sect-Reference_Guide-Portal_Lifecycle" />
+ article before as the that article explains concepts that are
+ similar and top hierarchy classes that are shared.
+ </para>
+ </section>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ <section id="sect-Reference_Guide-Portlet_Lifecycle-Portlet_init">
+ <title>Portlet init</title>
+ <para>
+ The main entry point for configuring a portlet is in the
+ <emphasis role="bold">portlet.xml</emphasis>
+ file located in the portlet application WAR. Every portlet that
+ shall be built using the GateIn web framework must reference
+ the
+ <emphasis role="bold">PortletApplicationController</emphasis>
+ . The portlet configuration such as the root component is
+ defined in a
+ <emphasis role="bold">configuration.xml</emphasis>
+ file. The path to this configuration.xml file is defined in the
+ init-param "
+ <emphasis role="bold">webui.configuration</emphasis>
+ " of porlet.xml.
+ </para>
- --><title>Portlet Lifecycle</title>
- <section id="sect-Reference_Guide-Portlet_Lifecycle-Overview">
- <title>Overview</title>
- <para>
- The goal of this chapter is not to talk about the Portlet API specification lifecycle but more about GateIn UI framework to easily develop portlets.
- </para>
- <para>
- The web framework used here has been completely developed by GateIn and perfectly suits the portal environment, it even allows to send events from the portlet UIComponents to the Portal ones.
- </para>
- <para>
- Of course using the GateIn web framework to build portlets is not necessary and any other web framework that supports portlet environment can be used. But all GateIn portlets that are part of GateIn products are developed using that framework and we provide several UI components that can be used in different abstracted contexts such as the portal itself or some portlets.
- </para>
- <para>
- This chapter is not a tutorial on how to write portlets, it will go in the details of the code implementation and logic; hence it is intended for advanced developers. It is also advised to read the <xref linkend="sect-Reference_Guide-Portal_Lifecycle" /> article before as the that article explains concepts that are similar and top hierarchy classes that are shared.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Portlet_Lifecycle-Portlet_init">
- <title>Portlet init</title>
- <para>
- The main entry point for configuring a portlet is in the <emphasis role="bold">portlet.xml</emphasis> file located in the portlet application WAR. Every portlet that shall be built using the GateIn web framework must reference the <emphasis role="bold">PortletApplicationController</emphasis> . The portlet configuration such as the root component is defined in a <emphasis role="bold">configuration.xml</emphasis> file. The path to this configuration.xml file is defined in the init-param "<emphasis role="bold">webui.configuration</emphasis>" of porlet.xml.
- </para>
-
-<programlisting> <portlet>
- <description xml:lang="EN">Content Portlet</description>
- <portlet-name>ContentPortlet</portlet-name>
- <display-name xml:lang="EN">Content Portlet</display-name>
- <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <programlisting><![CDATA[<portlet>
+ <description xml:lang="EN">Content Portlet</description>
+ <portlet-name>ContentPortlet</portlet-name>
+ <display-name xml:lang="EN">Content Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
- <init-param>
- <name>webui.configuration</name>
- <value>/WEB-INF/conf/portlet/content/ContentPortlet/webui/configuration.xml</value>
- </init-param>
-</programlisting>
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/content/ContentPortlet/webui/configuration.xml</value>
+ </init-param>
+</portlet>]]></programlisting>
<para>
The structure of the <emphasis role="bold">configuration.xml</emphasis> file is exactly the same as the <emphasis>webui-configuration.xml</emphasis>which we have already introduced in the <xref linkend="sect-Reference_Guide-Portal_Lifecycle" /> article. In the case of the content portlet it looks like:
</para>
-<programlisting><webui-configuration>
- <application>
- <ui-component-root>org.exoplatform.content.webui.component.UIContentPortlet</ui-component-root>
- <state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
- </application>
-</webui-configuration>
-</programlisting>
+<programlisting><![CDATA[<webui-configuration>
+ <application>
+ <ui-component-root>org.exoplatform.content.webui.component.UIContentPortlet</ui-component-root>
+ <state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>]]></programlisting>
<para>
The <emphasis role="bold">PortletApplicationController</emphasis> class extends the <emphasis role="bold">GenericPortlet</emphasis> class defined in the Portlet API specification.
</para>
@@ -73,25 +80,24 @@
All methods like <emphasis>processAction()</emphasis> or <emphasis>render()</emphasis> are delegated to the <emphasis role="bold">PortletApplication</emphasis>. The creation and caching inside the <emphasis role="bold">WebController</emphasis> object is described in the following method:
</para>
-<programlisting> /**
- * try to obtain the PortletApplication from the WebAppController.
- *
- * If it does not exist a new PortletApplication object is created, init and cached in the
- * controller
- */
- private PortletApplication getPortletApplication() throws Exception {
- PortalContainer container = PortalContainer.getInstance() ;
- WebAppController controller =
- (WebAppController)container.getComponentInstanceOfType(WebAppController.class) ;
- PortletApplication application = controller.getApplication(applicationId_) ;
- if(application == null) {
- application = new PortletApplication(getPortletConfig()) ;
- application.onInit() ;
- controller.addApplication(application) ;
- }
- return application ;
+<programlisting><![CDATA[/**
+ * try to obtain the PortletApplication from the WebAppController.
+ *
+ * If it does not exist a new PortletApplication object is created, init and cached in the
+ * controller
+ */
+private PortletApplication getPortletApplication() throws Exception {
+ PortalContainer container = PortalContainer.getInstance() ;
+ WebAppController controller =
+ (WebAppController)container.getComponentInstanceOfType(WebAppController.class) ;
+ PortletApplication application = controller.getApplication(applicationId_) ;
+ if(application == null) {
+ application = new PortletApplication(getPortletConfig()) ;
+ application.onInit() ;
+ controller.addApplication(application) ;
}
-</programlisting>
+ return application ;
+}]]></programlisting>
</section>
<section id="sect-Reference_Guide-Portlet_Lifecycle-Portlet_request_handler">
@@ -107,80 +113,78 @@
The code of the method in PortletApplication is described here. The business logic is shown in the javadoc:
</para>
-<programlisting> /**
- * The processAction() method is the one modelled according to the Portlet API specification
- *
- * The process is quite simple and here are te different steps done in the method:
- *
- * 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the class) is referenced
- * 2) A new request context of type PortletRequestContext (which extends the class WebuiRequestContext) is
- * created as a child of the current context instance
- * 3) The new context is place inside the ThreadLocal and hence overides its parent one there,
- * only for the portlet request lifeciclye
- * 4) The method onStartRequest() is called in all the ApplicationLifecycle objects referenced in the webui
- * configuration XML file
- * 5) The StateManager object (in case of portlet it is an object of type ParentAppStateManager) is used to get the RootComponent
- * also referenced in the XML configuration file
- * 6) The methods processDecode(UIApplication, WebuiRequestContext) and processAction(UIApplication, WebuiRequestContext)
- * are then called
- * 7) Finally, a flag, to tell that the processAction phase was done, in the context is set to true and the parent
- * context is restored in the Threadlocal
- */
- public void processAction(ActionRequest req, ActionResponse res) throws Exception {
- WebuiRequestContext parentAppRequestContext = WebuiRequestContext.getCurrentInstance() ;
- PortletRequestContext context = createRequestContext(req, res, parentAppRequestContext) ;
- WebuiRequestContext.setCurrentInstance(context) ;
- try {
- for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
- lifecycle.onStartRequest(this, context) ;
- }
- UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
- context.setUIApplication(uiApp) ;
- processDecode(uiApp, context) ;
- if(!images/context.isResponseComplete() &&!images/ context.getProcessRender()) {
- processAction(uiApp, context) ;
- }
- } finally {
- context.setProcessAction(true) ;
- WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
+<programlisting><![CDATA[/**
+ * The processAction() method is the one modelled according to the Portlet API specification
+ *
+ * The process is quite simple and here are te different steps done in the method:
+ *
+ * 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the class) is referenced
+ * 2) A new request context of type PortletRequestContext (which extends the class WebuiRequestContext) is
+ * created as a child of the current context instance
+ * 3) The new context is place inside the ThreadLocal and hence overides its parent one there,
+ * only for the portlet request lifeciclye
+ * 4) The method onStartRequest() is called in all the ApplicationLifecycle objects referenced in the webui
+ * configuration XML file
+ * 5) The StateManager object (in case of portlet it is an object of type ParentAppStateManager) is used to get the RootComponent
+ * also referenced in the XML configuration file
+ * 6) The methods processDecode(UIApplication, WebuiRequestContext) and processAction(UIApplication, WebuiRequestContext)
+ * are then called
+ * 7) Finally, a flag, to tell that the processAction phase was done, in the context is set to true and the parent
+ * context is restored in the Threadlocal
+ */
+public void processAction(ActionRequest req, ActionResponse res) throws Exception {
+ WebuiRequestContext parentAppRequestContext = WebuiRequestContext.getCurrentInstance() ;
+ PortletRequestContext context = createRequestContext(req, res, parentAppRequestContext) ;
+ WebuiRequestContext.setCurrentInstance(context) ;
+ try {
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onStartRequest(this, context) ;
+ }
+ UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
+ context.setUIApplication(uiApp) ;
+ processDecode(uiApp, context) ;
+ if(!images/context.isResponseComplete() &&!images/ context.getProcessRender()) {
+ processAction(uiApp, context) ;
}
+ } finally {
+ context.setProcessAction(true) ;
+ WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
}
-</programlisting>
+}]]></programlisting>
<para>
The <emphasis role="bold">PortletRequestContext</emphasis> extends <emphasis role="bold">WebuiRequestContext</emphasis> class and acts as a wrapper on top of all the portlet request information:
</para>
-<programlisting> /**
- * In this method we try to get the PortletRequestContext object from the attribute map of the parent
- * WebuiRequestContext.
- *
- * If it is not cached then we create a new instance, if it is cached then we init it with the correct
- * writer, request and response objects
- *
- * We finally cache it in the parent attribute map
- *
- */
- private PortletRequestContext createRequestContext(PortletRequest req, PortletResponse res,
- WebuiRequestContext parentAppRequestContext) throws IOException {
- String attributeName = getApplicationId() + "$PortletRequest" ;
- PortletRequestContext context =
- (PortletRequestContext) parentAppRequestContext.getAttribute(attributeName) ;
- Writer w = null ;
- if(res instanceof RenderResponse){
- RenderResponse renderRes = (RenderResponse)res;
- renderRes.setContentType("text/html; charset=UTF-8");
- w = renderRes.getWriter() ;
- }
- if(context!images/= null) {
- context.init(w, req, res) ;
- } else {
- context = new PortletRequestContext(this, w, req, res) ;
- parentAppRequestContext.setAttribute(attributeName, context) ;
- }
- context.setParentAppRequestContext(parentAppRequestContext) ;
- return context;
+<programlisting><![CDATA[/**
+ * In this method we try to get the PortletRequestContext object from the attribute map of the parent
+ * WebuiRequestContext.
+ *
+ * If it is not cached then we create a new instance, if it is cached then we init it with the correct
+ * writer, request and response objects
+ *
+ * We finally cache it in the parent attribute map
+ *
+ */
+private PortletRequestContext createRequestContext(PortletRequest req, PortletResponse res,
+ WebuiRequestContext parentAppRequestContext) throws IOException {
+ String attributeName = getApplicationId() + "$PortletRequest" ;
+ PortletRequestContext context =
+ (PortletRequestContext) parentAppRequestContext.getAttribute(attributeName) ;
+ Writer w = null ;
+ if(res instanceof RenderResponse){
+ RenderResponse renderRes = (RenderResponse)res;
+ renderRes.setContentType("text/html; charset=UTF-8");
+ w = renderRes.getWriter() ;
}
-</programlisting>
+ if(context!images/= null) {
+ context.init(w, req, res) ;
+ } else {
+ context = new PortletRequestContext(this, w, req, res) ;
+ parentAppRequestContext.setAttribute(attributeName, context) ;
+ }
+ context.setParentAppRequestContext(parentAppRequestContext) ;
+ return context;
+}]]></programlisting>
<para>
In the PortletApplication, the line
</para>
@@ -188,7 +192,7 @@
<emphasis>UIApplication uiApp = getStateManager().restoreUIRootComponent(context);</emphasis> asks the StateManager defined for the portlet to get the UI root component. In the case of a portlet the root component must extend UIPortletApplication.
</para>
-<programlisting>public class ParentAppStateManager extends StateManager {
+<programlisting><![CDATA[public class ParentAppStateManager extends StateManager {
/**
* This method simply delegate the call to the same method of the parent WebuiRequestContext
@@ -197,38 +201,37 @@
public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
WebuiRequestContext pcontext = (WebuiRequestContext) context.getParentAppRequestContext() ;
return pcontext.getStateManager().restoreUIRootComponent(context) ;
- }
-</programlisting>
+ }]]></programlisting>
<para>
Hence this is the PortalStateManager that will also handle the extraction of the root component.
</para>
-<programlisting> public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
- context.setStateManager(this) ;
- WebuiApplication app = (WebuiApplication)context.getApplication() ;
-
- /*
- * If the request context is of type PortletRequestContext, we extract the parent context which will
- * allow to get access to the PortalApplicationState object thanks to the session id used as the key for the
- * syncronised Map uiApplications
- */
- if(context instanceof PortletRequestContext) {
- WebuiRequestContext preqContext = (WebuiRequestContext) context.getParentAppRequestContext() ;
- PortalApplicationState state = uiApplications.get(preqContext.getSessionId()) ;
- PortletRequestContext pcontext = (PortletRequestContext) context ;
- String key = pcontext.getApplication().getApplicationId() ;
- UIApplication uiApplication = state.get(key) ;
- if(uiApplication!images/= null) return uiApplication;
- synchronized(uiApplications) {
- ConfigurationManager cmanager = app.getConfigurationManager() ;
- String uirootClass = cmanager.getApplication().getUIRootComponent() ;
- Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass) ;
- uiApplication = (UIApplication)app.createUIComponent(type, null, null, context) ;
- state.put(key, uiApplication) ;
- }
- return uiApplication ;
+<programlisting><![CDATA[public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
+ context.setStateManager(this) ;
+ WebuiApplication app = (WebuiApplication)context.getApplication() ;
+
+ /*
+ * If the request context is of type PortletRequestContext, we extract the parent context which will
+ * allow to get access to the PortalApplicationState object thanks to the session id used as the key for the
+ * syncronised Map uiApplications
+ */
+ if(context instanceof PortletRequestContext) {
+ WebuiRequestContext preqContext = (WebuiRequestContext) context.getParentAppRequestContext() ;
+ PortalApplicationState state = uiApplications.get(preqContext.getSessionId()) ;
+ PortletRequestContext pcontext = (PortletRequestContext) context ;
+ String key = pcontext.getApplication().getApplicationId() ;
+ UIApplication uiApplication = state.get(key) ;
+ if(uiApplication!images/= null) return uiApplication;
+ synchronized(uiApplications) {
+ ConfigurationManager cmanager = app.getConfigurationManager() ;
+ String uirootClass = cmanager.getApplication().getUIRootComponent() ;
+ Class type = Thread.currentThread().getContextClassLoader().loadClass(uirootClass) ;
+ uiApplication = (UIApplication)app.createUIComponent(type, null, null, context) ;
+ state.put(key, uiApplication) ;
}
-</programlisting>
+ return uiApplication ;
+ }
+}]]></programlisting>
</section>
<section id="sect-Reference_Guide-Portlet_Lifecycle-Render_phase">
@@ -237,88 +240,85 @@
The render method business logic is quite similar to processAction().
</para>
-<programlisting> /**
- * The render method business logic is quite similar to the processAction() one.
- *
- * 1) A PortletRequestContext object is created (or extracted from the cache if it already exists)
- * and initialized
- * 2) The PortletRequestContext replaces the parent one in the WebuiRequestContext ThreadLocal object
- * 3) If the portal has already called the portlet processAction() then the call to all onStartRequest of
- * the ApplicationLifecycle has already been made, otherwise we call them
- * 4) The ParentStateManager is also used to get the UIApplication, as we have seen it delegates the call
- * to the PortalStateManager which caches the UI component root associated with the current application
- * 5) the processRender() method of the UIPortletApplucaton is called
- * 6) Finally, the method onEndRequest() is called on every ApplicationLifecycle referenced in the portlet
- * configuration XML file and the parent WebuiRequestContext is restored
- *
- */
- public void render(RenderRequest req, RenderResponse res) throws Exception {
- WebuiRequestContext parentAppRequestContext = WebuiRequestContext.getCurrentInstance() ;
- PortletRequestContext context = createRequestContext(req, res, parentAppRequestContext) ;
- WebuiRequestContext.setCurrentInstance(context) ;
+<programlisting><![CDATA[/**
+ * The render method business logic is quite similar to the processAction() one.
+ *
+ * 1) A PortletRequestContext object is created (or extracted from the cache if it already exists)
+ * and initialized
+ * 2) The PortletRequestContext replaces the parent one in the WebuiRequestContext ThreadLocal object
+ * 3) If the portal has already called the portlet processAction() then the call to all onStartRequest of
+ * the ApplicationLifecycle has already been made, otherwise we call them
+ * 4) The ParentStateManager is also used to get the UIApplication, as we have seen it delegates the call
+ * to the PortalStateManager which caches the UI component root associated with the current application
+ * 5) the processRender() method of the UIPortletApplucaton is called
+ * 6) Finally, the method onEndRequest() is called on every ApplicationLifecycle referenced in the portlet
+ * configuration XML file and the parent WebuiRequestContext is restored
+ *
+ */
+public void render(RenderRequest req, RenderResponse res) throws Exception {
+ WebuiRequestContext parentAppRequestContext = WebuiRequestContext.getCurrentInstance() ;
+ PortletRequestContext context = createRequestContext(req, res, parentAppRequestContext) ;
+ WebuiRequestContext.setCurrentInstance(context) ;
+ try {
+ if(!context.hasProcessAction()) {
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onStartRequest(this, context) ;
+ }
+ }
+ UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
+ context.setUIApplication(uiApp) ;
+ if(!context.isResponseComplete()) {
+ UIPortletApplication uiPortletApp = (UIPortletApplication)uiApp;
+ uiPortletApp.processRender(this, context) ;
+ }
+ uiApp.setLastAccessApplication(System.currentTimeMillis()) ;
+ } finally {
try {
- if(!context.hasProcessAction()) {
- for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
- lifecycle.onStartRequest(this, context) ;
- }
- }
- UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
- context.setUIApplication(uiApp) ;
- if(!context.isResponseComplete()) {
- UIPortletApplication uiPortletApp = (UIPortletApplication)uiApp;
- uiPortletApp.processRender(this, context) ;
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onEndRequest(this, context) ;
}
- uiApp.setLastAccessApplication(System.currentTimeMillis()) ;
- } finally {
- try {
- for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
- lifecycle.onEndRequest(this, context) ;
- }
- } catch (Exception exception){
- log.error("Error while trying to call onEndRequest of the portlet ApplicationLifecycle",
- exception);
- }
- WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
+ } catch (Exception exception){
+ log.error("Error while trying to call onEndRequest of the portlet ApplicationLifecycle",
+ exception);
}
+ WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
}
-</programlisting>
+}]]></programlisting>
<para>
The processRender() call made on the UIPortletApplication is shown now:
</para>
-<programlisting> /**
- * The default processRender for an UIPortletApplication handles two cases:
- *
- * A. Ajax is used
- * ~UWC_TOKEN_START~1255420331108~UWC_TOKEN_END~
- * If Ajax is used and that the entire portal should not be re rendered, then an AJAX fragment is
- * generated with information such as the portlet id, the portlet title, the portlet modes, the window
- * states as well as the HTML for the block to render
- *
- * B. A full render is made
- * ----
- * a simple call to the method super.processRender(context) which will delegate the call to all the
- * Lifecycle components
- *
- */
- public void processRender(WebuiApplication app, WebuiRequestContext context) throws Exception {
- WebuiRequestContext pContext = (WebuiRequestContext)context.getParentAppRequestContext();
- if(context.useAjax() &&!images/pContext.getFullRender()) {
- Writer w = context.getWriter() ;
-
- Set<UIComponent> list = context.getUIComponentToUpdateByAjax() ;
-// if(list == null) list = app.getDefaultUIComponentToUpdateByAjax(context) ;
- if(list!images/= null) {
- if(getUIPopupMessages().hasMessage()) context.addUIComponentToUpdateByAjax(getUIPopupMessages()) ;
- for(UIComponent uicomponent : list) {
- renderBlockToUpdate(uicomponent, context, w) ;
- }
- return ;
+<programlisting><![CDATA[/**
+ * The default processRender for an UIPortletApplication handles two cases:
+ *
+ * A. Ajax is used
+ * ----
+ * If Ajax is used and that the entire portal should not be re rendered, then an AJAX fragment is
+ * generated with information such as the portlet id, the portlet title, the portlet modes, the window
+ * states as well as the HTML for the block to render
+ *
+ * B. A full render is made
+ * ----
+ * a simple call to the method super.processRender(context) which will delegate the call to all the
+ * Lifecycle components
+ *
+ */
+public void processRender(WebuiApplication app, WebuiRequestContext context) throws Exception {
+ WebuiRequestContext pContext = (WebuiRequestContext)context.getParentAppRequestContext();
+ if(context.useAjax() &&!images/pContext.getFullRender()) {
+ Writer w = context.getWriter() ;
+
+ Set<UIComponent> list = context.getUIComponentToUpdateByAjax() ;
+ if(list!images/= null) {
+ if(getUIPopupMessages().hasMessage()) context.addUIComponentToUpdateByAjax(getUIPopupMessages()) ;
+ for(UIComponent uicomponent : list) {
+ renderBlockToUpdate(uicomponent, context, w) ;
}
+ return ;
}
- super.processRender(context) ;
}
-</programlisting>
+ super.processRender(context) ;
+}]]></programlisting>
</section>
</section>
Deleted: portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml 2009-12-09 08:59:26 UTC (rev 977)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml 2009-12-09 11:43:22 UTC (rev 978)
@@ -1,33 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
-<section id="sect-Reference_Guide-Sample_Basic_Portlet">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Sample Basic Portlet</title>
- <para>
- This sample shows a basic 1.0 portlet.
- </para>
- <para>
- Download the redirectportlet.war file in the attachment section.
- </para>
-</section>
-
-
15 years
gatein SVN: r977 - portal/trunk/docs/reference-guide/en/modules/portlets.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 03:59:26 -0500 (Wed, 09 Dec 2009)
New Revision: 977
Modified:
portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml
Log:
More doc cleanup/fixes
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml 2009-12-09 08:43:21 UTC (rev 976)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml 2009-12-09 08:59:26 UTC (rev 977)
@@ -2,324 +2,401 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-AJAX_in_GateIn_Framework">
- <!--
+ <title>AJAX in GateIn Framework</title>
+ <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Overview">
+ <title>Overview</title>
+ <para>
+ It is very easy to create and manage Ajax calls in our
+ framework. Just
+ a few lines to write in your template file and
+ your java class.
+ For simple Ajax update of a component, you
+ don't even have to
+ write any line of JavaScript.
+ </para>
+ </section>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portlet_Preparation">
+ <title>Portlet Preparation</title>
+ <para>
+ Our portlets can use specific
+ <literal>ActionListener</literal>
+ s to receive and process Ajax calls. To do that, you must
+ create an inner static class named following this convention :
+ action name followed by ActionListener
+ </para>
+ <para>
+ Example :
+ <literal>ParentClass</literal>
+ is the class in which you are writing.
+ </para>
- --><title>AJAX in GateIn Framework</title>
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Overview">
- <title>Overview</title>
- <para>
- It is very easy to create and manage Ajax calls in our framework. Just a few lines to write in your template file and your java class. For simple Ajax update of a component, you don't even have to write any line of JavaScript.
+ <programlisting><![CDATA[static public class SaveActionListener extends EventListener<ParentClass>]]></programlisting>
+ <para>
+ Don't forget to declare this listener in the configuration
+ of your
+ portlet, like this :
</para>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portlet_Preparation">
- <title>Portlet Preparation</title>
- <para>
- Our portlets can use specific <code>ActionListener</code>s to receive and process Ajax calls. To do that, you must create an inner static class named following this convention : action name followed by ActionListener
- </para>
- <para>
- Example : <code>ParentClass</code> is the class in which you are writing.
- </para>
-
-<programlisting>static public class SaveActionListener extends EventListener<ParentClass>
-</programlisting>
- <para>
- Don't forget to declare this listener in the configuration of your portlet, with this :
- </para>
-
-<programlisting>listeners = ParentClass.SaveActionListener.class{code}
-</programlisting>
- <para>
- in the correct annotation <code>ComponentConfig</code>, <code>EventConfig</code>, etc.,
- </para>
- <para>
- For example, the configuration of <code><strong>UIAccountForm</strong></code>:
- </para>
-
-<programlisting>...
+
+ <programlisting>listeners = ParentClass.SaveActionListener.class</programlisting>
+ <para>
+ along with the correct annotation
+ <literal>ComponentConfig</literal>
+ ,
+ <literal>EventConfig</literal>
+ , etc.,
+ </para>
+ <para>
+ For example, the configuration for
+ <literal>UIAccountForm</literal>
+ :
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
@ComponentConfig(
- lifecycle = UIFormLifecycle.class,
- template = "system:/groovy/webui/form/UIFormTabPane.gtmpl",
- initParams = {
- @ParamConfig(
- name = "AccountTemplateConfigOption",
- value = "app:/WEB-INF/conf/uiconf/account/webui/component/model/AccountTemplateConfigOption.groovy"
- ),
- @ParamConfig(
- name = "help.UIAccountFormQuickHelp",
- value = "app:/WEB-INF/conf/uiconf/account/webui/component/model/UIAccountFormQuickHelp.xhtml"
- )
- },
- events = {
- @EventConfig(listeners = UIAccountForm.SaveActionListener.class ),
- @EventConfig(listeners = UIAccountForm.ResetActionListener.class, phase = Phase.DECODE),
- @EventConfig(listeners = UIAccountForm.SearchUserActionListener.class, phase = Phase.DECODE)
- }
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIFormTabPane.gtmpl",
+ initParams = {
+ @ParamConfig(
+ name = "AccountTemplateConfigOption",
+ value = "app:/WEB-INF/conf/uiconf/account/webui/component/model/AccountTemplateConfigOption.groovy"
+ ),
+ @ParamConfig(
+ name = "help.UIAccountFormQuickHelp",
+ value = "app:/WEB-INF/conf/uiconf/account/webui/component/model/UIAccountFormQuickHelp.xhtml"
)
-...
-</programlisting>
- <para>
- Inside this class, you will have to create an <code>execute</code> method like this :
+ },
+ events = {
+ @EventConfig(listeners = UIAccountForm.SaveActionListener.class ),
+ @EventConfig(listeners = UIAccountForm.ResetActionListener.class, phase = Phase.DECODE),
+ @EventConfig(listeners = UIAccountForm.SearchUserActionListener.class, phase = Phase.DECODE)
+ }
+)
+...]]></programlisting>
+ <para>
+ Inside this class, you will have to create an
+ <literal>execute</literal>
+ method like this :
+ </para>
+
+ <programlisting><![CDATA[public void execute(Event<ParentClass> event) throws Exception]]></programlisting>
+ <para>
+ This method is called every time the listener gets an event
+ from the
+ client, hence you can process this event in it, using
+ the
+ even attribute. Use it to get parameters from a form in your
+ client, to modify the status of your portlet, etc.,
</para>
-
-<programlisting>public void execute(Event<ParentClass> event) throws Exception
-</programlisting>
- <para>
- This method is called every time the listener gets an event from the client, hence you can process this event in it, using the {style:type=span|font-family=courier new,courier}event {style}attibute. Use it to get parameters from a form in your client, to modify the status of your portlet, etc.,
+ <para>
+ Possible ways to use the event attribute :
</para>
- <para>
- Possible ways to use the event attribute : {code}
+ <itemizedlist>
+ <listitem>
+ <programlisting role="XML">String value = event.getRequestContext().getRequestParameter("name"); // to get a value from a form</programlisting>
+ </listitem>
+ <listitem>
+ <programlisting role="XML">ParentClass parent = event.getSource(); // to get the parent object (the portlet that threw and caugth the event)</programlisting>
+ </listitem>
+ <listitem>
+ <programlisting role="XML">UIMyComponent portal = parent.getAncestorOfType(UIMyComponent.class); // to get any node in the hierarchy of UIComponents</programlisting>
+ </listitem>
+ </itemizedlist>
+ <para>
+ If your action has to update an element on your client's
+ interface, you must call
+ <emphasis role="bold">addUIComponentToUpdateByAjax()
+ </emphasis>
+ at the end of the
+ <literal>execute</literal>
+ method:
+ </para>
+
+ <programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent);</programlisting>
+ <para>
+ The target component must be provided as parameter (the
+ component that
+ will be updated). We will come back on this
+ later.
</para>
- <itemizedlist>
- <listitem>
- <para>
- String value = event.getRequestContext().getRequestParameter("name"); // to get a value from a form
- </para>
- </listitem>
- <listitem>
- <para>
- ParentClass parent = event.getSource(); // to get the parent object (the portlet that threw and caugth the event)
- </para>
- </listitem>
- <listitem>
- <para>
- UIMyComponent portal = parent.getAncestorOfType(UIMyComponent.class); // to get any node in the hierarchy of UIComponents {code}
- </para>
- </listitem>
- </itemizedlist>
- <para>
- If your action has to update an element on your client's interface, you must call <emphasis role="bold">addUIComponentToUpdateByAjax()</emphasis> at the end of the <code>execute</code> method:
+ <para>
+ You must create one inner action listener class for each
+ Ajax call you
+ want to handle on this portlet. All these classes
+ must be
+ declared in the configuration annotations of the main
+ class,
+ otherwise you will get an error.
</para>
-
-<programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent) ;
-</programlisting>
- <para>
- The target component must be provided as parameter (the component that will be updated). We will come back on this later.
+ <para>
+ Done. Your portlet is ready to accept Ajax calls from
+ your client.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AJAX_in_the_Groovy_template">
+ <title>AJAX in the Groovy template</title>
+ <para>
+ Your server being configured to receive Ajax calls, you must
+ configure
+ the client interface to make these calls.
</para>
- <para>
- You must create one inner action listener class for each Ajax call you want to handle on this portlet. All these classes must be declared in the configuration annotations of the main class, otherwise you will get an error.
- </para>
- <para>
- It's done, your portlet is ready to accept Ajax calls from your client.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AJAX_in_the_Groovy_template">
- <title>AJAX in the Groovy template</title>
- <para>
- Your server being configured to receive Ajax calls, you must configure the client interface to make these calls.
- </para>
- <para>
- In the groovy template file associated with your portlet class (<code>ParentClass</code> here), you just have to add :
- </para>
-
-<programlisting>uicomponent.event("YourOperation"); // YourOperation is the same as in the ActionListener class (Save in our example above)
+ <para>
+ In the groovy template file associated with your portlet class
+ (
+ <literal>ParentClass</literal>
+ here), you just have to add :
+ </para>
+
+ <programlisting>uicomponent.event("YourOperation"); // YourOperation is the same as in the ActionListener class (Save in our example above)
</programlisting>
- <para>
- in a groovy code block. The event function will create an url starting with {style:type=span|font-family=courier new,courier}javascript:{style} so you have to make sure this code can be executed in your environment.
+ <para>
+ in a groovy code block. The event function will create an
+ url starting
+ with <literal>javascript:</literal> so you have to make sure this
+ code can be executed in your environment.
</para>
- <para>
- If your operation must update the content of a component, you have to make sure that the target component is well rendered. Basically, just type this :
+ <para>
+ If your operation must update the content of a component,
+ you have to
+ make sure that the target component is well
+ rendered.
+ Basically, just type this :
</para>
-
-<programlisting>uicomponent.renderChild(UITargetComponent.class) ;
-</programlisting>
- <para>
- in a groovy code block. <code>UITargetComponent</code> is the class of the component that will be updated when
+
+ <programlisting>uicomponent.renderChild(UITargetComponent.class) ;</programlisting>
+ <para>
+ in a groovy code block.
+ <literal>UITargetComponent</literal>
+ is the class of the component that will be updated when
+ </para>
+
+ <programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent) ;</programlisting>
+ <para>
+ is called. Hence,
+ <literal>uicomponent</literal>
+ must be of type
+ <literal>UITargetComponent</literal>
+ . If this component is not rendered by default, when the
+ portlet loads, don't forget to set its
+ <literal>rendered</literal>
+ attribute to false :
+ </para>
+
+ <programlisting>mycomponent.setRendered(false);</programlisting>
+ <para>
+ in the constructor of your portlet.
</para>
-
-<programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent) ;
-</programlisting>
- <para>
- is called. Hence, <code>uicomponent</code> must be of type <code>UITargetComponent</code>. If this component is not rendered by default, when the portlet loads, don't forget to set its <code>rendered</code> attribute to false :
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-How_JavaScript_works">
+ <title>How JavaScript works</title>
+ <para>
+ All the javascript is managed by the file
+ 02eXoresources:javascript/eXo/portal/PortalHttpRequest.js in the portal project.
+ </para>
+ <para>
+ In this class, you will find 4 functions/classes (detailed
+ below):
+ <itemizedlist>
+ <listitem><para>PortletResponse</para></listitem>
+ <listitem><para>PortalResponse</para></listitem>
+ <listitem><para>AjaxRequest</para></listitem>
+ <listitem><para>HttpResponseHandler</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ and 6 functions : {code}
</para>
-
-<programlisting>mycomponent.setRendered(false);
-</programlisting>
- <para>
- in the constructor of your portlet.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-How_JavaScript_works">
- <title>How JavaScript works</title>
- <para>
- All the javascript is managed by the file GateIn.portal.PortalHttpRequest.js in the portal project.
- </para>
- <para>
- In this class, you will find 4 functions/classes (detailed below):
- </para>
-
-<programlisting>* PortletResponse
-* PortalResponse
-* AjaxRequest
-* HttpResponseHandler
-</programlisting>
- <para>
- and 6 functions : {code}
- </para>
- <itemizedlist>
- <listitem>
- <para>
- ajaxGet // Calls doRequest with an url in GET mode
+ <itemizedlist>
+ <listitem>
+ <para>
+ ajaxGet // Calls doRequest with an url in GET mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxPost // Calls doRequest with an url in POST mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ doRequest // Creates the AjaxRequest and
+ HttpResponseHandler objects, and
+ lauches the request
+ process
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxAbort // Cancels the current request
</para>
- </listitem>
- <listitem>
- <para>
- ajaxPost // Calls doRequest with an url in POST mode
+ </listitem>
+ <listitem>
+ <para>
+ ajaxAsyncGetRequest // Allows to create and execute a
+ sync or async GET request
</para>
- </listitem>
- <listitem>
- <para>
- doRequest // Creates the AjaxRequest and HttpResponseHandler objects, and lauches the request process
+ </listitem>
+ <listitem>
+ <para>
+ ajaxRedirect // A simple javascript redirection with
+ window.location.href
+ {code} that are the entry points of
+ these classes. You
+ shouldn't have to call explicitly these
+ functions, since
+ the template file and the portlet class
+ manage
+ everything.
</para>
- </listitem>
- <listitem>
- <para>
- ajaxAbort // Cancels the current request
- </para>
- </listitem>
- <listitem>
- <para>
- ajaxAsyncGetRequest // Allows to create and execute a sync or async GET request
- </para>
- </listitem>
- <listitem>
- <para>
- ajaxRedirect // A simple javascript redirection with window.location.href {code} that are the entry points of these classes. You shouldn't have to call explicitly these functions, since the template file and the portlet class manage everything.
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortletResponse">
- <title>PortletResponse</title>
- <para>
- This class doesn't contain any method. On creation, it just gets the response elements from the xml returned by Ajax, and store them in the corresponding attributes : {code}
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortletResponse">
+ <title>PortletResponse</title>
+ <para>
+ This class doesn't contain any method. On creation, it just
+ gets the
+ response elements from the xml returned by Ajax, and
+ store them
+ in the corresponding attributes : {code}
</para>
- <itemizedlist>
- <listitem>
- <para>
- portletId
+ <itemizedlist>
+ <listitem>
+ <para>
+ portletId
</para>
- </listitem>
- <listitem>
- <para>
- portletTitle
+ </listitem>
+ <listitem>
+ <para>
+ portletTitle
</para>
- </listitem>
- <listitem>
- <para>
- portletMode // View, Edit, Help or Config
+ </listitem>
+ <listitem>
+ <para>
+ portletMode // View, Edit, Help or Config
</para>
- </listitem>
- <listitem>
- <para>
- portletState // Decode, Render
+ </listitem>
+ <listitem>
+ <para>
+ portletState // Decode, Render
</para>
- </listitem>
- <listitem>
- <para>
- portletData // The updated data to put in the component
+ </listitem>
+ <listitem>
+ <para>
+ portletData // The updated data to put in the
+ component
</para>
- </listitem>
- <listitem>
- <para>
- script //The javascript code to update the component
+ </listitem>
+ <listitem>
+ <para>
+ script //The javascript code to update the component
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ blocksToUpdate // An array containing the containers
+ to update with this script
+ {code}
</para>
- </listitem>
- <listitem>
- <para>
- blocksToUpdate // An array containing the containers to update with this script {code}
+ </listitem>
+ </itemizedlist>
+ <para>
+ You can access these attributes just by calling them from your
+ <literal>PortletResponse</literal>
+ instance.
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortalResponse">
+ <title>PortalResponse</title>
+ <para>
+ Contains an array of
+ <literal>PortletResponse</literal>
+ s (
+ <literal>portletResponses</literal>
+ ) and two other attributes : {code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ data // Data to update
</para>
- </listitem>
- </itemizedlist>
- <para>
- You can access these attributes just by calling them from your <code>PortletResponse</code> instance.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortalResponse">
- <title>PortalResponse</title>
- <para>
- Contains an array of <code>PortletResponse</code>s (<code>portletResponses</code>) and two other attributes : {code}
- </para>
- <itemizedlist>
- <listitem>
- <para>
- data // Data to update
+ </listitem>
+ <listitem>
+ <para>
+ script // Javascript code to update {code}
</para>
- </listitem>
- <listitem>
- <para>
- script // Javascript code to update {code}
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AjaxRequest">
- <title>AjaxRequest</title>
- <para>
- By far the most important class of this file. Wraps the XMLHttpRequest object with some functions and attributes, to make it easier to use. You can find the complete documentation here : http://www.ajaxtoolbox.com/request/documentation.php
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AjaxRequest">
+ <title>AjaxRequest</title>
+ <para>
+ By far the most important class of this file. Wraps the
+ XMLHttpRequest
+ object with some functions and attributes, to
+ make it easier to
+ use. You can find the complete documentation
+ here :
+ http://www.ajaxtoolbox.com/request/documentation.php
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-HttpResponseHandler">
+ <title>HttpResponseHandler</title>
+ <para>
+ This class provides methods to handle the Ajax response.
+ {code}
</para>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-HttpResponseHandler">
- <title>HttpResponseHandler</title>
- <para>
- This class provides methods to handle the Ajax response. {code}
- </para>
- <itemizedlist>
- <listitem>
- <para>
- executeScript // execute some javascript
+ <itemizedlist>
+ <listitem>
+ <para>
+ executeScript // execute some javascript
</para>
- </listitem>
- <listitem>
- <para>
- updateBlocks // update some html components
+ </listitem>
+ <listitem>
+ <para>
+ updateBlocks // update some html components
</para>
- </listitem>
- <listitem>
- <para>
- ajaxTimeout // a function called when the timeout of the ajax call exceeds. Just cancel the request
+ </listitem>
+ <listitem>
+ <para>
+ ajaxTimeout // a function called when the timeout of
+ the ajax call exceeds.
+ Just cancel the request
</para>
- </listitem>
- <listitem>
- <para>
- ajaxResponse // creates a PortalResponse object from the data from the Ajax request
+ </listitem>
+ <listitem>
+ <para>
+ ajaxResponse // creates a PortalResponse object from
+ the data from the Ajax
+ request
</para>
- </listitem>
- <listitem>
- <para>
- ajaxLoading // shows the loading popup and mask layer {code}
+ </listitem>
+ <listitem>
+ <para>
+ ajaxLoading // shows the loading popup and mask layer
+ {code}
</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portal_Ajax_Response_Data_Structure">
- <title>Portal Ajax Response Data Structure</title>
-
-<programlisting>{PortalResponse}
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portal_Ajax_Response_Data_Structure">
+ <title>Portal Ajax Response Data Structure</title>
+
+ <programlisting>{PortalResponse}
|
|--->{PortletResponse}
|
@@ -355,7 +432,7 @@
If you have several actions that need to appear in a popup, you can use this technique to manage the different popup windows easily:
</para>
<para>
- Create a <code>UIPopupAction</code> in your main portlet class:
+ Create a <literal>UIPopupAction</literal> in your main portlet class:
</para>
<programlisting>addChild(UIPopupAction.class, null, null);
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml 2009-12-09 08:43:21 UTC (rev 976)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml 2009-12-09 08:59:26 UTC (rev 977)
@@ -2,26 +2,7 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Create a WebUI Portlet</title>
+ <title>Create a WebUI Portlet</title>
<section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Overview">
<title>Overview</title>
<para>
Modified: portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml 2009-12-09 08:43:21 UTC (rev 976)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml 2009-12-09 08:59:26 UTC (rev 977)
@@ -2,76 +2,74 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Web_User_Interface_WebUI">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Web User Interface - WebUI</title>
- <para>
- WebUI is the name of GateIn's own webframework. GateIn Portal is built with it and also many applications available in the GateIn platform suites. In its concepts, the WebUI framework is similar to JSF as it is a component tree based framework. The key aspects of WebUI are :
+ <title>Web User Interface - WebUI</title>
+ <para>
+ WebUI is the name of GateIn's own webframework. GateIn Portal is built with
+ it and also many applications available in the GateIn platform
+ suites.
+ Using its own framework means that the way the portal is build will not interfere
+ with any web technology used by the portlet deployed. Using a particular technology
+ would have make it more difficult for a user to use a different version (newer or older)
+ of the same technology. If one choose to create WebUI portlets, here is some documentation.
+ </para>
+ <para>
+ In its concepts, the WebUI framework is similar to JSF as
+ it is a component tree based framework. The key aspects of WebUI
+ are :
</para>
- <itemizedlist>
- <listitem>
- <para>
- Events based flow
+ <itemizedlist>
+ <listitem>
+ <para>
+ Events based flow
</para>
- </listitem>
- <listitem>
- <para>
- Components configuration by annotation
+ </listitem>
+ <listitem>
+ <para>
+ Components configuration by annotation
</para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="sect-Reference_Guide-Groovy_Templates" /> for rendering
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Groovy_Templates" />
+ for rendering
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" />
+ support
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Portlet API friendly
</para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" /> support
- </para>
- </listitem>
- <listitem>
- <para>
- Portlet API friendly
- </para>
- </listitem>
- </itemizedlist>
- <section id="sect-Reference_Guide-Web_User_Interface_WebUI-Resources">
- <title>Resources</title>
- <itemizedlist>
- <listitem>
- <para>
- <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" /> : GateIn portlets are built with WebUI
- </para>
- </listitem>
- <listitem>
- <para>
- <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" />: GateIn portal itmself is a WebUI application
- </para>
- </listitem>
- <listitem>
- <para>
- How-to <xref linkend="sect-Reference_Guide-Create_a_WebUI_Portlet" />: Learn how to write your own app with WebUI
- </para>
- </listitem>
- </itemizedlist>
- </section>
+ </listitem>
+ </itemizedlist>
+ <section id="sect-Reference_Guide-Web_User_Interface_WebUI-Resources">
+ <title>Resources</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" />
+ : GateIn portlets are built with WebUI
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" />
+ : GateIn portal itself is a WebUI application
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ How-to:
+ <xref linkend="sect-Reference_Guide-Create_a_WebUI_Portlet" />
+ : Learn how to write your own app with WebUI
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
15 years
gatein SVN: r976 - portal/trunk/docs/reference-guide/en/modules/development.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-09 03:43:21 -0500 (Wed, 09 Dec 2009)
New Revision: 976
Modified:
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
Log:
More cleanup/fix
Modified: portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml 2009-12-09 03:23:12 UTC (rev 975)
+++ portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml 2009-12-09 08:43:21 UTC (rev 976)
@@ -8,8 +8,6 @@
<para>
All aspects of internationalization in GateIn products are covered. You should have a general knowledge of Internationalization in Java products. Sun created a <ulink url="http://java.sun.com/docs/books/tutorial/i18n/TOC.html">good internationalization tutorial</ulink> .
</para>
- <section id="sect-Reference_Guide-Overview-Introduction">
- <title>Introduction</title>
<para>All embedded applications contains property files for various languages. They are packaged with the portlets applications in a WEB-INF/classes/locale/ directory.</para>
<para>
You should notice that
@@ -85,7 +83,7 @@
<area id="i18n.locales.configuration.description" coords='7' />
<area id="i18n.locales.configuration.orientation" coords='22' />
</areaspec>
-<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<locales-config>
<locale-config>
<locale>en</locale>
@@ -144,77 +142,114 @@
</callout>
</calloutlist>
</programlistingco>
-
+ </section>
+ <section>
+ <title>ResourceBundleService</title>
<para>
- 1 ResourceBundleService
+ The resource bundle service is configured in: <filename>02portal.war:/WEB-INF/conf/common/common-configuration.xml</filename>:
</para>
- <para>
- The resource bundle service is configured here: // <ulink url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/portal/sr...">http://fisheye.exoplatform.org/browse/projects/portal/trunk/web/portal/sr...</ulink>
- </para>
- <para>
- Caution: Other GateIn products like DMS use dedicated configuration file called "resource-bundle-configuration.xml".
- </para>
- <para>
- A typical configuration looks like this one: {code:xml} <component> <key>org.exoplatform.services.resources.ResourceBundleService</key> <type>org.exoplatform.services.resources.jcr.ResourceBundleServiceImpl</type> <init-params>
- </para>
- <para>
- <values-param> <name>classpath.resources</name> <description>The resources that start with the following package name should be loaded from file system</description> <value>locale.portlet</value> </values-param>
- </para>
- <para>
- <values-param> <name>init.resources</name> <description>Store the following resources in the DB for the first launch </description> <value>locale.portal.expression</value> <value>locale.portal.services</value> <value>locale.portal.webui</value> <value>locale.portal.custom</value>
- </para>
- <para>
- <value>locale.navigation.portal.classic</value> <value>locale.navigation.group.platform.administrators</value> <value>locale.navigation.group.platform.users</value> <value>locale.navigation.group.platform.guests</value> <value>locale.navigation.group.organization.management.executive-board</value> </values-param>
- </para>
- <para>
- <values-param> <name>portal.resource.names</name> <description>The properties files of the portal, these files will be merged into one ResoruceBundle properties </description> <value>locale.portal.expression</value> <value>locale.portal.services</value> <value>locale.portal.webui</value> <value>locale.portal.custom</value> </values-param>
- </para>
- <para>
- </init-params> </component>
- </para>
-
-<programlisting>
-There are three parameters: *classpath.resources*, *init.resources*, and *portal.resource.names*. We will talk later about _classpath.resources_.
-In _init.resources_ you have to define _*all resources*_ that you want use in the product, independently of the fact that they belong to the portal or to the navigation. All these resources are stored in JCR at the first launch of your product. After that, you only can modify these resources using the [Portal:Internationalization Portlet].
-h2. Portal Resource Bundle
-The parameter *portal.resource.names* defines all resources that belong to the *Portal Resource Bundle*. This means that these resources are merged to a *single resource bundle* which is accessible from anywhere in GateIn products. As mentioned, all these keys are located in the same bundle, which is separated from the navigation resource bundles.
-h2. Navigation Resource Bundles
-There is a resource bundle for each navigation. A navigation can exist for user, groups, and portal. In the example above you see bundle definitions for the navigation of the classic portal and of four different groups. Each of these resource bundles lives in a different sphere, they are independent of each other and they do not belong to the portal.resource.names parameter (because they are not mentioned in _portal.resource.names_).
-As you learned in the introduction you must put the properties for a group in the _WEB-INF/classes/locale/navigation/group/_ folder.
-Example:
-*.../portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_en.properties*
-The folder and file names must correspond to the group hierarchy. The group name "executive-board" is followed by the iso 639 code. For each language you defined in the LocalesConfig you must provide a resource file.
-If you ever change the name of a group you also need to change the name of the folder and/or files of the correspondent navigation resource bundles.
-You already know the content of _executive-board_en.properties_:
-{code:none}
-organization.title=Organization
+ <programlistingco>
+ <areaspec>
+ <area id="i18n.rb.service.classpath_resources" coords='6' />
+ <area id="i18n.rb.service.init_resources" coords='11' />
+ <area id="i18n.rb.service.portal_resource_names" coords='24' />
+ </areaspec>
+ <programlisting><![CDATA[<component>
+ <key>org.exoplatform.services.resources.ResourceBundleService</key>
+ <type>org.exoplatform.services.resources.impl.SimpleResourceBundleService</type>
+ <init-params>
+ <values-param>
+ <name>classpath.resources</name>
+ <description>The resources that start with the following package name should be load from file system</description>
+ <value>locale.portlet</value>
+ </values-param>
+ <values-param>
+ <name>init.resources</name>
+ <description>Initiate the following resources during the first launch</description>
+ <value>locale.portal.expression</value>
+ <value>locale.portal.services</value>
+ <value>locale.portal.webui</value>
+ <value>locale.portal.custom</value>
+ <value>locale.navigation.portal.classic</value>
+ <value>locale.navigation.group.platform.administrators</value>
+ <value>locale.navigation.group.platform.users</value>
+ <value>locale.navigation.group.platform.guests</value>
+ <value>locale.navigation.group.organization.management.executive-board</value>
+ </values-param>
+ <values-param>
+ <name>portal.resource.names</name>
+ <description>The properties files of the portal , those file will be merged
+ into one ResoruceBundle properties </description>
+ <value>locale.portal.expression</value>
+ <value>locale.portal.services</value>
+ <value>locale.portal.webui</value>
+ <value>locale.portal.custom</value>
+ </values-param>
+ </init-params>
+</component>]]></programlisting>
+ <calloutlist>
+ <callout arearefs="i18n.rb.service.classpath_resources">
+ <para>
+ <emphasis>classpath.resources</emphasis>
+ We will talk later about classpath.resources
+ </para>
+ </callout>
+ <callout arearefs="i18n.rb.service.init_resources">
+ <para>
+ <emphasis>init.resources</emphasis>
+ TODO
+ </para>
+ </callout>
+ <callout arearefs="i18n.rb.service.portal_resource_names">
+ <para>
+ <emphasis>portal.resource.names</emphasis>
+ Defines all resources that belong to the <emphasis>Portal Resource Bundle</emphasis>.
+ This means that these resources are merged to a single resource bundle which is accessible from anywhere in GateIn products.
+ As mentioned, all these keys are located in the same bundle, which is separated from the navigation resource bundles.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+ </section>
+ <section>
+ <title>Navigation Resource Bundles</title>
+ <para>
+ There is a resource bundle for each navigation. A navigation can exist for user, groups, and portal. In the example above you see
+ bundle definitions for the navigation of the classic portal and of four different groups. Each of these resource bundles lives in
+ a different sphere, they are independent of each other and they do not belong to the portal.resource.names parameter (because they
+ are not mentioned in portal.resource.names).
+ </para>
+ <para>
+ As you learned in the introduction you must put the properties for a group in the WEB-INF/classes/locale/navigation/group/ folder.
+ Such as: <literal>/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_en.properties</literal>
+ The folder and file names must correspond to the group hierarchy. The group name "executive-board" is followed by the iso 639 code.
+ For each language you defined in the LocalesConfig you must provide a resource file.
+ If you ever change the name of a group you also need to change the name of the folder and/or files of the correspondent navigation
+ resource bundles.
+ Content of executive-board_en.properties:
+ <programlisting>organization.title=Organization
organization.newstaff=New Staff
-organization.management=Management
-</programlisting>
+organization.management=Management</programlisting>
+ </para>
<para>
- This resource bundle is only accessible for the navigation of the ~~organization.management.executive-board~~ group.
+ This resource bundle is only accessible for the navigation of the organization.management.executive-board group.
</para>
+ </section>
+ <section>
+ <title>
+ Portlets
+ </title>
<para>
- 1 Portlet
+ classpath.resources
</para>
<para>
- 1.1 classpath.resources
+ Portlets are independent application and they deliver their own resource files.
</para>
<para>
- Portlets are independent application and they deliver their own resource files. You can find an example for the GadgetPortlet: <!-- LB --> .../WEB-INF/classes/locale/portlet/gadget/GadgetPortlet/en.properties <ulink url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/portlet/dashb..." />
+ All shipped-in portlet resources are located in the <emphasis role="bold">locale/portlet</emphasis> subfolder.
+ The ResourceBundleService parameter <emphasis role="bold">classpath.resources</emphasis> defines this subfolder.
+ <!-- Doing so the resource file that are in ~~locale/portlet~~ will never be stored in the JCR and reloaded at each start of the application server. -->
</para>
- <para>
- All portlet resources are located in the <emphasis role="bold">locale/portlet</emphasis> subfolder. The ResourceBundleService parameter <emphasis role="bold">classpath.resources</emphasis> defines exactly this subfolder. Doing so the resource file that are in ~~locale/portlet~~ will never be stored in the JCR and reloaded at each start of the application server.
- </para>
-
-<programlisting><values-param>
- <name>classpath.resources</name>
- <description>The resources that start with the following package name should
- be loaded from file system</description>
- <value>locale.portlet</value>
-</values-param>
-</programlisting>
- </section>
<section id="sect-Reference_Guide-Overview-Example">
<title>Example</title>
@@ -222,18 +257,23 @@
Let's suppose you want to add a Spanish translation to the GadgetPortlet.
</para>
<para>
- Create the file in: <filename>.../WEB-INF/classes/locale/portlet/gadget/GadgetPortlet</filename>
+ Create the file <literal>GadgetPortlet_es.properties</literal> in: <filename>WEB-INF/classes/locale/portlet/gadget/GadgetPortlet</filename>
</para>
<para>
- In <emphasis role="bold">portlet.xml</emphasis>, add Spanish as a <emphasis role="bold">supported-locale</emphasis>, the <emphasis role="bold">resource-bundle</emphasis> is already declared and is the same for all languages : {code:xml} <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <resource-bundle>locale.portlet.gadget.GadgetPortlet</resource-bundle> {code}
- </para>
+ In <emphasis role="bold">portlet.xml</emphasis>, add Spanish as a <emphasis role="bold">supported-locale</emphasis> ('es' is the 2 letters code for Spanish), the <emphasis role="bold">resource-bundle</emphasis> is already declared and is the same for all languages :
+ </para>
+ <programlisting role="XML"><![CDATA[<supported-locale>en</supported-locale>
+<supported-locale>es</supported-locale>
+<resource-bundle>locale.portlet.gadget.GadgetPortlet</resource-bundle>]]></programlisting>
<para>
- Find <ulink type="http" url="http://developers.sun.com-portalserver-reference-techart-i18n-portlets.html" /> for more details about portlet internationalization.
+ See the portlet specification for more details about portlet internationalization.
</para>
+ <section>
+ <title>Standard portlet resource keys</title>
+ </section>
<para>
- 1.1 Standard Portlet Resource Keys There are three standard keys defined : Title, Short Title and Keywords. Keywords contain a comma-separated list of keywords.
+ The portlet specifications defines three standard keys: Title, Short Title and Keywords. Keywords contain a comma-separated list of keywords.
</para>
-
<programlisting> javax.portlet.title=Breadcrumbs Portlet
javax.portlet.short-title=Breadcrumbs
javax.portlet.keywords=Breadcrumbs, Breadcrumb
@@ -243,25 +283,26 @@
<section id="sect-Reference_Guide-Overview-Access">
<title>Access</title>
<para>
- Whenever you want to display a property in the user language you use its <emphasis>key</emphasis>. Using the below access method the translation is returned in the preferred language of the current http session:
+ Whenever you want to display a property in the user language you use its <emphasis>key</emphasis>. Using the below access method the translation is returned in the preferred language for the connected user:
</para>
<itemizedlist>
<listitem>
<para>
- Groovy Template{code}{code}
+ Groovy Template
+ <programlisting>TODO</programlisting>
</para>
</listitem>
<listitem>
<para>
Java
+<programlisting>WebuiRequestContext context = WebuiRequestContext.getCurrentInstance() ;
+ResourceBundle res = context.getApplicationResourceBundle() ;
+String translatedString = res.getString(key);
+</programlisting>
</para>
</listitem>
</itemizedlist>
-<programlisting>WebuiRequestContext context = WebuiRequestContext.getCurrentInstance() ;
-ResourceBundle res = context.getApplicationResourceBundle() ;
-String translatedString = res.getString(key);
-</programlisting>
</section>
<section id="sect-Reference_Guide-Overview-Debugging_resource_bundle_usage">
@@ -273,9 +314,7 @@
This feature translates a key to the same key value. For instance, the translated value for the key "organization.title" is simply the value "organization.title". Selecting that language allows to use the portal and its applications with <emphasis role="bold">all the keys visible</emphasis> and it is easy to find out the correct key for a given label in the portal page.
</para>
</section>
-
- </section>
-
+ </section>
</section>
15 years
gatein SVN: r975 - in portal/branches/wsrp-integration/portlet: exoadmin/src/main/java/org/exoplatform/wsrp and 15 other directories.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2009-12-08 22:23:12 -0500 (Tue, 08 Dec 2009)
New Revision: 975
Added:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
Modified:
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml
portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/portlet.xml
Log:
Initial WSRP ui and flow for adding consumer
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,138 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This 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; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.portal.webui.application.UIApplicationList;
+import org.exoplatform.portal.webui.application.UIPortlet;
+import org.exoplatform.portal.webui.container.UIContainerList;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.ComponentConfigs;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UITabPane;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+
+/** @author Wesley Hales */
+@ComponentConfigs({
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl"),
+@ComponentConfig(
+ id = "UIWsrpConsoleTab",
+ type = UITabPane.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl",
+ events = {@EventConfig(listeners = UIWsrpConsole.SelectTabActionListener.class)})})
+public class UIWsrpConsole extends UIContainer
+{
+ public UIWsrpConsole() throws Exception
+ {
+ UITabPane uiTabPane = addChild(UITabPane.class, "UIWsrpConsoleTab", null);
+ uiTabPane.addChild(UIWsrpConsumerOverview.class, null, null).setRendered(true);
+ uiTabPane.addChild(UIContainerList.class, null, null);
+ uiTabPane.setSelectedTab(1);
+ }
+
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+ UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+ int portalMode = uiPortalApp.getModeState();
+ if (portalMode != UIPortalApplication.NORMAL_MODE)
+ {
+ UITabPane uiTabPane = this.getChild(UITabPane.class);
+ UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+ if (uiComponent instanceof UIWsrpConsumerOverview)
+ {
+ if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
+ {
+ Util.showComponentEditInViewMode(UIPortlet.class);
+ }
+ else
+ {
+ uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+ Util.showComponentLayoutMode(UIPortlet.class);
+ }
+ }
+ else if (uiComponent instanceof UIContainerList)
+ {
+ if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
+ {
+ Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+ }
+ else
+ {
+ uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+ Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+ }
+ }
+ }
+ super.processRender(context);
+ }
+
+ static public class SelectTabActionListener extends UITabPane.SelectTabActionListener
+ {
+ public void execute(Event<UITabPane> event) throws Exception
+ {
+ super.execute(event);
+ UITabPane uiTabPane = event.getSource();
+ UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+ UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+ int portalMode = uiPortalApp.getModeState();
+
+ if (uiComponent instanceof UIWsrpConsumerOverview)
+ { // Swicth to Porlets Tab
+ if (portalMode % 2 == 0)
+ {
+ uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
+ Util.showComponentEditInViewMode(UIPortlet.class);
+ }
+ else
+ {
+ uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+ Util.showComponentLayoutMode(UIPortlet.class);
+ }
+ }
+ else if (uiComponent instanceof UIContainerList)
+ { // Swicth to
+ // Containers Tab
+ if (portalMode % 2 == 0)
+ {
+ uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
+ Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+ }
+ else
+ {
+ uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+ Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+ }
+ }
+ event.getRequestContext().addUIComponentToUpdateByAjax(
+ Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
+ }
+ }
+
+}
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This 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; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm;
+import org.exoplatform.applicationregistry.webui.component.UIApplicationForm;
+import org.exoplatform.applicationregistry.webui.component.UIApplicationOrganizer;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+
+/** @author Wesley Hales */
+@ComponentConfig(template = "app:/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl", lifecycle = UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIAddApplicationForm.AddActionListener.class),
+ @EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
+ @EventConfig(listeners = UIAddApplicationForm.CancelActionListener.class, phase = Event.Phase.DECODE)})
+public class UIWsrpConsumerEditor extends UIApplicationForm
+{
+ protected static final String CONSUMER_NAME = "Consumer Name:";
+
+ public UIWsrpConsumerEditor() throws Exception
+ {
+ addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME, null).addValidator(MandatoryValidator.class));
+ }
+
+ private String getConsumerName(){
+ return getUIStringInput(CONSUMER_NAME).getValue();
+ }
+
+ static public class SaveActionListener extends EventListener<UIWsrpConsumerEditor>
+ {
+ public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
+ {
+ UIWsrpConsumerEditor consumerEditor = event.getSource();
+ WebuiRequestContext ctx = event.getRequestContext();
+ consumerEditor.save(ctx);
+ }
+ }
+
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+ System.out.println("----------getConsumerName: " + getConsumerName());
+ return true;
+ }
+
+}
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This 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; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+
+/** @author Wesley Hales */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpConsumerOverview.OpenPopupActionListener.class)
+ })
+public class UIWsrpConsumerOverview extends UIContainer
+{
+ public UIWsrpConsumerOverview() throws Exception
+ {
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+ UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class,null,null);
+ popup.setUIComponent(consumerForm);
+ popup.setRendered(false);
+ }
+
+ static public class OpenPopupActionListener extends EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ UIPopupWindow popup = consumerOverview.getChild(UIPopupWindow.class);
+ popup.setRendered(true);
+ popup.setShow(true);
+ }
+ }
+}
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This 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; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+
+/** @author Wesley Hales */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl"
+)
+
+public class UIWsrpPortlet extends UIPortletApplication
+{
+ public UIWsrpPortlet() throws Exception
+ {
+ addChild(UIWsrpConsole.class,null,null);
+ }
+
+
+
+
+}
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,30 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This 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; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<webui-configuration>
+ <application>
+ <ui-component-root>org.exoplatform.wsrp.webui.component.UIWsrpPortlet</ui-component-root>
+ <state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ <application-lifecycle-listeners>
+ <listener>org.exoplatform.portal.application.PortletStatisticLifecycle</listener>
+ </application-lifecycle-listeners>
+ </application>
+</webui-configuration>
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-09 03:05:21 UTC (rev 974)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-09 03:23:12 UTC (rev 975)
@@ -83,6 +83,15 @@
<skin-name>Default</skin-name>
<css-path>/skin/register/webui/component/DefaultStylesheet.css</css-path>
</portlet-skin>
+
+ <!-- WSRP Admin Portlet skins -->
+
+ <portlet-skin>
+ <application-name>exoadmin</application-name>
+ <portlet-name>WSRPAdminPortlet</portlet-name>
+ <skin-name>Default</skin-name>
+ <css-path>/skin/wsrp/webui/component/DefaultStylesheet.css</css-path>
+ </portlet-skin>
</gatein-resources>
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-12-09 03:05:21 UTC (rev 974)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-12-09 03:23:12 UTC (rev 975)
@@ -105,6 +105,32 @@
</portlet-info>
</portlet>
+ <portlet>
+ <description xml:lang="EN">WSRP Admin Portlet</description>
+ <portlet-name>WSRPAdminPortlet</portlet-name>
+ <display-name xml:lang="EN">WSRP Admin Portlet</display-name>
+ <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+
+ <init-param>
+ <name>webui.configuration</name>
+ <value>/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+
+ <resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
+ <portlet-info>
+ <title>Register Portlet</title>
+ <short-title>Register Portlet</short-title>
+ <keywords>Administration</keywords>
+ </portlet-info>
+ </portlet>
+
<portlet>
<description xml:lang="EN">Group Navigation Portlet</description>
<portlet-name>GroupNavigationPortlet</portlet-name>
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,4 @@
+<% uicomponent.renderChildren(); %>
+<div>
+ Console Text...
+</div>
\ No newline at end of file
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,48 @@
+<%
+ import org.exoplatform.wsrp.webui.component.UIWsrpConsumerOverview;
+
+
+ def rcontext = _ctx.getRequestContext();
+ rcontext.getJavascriptManager().importJavascript('eXo.webui.UIHorizontalTabs');
+%>
+
+<div class="UITabPane" id="$uicomponent.id">
+ <div class="UIHorizontalTabs">
+ <div class="TabsContainer">
+ <%
+ String url = uicomponent.url("SelectTab");
+ String selTabId = uicomponent.getSelectedTabId();
+
+ UIWsrpConsumerOverview consumerOverview = uicomponent.getChild(UIWsrpConsumerOverview.class);
+ %>
+ <div class="UITab GrayTabStyle">
+ <div class="<%= consumerOverview.getId().equals(selTabId) ? "SelectedTab" : "NormalTab" %>">
+ <div class="LeftTab">
+ <div class="RightTab">
+ <% String appLink = "ajaxAsyncGetRequest('" + uicomponent.url("SelectTab",consumerOverview.getId()) + "', true)" %>
+ <div class="MiddleTab" onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this, '${consumerOverview.getId()}', '$url');$appLink;if(eXo.portal.portalMode) eXo.portal.portalMode -= 2;">
+ <%=_ctx.appRes("UITabPane.title." + consumerOverview.getId());%>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="UITab GrayTabStyle">
+ <div class="NormalTab">
+ <div class="LeftTab">
+ <div class="RightTab">
+
+ <div class="MiddleTab" onclick="">
+ Manage Producers
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="UITabContentContainer GrayTabContainer">
+ <div class="UITabContent" style="display: <%=consumerOverview.getId().equals(selTabId) ? "block": "none"%>;overflow:auto;clear:both"><% uicomponent.renderUIComponent(consumerOverview); %></div>
+ <div class="UITabContent" style="display:none;overflow:auto;clear:both">Producer content</div>
+ </div>
+</div>
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,44 @@
+<%
+
+ import org.exoplatform.webui.form.UIFormStringInput;
+
+%>
+
+<div class="UILoginForm" id="ChildTest">
+
+ <%uiform.begin()%>
+
+ <%
+ UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
+ %>
+ <div class="SignIn">Add new Consumer</div>
+ <div class="FloatRight">
+ <div class="FloatLeft">
+ <div class="UserName" >
+ <label>Consumer Name</label>
+ <% uiform.renderField(name); %>
+ </div>
+
+ </div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ <div class="ClearRight"><span></span></div>
+ <%uiform.end()%>
+</div>
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,6 @@
+<% uicomponent.renderChildren(); %>
+<div class="<%=uicomponent.getId()%>">
+
+ <a href="<%=uicomponent.event("OpenPopup", "")%>">Add Consumer</a>
+
+</div>
\ No newline at end of file
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,3 @@
+<div class="<%=uicomponent.getId()%>">
+ this is a popup?
+</div>
\ No newline at end of file
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,4 @@
+<% uicomponent.renderChildren(); %>
+<div class="<%=uicomponent.getId()%>">
+
+</div>
\ No newline at end of file
Added: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-09 03:23:12 UTC (rev 975)
@@ -0,0 +1,23 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This 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; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+.UIWsrpPortlet {
+ padding: 30px 0;
+ border:2px dotted brown;
+}
\ No newline at end of file
Modified: portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-09 03:05:21 UTC (rev 974)
+++ portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-09 03:23:12 UTC (rev 975)
@@ -58,7 +58,7 @@
<portlet-skin>
<application-name>web</application-name>
- <portlet-name>PortalNavigationPortlet</portlet-name>
+ <portlet-name>PortalNavigationPortlet2</portlet-name>
<skin-name>Default</skin-name>
<css-path>/skin/portal/webui/component/UIPortalNavigationPortlet/DefaultStylesheet.css</css-path>
</portlet-skin>
Modified: portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-09 03:05:21 UTC (rev 974)
+++ portal/branches/wsrp-integration/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-09 03:23:12 UTC (rev 975)
@@ -197,7 +197,7 @@
<portlet>
<description xml:lang="EN">Portal Navigation Portlet</description>
- <portlet-name>PortalNavigationPortlet</portlet-name>
+ <portlet-name>PortalNavigationPortlet2</portlet-name>
<display-name xml:lang="EN">Portal Navigation Portlet</display-name>
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
15 years
gatein SVN: r974 - in portal/trunk: component/resources/src/test/java/conf/portal and 1 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-08 22:05:21 -0500 (Tue, 08 Dec 2009)
New Revision: 974
Modified:
portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
Log:
GTNPORTAL-363 Remove RegistryService usage
Modified: portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-08 10:40:09 UTC (rev 973)
+++ portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-09 03:05:21 UTC (rev 974)
@@ -23,18 +23,8 @@
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="system"/>
- </properties-param>
- </init-params>
- </component>
-
<component>
<key>org.exoplatform.application.registry.ApplicationRegistryService</key>
<type>org.exoplatform.application.registry.impl.ApplicationRegistryServiceImpl</type>
Modified: portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml
===================================================================
--- portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2009-12-08 10:40:09 UTC (rev 973)
+++ portal/trunk/component/resources/src/test/java/conf/portal/test-configuration.xml 2009-12-09 03:05:21 UTC (rev 974)
@@ -42,19 +42,9 @@
</object>
</object-param>
</init-params>
- </component>
+ </component>
<component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="system"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
<key>org.exoplatform.services.resources.LocaleConfigService</key>
<type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
<init-params>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-08 10:40:09 UTC (rev 973)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-09 03:05:21 UTC (rev 974)
@@ -46,16 +46,6 @@
<component>
<key>org.exoplatform.services.jcr.RepositoryService</key>
<type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
</component>
<component>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-08 10:40:09 UTC (rev 973)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-09 03:05:21 UTC (rev 974)
@@ -47,16 +47,6 @@
<key>org.exoplatform.services.jcr.RepositoryService</key>
<type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
</component>
-
- <component>
- <type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
- <init-params>
- <properties-param>
- <name>locations</name>
- <property name="repository" value="portal-system"/>
- </properties-param>
- </init-params>
- </component>
<component>
<key>org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator</key>
15 years
gatein SVN: r973 - portal/trunk/docs/reference-guide/en/modules/development.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-08 05:40:09 -0500 (Tue, 08 Dec 2009)
New Revision: 973
Modified:
portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml
portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml
portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml
portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml
Log:
Format doc
Modified: portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml 2009-12-08 09:06:53 UTC (rev 972)
+++ portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml 2009-12-08 10:40:09 UTC (rev 973)
@@ -2,61 +2,40 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Accessing_User_Profile">
- <!--
+ <title>Accessing User Profile</title>
+ <para>
+ To retrieve the logged in user you can do as follows :
+ </para>
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Accessing User Profile</title>
- <para>
- To retrieve the logged in user you can do as follows :
+ <programlisting role="JAVA"><![CDATA[// Alternative context: WebuiRequestContext context = WebuiRequestContext.getCurrentInstance() ;
+PortalRequestContext context = PortalRequestContext.getCurrentInstance() ;
+// Get the id of the user logged
+String userId = context.getRemoteUser();
+// Request the information from OrganizationService:
+OrganizationService orgService = getApplicationComponent(OrganizationService.class) ;
+if (userId != null)
+ {
+ User user = orgService.getUserHandler().findUserByName(userId) ;
+ if (user != null)
+ {
+ String firstName = user.getFirstName();
+ String lastName = user.getLastName();
+ String email = user.getEmail();
+ }
+}]]></programlisting>
+ <para>
+ Alternatives for retrieving the Organization Service
</para>
-
-<programlisting>// Alternative context: WebuiRequestContext context =
- WebuiRequestContext.getCurrentInstance() ;
- PortalRequestContext context = PortalRequestContext.getCurrentInstance() ;
- // Get the id of the user logged
- String userId = context.getRemoteUser();
- // Request the information from OrganizationService:
- OrganizationService orgService = getApplicationComponent(OrganizationService.class) ;
- if(userId!images/= null) {
- User user = orgService.getUserHandler().findUserByName(userId) ;
- if (user!images/= null) {
- String firstName = user.getFirstName();
- String lastName = user.getLastName();
- String email = user.getEmail();
- }
- }
-</programlisting>
- <para>
- Alternatives for retrieving the Organization Service
- </para>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- OrganizationService service = (OrganizationService) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(OrganizationService.class);
- </para>
- </listitem>
- <listitem>
- <para>
- OrganizationService service = (OrganizationService) PortalContainer.getInstance().getComponentInstanceOfType(OrganizationService.class);
- </para>
- </listitem>
- </orderedlist>
+ <orderedlist>
+ <listitem>
+ <programlisting role="JAVA"><![CDATA[OrganizationService service = (OrganizationService)
+ ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(OrganizationService.class);]]></programlisting>
+ </listitem>
+ <listitem>
+ <programlisting role="JAVA"><![CDATA[OrganizationService service = (OrganizationService)
+ PortalContainer.getInstance().getComponentInstanceOfType(OrganizationService.class);]]></programlisting>
+ </listitem>
+ </orderedlist>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml 2009-12-08 09:06:53 UTC (rev 972)
+++ portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml 2009-12-08 10:40:09 UTC (rev 973)
@@ -1,125 +1,124 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
-<section id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Deactivation of the Ajax Loading Mask Layer</title>
- <section id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Overview">
- <title>Overview</title>
- <para>
- In this article, you will learn:
+<section
+ id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer">
+ <title>Deactivation of the Ajax Loading Mask Layer
+ </title>
+ <section
+ id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn:
</para>
- <itemizedlist>
- <listitem>
- <para>
- Purpose of ajax-loading mask.
+ <itemizedlist>
+ <listitem>
+ <para>
+ Purpose of ajax-loading mask.
</para>
- </listitem>
- <listitem>
- <para>
- How to deactivate ajax-loading mask.
+ </listitem>
+ <listitem>
+ <para>
+ How to deactivate ajax-loading mask.
</para>
- </listitem>
- <listitem>
- <para>
- Synchronous / Asynchronous issue.
+ </listitem>
+ <listitem>
+ <para>
+ Synchronous / Asynchronous issue.
</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Purpose_of_requirement">
- <title>Purpose of requirement</title>
- <itemizedlist>
- <listitem>
- <para>
- Loading mask layer is displayed after ajax-call for blocking GUI to prevent user's action until the the ajax-request is completed.
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Purpose_of_requirement">
+ <title>Purpose of requirement</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Loading mask layer is displayed after ajax-call for
+ blocking GUI to
+ prevent user's action until the the
+ ajax-request is
+ completed.
</para>
- </listitem>
- <listitem>
- <para>
- Sometimes portal needs to be ready for user instructions without waiting previous instructions completed. So mask layer may need to be deactivated.
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-How_to_deactivate_ajax_loading_mask_in_your_code">
- <title>How to deactivate ajax-loading mask in your code</title>
- <para>
- To generate script to make an asynchronous ajax-call, we use uicomponent.doAsync() method instead of uicomponent.event() method.
+ </listitem>
+ <listitem>
+ <para>
+ Sometimes portal needs to be ready for user
+ instructions without waiting
+ previous instructions
+ completed. So mask layer may need
+ to be deactivated.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-How_to_deactivate_ajax_loading_mask_in_your_code">
+ <title>How to deactivate ajax-loading mask in your code</title>
+ <para>
+ To generate script to make an asynchronous ajax-call, we use
+ uicomponent.doAsync() method instead of uicomponent.event()
+ method.
</para>
- <para>
- Here is an example:
+ <para>
+ Here is an example:
</para>
- <para>
- <a href="<%=uicomponent.doAsync(action, beanId, params)%>" alt="">Asynchronous</a>
+ <programlisting><![CDATA[<a href="<%=uicomponent.doAsync(action, beanId, params)%>" alt="">Asynchronous</a>]]></programlisting>
+ <para>
+ Method doAsync() automatically adds a parameter into parameters
+ list. Parameter async
+ <emphasis>param = new Parameter(AJAX</emphasis>
+ ASYNC,"true"); (AJAX
+ <emphasis>ASYNC == "ajax</emphasis>
+ async")
+ </para>
+ <para>
+ After all, its call method event() to generate script that make Ajax
+ Request. This request is asynchronous and ajax-loading mask
+ will not displayed.
</para>
- <para>
- Method doAsync() automatically adds a parameter into parameters list. Parameter async<emphasis>param = new Parameter(AJAX</emphasis>ASYNC,"true"); (AJAX<emphasis>ASYNC == "ajax</emphasis>async")
+ <note>
+ <orderedlist><listitem><para>
+ You still also make an asynchronous request by using method
+ uicomponent.event(). Using this way, you must add asyncparam
+ manually.</para></listitem>
+ <listitem><para>
+ GUI is blocked so that user can do only one action at a time
+ (Request seems to be synchronous). But in fact ajax request
+ always be asynchronous. See Synchronous issue section.
+ </para></listitem>
+ </orderedlist>
+ </note>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Synchronous_issue">
+ <title>Synchronous issue</title>
+ <para>
+ Almost web browser such as (IE, Chrome, Safari .. ) support ajax requests
+ in two modes: Synchronous / Asynchronous with boolean
+ value of bAsyn parameter.
</para>
- <para>
- After all, its call method event() to generate script that make Ajax Request. This request is asynchronous and ajax-loading mask will not displayed.
+ <programlisting>var bAsync = false; // Synchronous
+request.open(instance.method, instance.url, bAsync);</programlisting>
+ <para>
+ But in Mozilla Firefox versions prior to 3.5 it wouldn't support synchronous request.
+ </para>
+ <programlisting>var bAsync = false; // Synchronous
+request.open(instance.method, instance.url, bAsync); // Firefox will not execute</programlisting>
+ <para>
+ So bAsync is set to always be true (Ajax request to always be asynchronous).
+ </para>
+ <programlisting>// Asynchronous request
+request.open(instance.method, instance.url, true);
+</programlisting>
+ <para>
+ As a consequence that Ajax Request will always be asynchronous.
</para>
- <para>
- Note:
- </para>
- <para>
- 1. You still also make an asynchronous request by using method uicomponent.event(). By this way, you must add asyncparam manually.
- </para>
- <para>
- 2. GUI is blocked so that user can do only one action at a time (Request seems to be synchronous). But in fact ajax request always be asynchronous. See Synchronous issue section.
- </para>
- </section>
-
- <section id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Synchronous_issue">
- <title>Synchronous issue</title>
- <para>
- Almost web browser such as (IE, Chrome, Safari .. ) told that ajax request may used in two modes: Synchronous / Asynchronous with boolean value of bAsyn parameter. View reference.
- </para>
- <para>
- var bAsync = false; // Synchronous
- </para>
- <para>
- request.open(instance.method, instance.url, bAsync);
- </para>
- <para>
- But Mozilla say no. They doesn't support synchronous request. var bAsync = false; // Synchronous
- </para>
- <para>
- request.open(instance.method, instance.url, bAsync); // Firefox will not execute
- </para>
- <para>
- So we decide to set bAsync always true (Ajax request always be asynchronous).
- </para>
- <para>
- // Asynchronous request
- </para>
- <para>
- request.open(instance.method, instance.url, true);
- </para>
- <para>
- It is cause that Ajax Request always be asynchronous.
- </para>
- </section>
+ </section>
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml 2009-12-08 09:06:53 UTC (rev 972)
+++ portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml 2009-12-08 10:40:09 UTC (rev 973)
@@ -1,157 +1,231 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
-<section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>JavaScript Inter Application Communication</title>
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Overview">
- <title>Overview</title>
- <para>
- This kind of communication is made to allow applications within a page to exchange data. This library is made for broadcasting messages on topic. This is basically based on 3 functions : subscribe, publish and unsubscribe.
+<section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication">
+ <title>JavaScript Inter Application Communication</title>
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Overview">
+ <title>Overview</title>
+ <para>
+ This kind of communication is made to allow applications within a page to
+ exchange data. This library is made for broadcasting messages
+ on topic. This is basically based on 3 functions : subscribe,
+ publish and unsubscribe.
</para>
- <para>
- When you subscribe to a topic, you receive all the subtopic message. for example, if I subscribe to "/GateIn/application", and an application send a message on "/GateIn/application/map", i will receive it, but if another application send a message on "/GateIn", i will not receive it.
+ <para>
+ When you subscribe to a topic, you receive all the subtopic message. for
+ example, if I subscribe to "/eXo/application", and an
+ application send a message on "/eXo/application/map", i will
+ receive it, but if another application send a message on
+ "/eXo", i will not receive it.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Common_topics">
- <title>Common topics</title>
- <para>
- Stuff Goes Here?
+ </section>
+<!--
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Common_topics">
+ <title>Common topics</title>
+ <para>
+ Stuff Goes Here?
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateIn">
- <title>/GateIn</title>
- <para>
- It contains all the events generated by the platform.
+ </section>
+ -->
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateIn">
+ <title>/eXo</title>
+ <para>
+ It contains all the events generated by the platform.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalnotification">
- <title>/GateIn/portal/notification</title>
- <para>
- When a message is sent on this topic, a popup message appears on the top right of the screen.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalnotification">
+ <title>/eXo/portal/notification
+ </title>
+ <para>
+ When a message is sent on this topic, a popup message appears on the top
+ right of the screen.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalchangeTitle_not_implemented_yet">
- <title>/GateIn/portal/changeTitle (not implemented yet)</title>
- <para>
- Send a message on this channel to change (and to be notified) the title of the portal.
+ </section>
+<!--
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalchangeTitle">
+ <title>/GateIn/portal/changeTitle (not
+ implemented yet)</title>
+ <para>
+ Send a message on this channel to change (and to be notified) the title
+ of the portal.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageLoaded_not_implemented_yet">
- <title>/GateIn/portal/pageLoaded (not implemented yet)</title>
- <para>
- Receive a message when a page is loaded.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageLoaded">
+ <title>/GateIn/portal/pageLoaded (not
+ implemented yet)</title>
+ <para>
+ Receive a message when a page is loaded.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageUnloaded_not_implemented_yet">
- <title>/GateIn/portal/pageUnloaded (not implemented yet)</title>
- <para>
- Receive a message when a page is unloaded.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageUnloaded">
+ <title>/eXo/portal/pageUnloaded (not
+ implemented yet)</title>
+ <para>
+ Receive a message when a page is unloaded.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationLoaded_not_implemented_yet">
- <title>/GateIn/application/applicationLoaded (not implemented yet)</title>
- <para>
- Receive a message when an application is loaded in the page.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationLoaded">
+ <title>/eXo/application/applicationLoaded
+ (not implemented yet)</title>
+ <para>
+ Receive a message when an application is loaded in the page.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationUnloaded_not_implemented_yet">
- <title>/GateIn/application/applicationUnloaded (not implemented yet)</title>
- <para>
- Receive a message when an application is unloaded in the page.
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationUnloaded">
+ <title>/eXo/application/applicationUnloaded
+ (not implemented yet)</title>
+ <para>
+ Receive a message when an application is unloaded in the page.
</para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Library">
- <title>Library</title>
- <para>
- The inter application communication http://fisheye.exoplatform.org/projects/browse/projects/portal/trunk/web/...
- </para>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Syntax">
- <title>Syntax</title>
-
-<programlisting>subscribe is used to subscribe a callback to a topic
-*Parameters:*
-* topic is the topic that will be listened
-* obj is the context object
-* funcName is the name of the function of obj to call when a message is received on the topic
-funcName have to be a function that take an Object in parameter. the event received have this format:
-{code:javascript}
-{
+ </section>
+ -->
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Library">
+ <title>Library</title>
+ <para>
+ The inter application communication library can be found in
+ <filename>01eXoResources.war:/javascript/eXo/core/Topic.js</filename>
+ </para>
+ <programlisting><![CDATA[/**
+ * publish is used to publish an event to the other subscribers to the given channels
+ * @param {Object} senderId is a string that identify the sender
+ * @param {String} topic is the topic that the message will be published
+ * @param {Object} message is the message that's going to be delivered to the subscribers to the topic
+ */
+Topic.prototype.publish = function(/*Object*/ senderId, /*String*/ topicName, /*Object*/ message ) { ... }
+
+/**
+ * isSubscribed is used to check if a function receive the events from a topic
+ * @param {String} topic The topic.
+ * @param {Function} func is the name of the function of obj to call when a message is received on the topic
+ */
+Topic.prototype.isSubscribed = function(/*String*/ topic, /*Function*/ func) { ... }
+
+/**
+ * subscribe is used to subscribe a callback to a topic
+ * @param {String} topic is the topic that will be listened
+ * @param {Function} func is the name of the function of obj to call when a message is received on the topic
+ *
+ * func is a function that take a Object in parameter. the event received have this format:
+ * {senderId:senderId, message:message, topic: topic}
+ *
+ */
+Topic.prototype.subscribe = function(/*String*/ topic, /*Function*/ func) { ... }
+
+/**
+ * unsubscribe is used to unsubscribe a callback to a topic
+ * @param {String} topic is the topic
+ * @param {Object} id is the id of the listener we want to unsubscribe
+ */
+Topic.prototype.unsubscribe = function(/*String*/ topic, /*Object*/ id) { ... }
+
+Topic.prototype.initCometdBridge = function() { ... }]]></programlisting>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Syntax">
+ <title>Syntax</title>
+
+ <para><literal>subscribe</literal> is used to subscribe a callback to a topic.
+ Parameters:
+ <itemizedlist>
+ <listitem><para><literal>topic</literal> is the topic that will be listened</para></listitem>
+ <listitem><para><literal>func</literal> is the name of the function of obj to call when a message is received on the topic.
+ It has to be a function that take an Object in parameter. the event received have this format:
+ <programlisting>{
senderId:senderId,
message:message,
topic: topic
-}
-</programlisting>
-
-<programlisting>publish is used to publish an event to the other subscribers to the given channels
-*Parameters:*
-* senderId is a string that identify the sender
-* topic is the topic that the message will be published
-* message is the message that's going to be delivered to the subscribers to the topic
-</programlisting>
- <para>
- unsubscribe is used to unsubscribe a callback to a topic
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Parameters:
- </para>
- </listitem>
- <listitem>
- <para>
- topic is the topic that will be unsubscribe
- </para>
- </listitem>
- <listitem>
- <para>
- obj is the context object
- </para>
- </listitem>
- <listitem>
- <para>
- funcName function name givent at the previous subscribe
- </para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Example">
- <title>Example</title>
- <para>
- <ulink url="http://fisheye.exoplatform.org/projects/browse/projects/portal/trunk/samp...">Topic Demo</ulink>
- </para>
- </section>
+}</programlisting>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ <para><literal>publish</literal> is used to publish an event to the other subscribers to the given channels.
+ Parameters:
+ <itemizedlist>
+ <listitem><para><literal>senderId</literal> is a string that identify the sender</para></listitem>
+ <listitem><para><literal>topicName</literal> is the topic that the message will be published</para></listitem>
+ <listitem><para><literal>message</literal> is the message that's going to be delivered to the subscribers to the topic</para></listitem>
+ </itemizedlist>
+ </para>
+ <para><literal>unsubscribe</literal> is used to unsubscribe a callback to a topic
+ Parameters:
+ <itemizedlist>
+ <listitem><para><literal>topic</literal> is the topic that will be unsubscribe</para></listitem>
+ <listitem><para><literal>id</literal> is the context object</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section
+ id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Example">
+ <title>Example</title>
+ <programlisting role="HTML"><![CDATA[<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<portlet:defineObjects/>
+<div>
+ <p>
+ Received messages:
+ <div id="received_<portlet:namespace/>">
+
+ </div>
+ </p>
+
+ <p>
+ Send message:
+ <input type="text" id="msg_<portlet:namespace/>"/> <a href="#" onclick="send_<portlet:namespace/>();">send</a>
+ </p>
+</div>
+
+<script type="text/javascript">
+
+ Function.prototype.bind = function(object) {
+ var method = this;
+ return function() {
+ method.apply(object, arguments);
+ }
+ }
+
+ function send_<portlet:namespace/>() {
+ var msg = document.getElementById("msg_<portlet:namespace/>").value;
+ eXo.core.Topic.publish("<portlet:namespace/>", "/demo", msg);
+ }
+
+ function Listener_<portlet:namespace/>(){
+
+ }
+
+ Listener_<portlet:namespace/>.prototype.receiveMsg = function(event) {
+ document.getElementById("received_<portlet:namespace/>").innerHTML =
+ document.getElementById("received_<portlet:namespace/>").innerHTML + "<br />* " +
+ event.senderId + ": " + event.message;
+ }
+
+ function init_<portlet:namespace/>() {
+ var listener_<portlet:namespace/> = new Listener_<portlet:namespace/>();
+ eXo.core.Topic.subscribe("/demo", listener_<portlet:namespace/>.receiveMsg.bind(listener_<portlet:namespace/>));
+ }
+
+ init_<portlet:namespace/>();
+</script>]]></programlisting>
+ </section>
+
</section>
Modified: portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml 2009-12-08 09:06:53 UTC (rev 972)
+++ portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml 2009-12-08 10:40:09 UTC (rev 973)
@@ -2,149 +2,142 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Upload_Component">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This 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; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Upload Component</title>
- <section id="sect-Reference_Guide-Upload_Component-Overview">
- <title>Overview</title>
- <para>
- In this article, you will learn how to :
+ <title>Upload Component</title>
+ <section id="sect-Reference_Guide-Upload_Component-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn how to :
</para>
- <itemizedlist>
- <listitem>
- <para>
- configure the Upload service
+ <itemizedlist>
+ <listitem>
+ <para>
+ configure the Upload service
</para>
- </listitem>
- <listitem>
- <para>
- add a default upload size limit
+ </listitem>
+ <listitem>
+ <para>
+ add a default upload size limit
</para>
- </listitem>
- <listitem>
- <para>
- use the Upload component in your application, with a specific upload size limit
+ </listitem>
+ <listitem>
+ <para>
+ use the Upload component in your application, with a specific upload
+ size limit
</para>
- </listitem>
- <listitem>
- <para>
- clean the service when the upload finishes
+ </listitem>
+ <listitem>
+ <para>
+ clean the service when the upload finishes
</para>
- </listitem>
- </itemizedlist>
- <para>
- The size limit feature is available since Portal 2.5.3
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Upload_Component-Upload_Service">
+ <title>Upload Service</title>
+ <para>
+ The service is defined by the class :
+ org.exoplatform.upload.UploadService;
</para>
- </section>
-
- <section id="sect-Reference_Guide-Upload_Component-Upload_Service">
- <title>Upload Service</title>
- <para>
- The service is defined by the class : org.exoplatform.upload.UploadService;
+ <para>
+ You can configure it with the following xml code :
</para>
- <para>
- You can configure it with the following xml code :
- </para>
-
-<programlisting><component>
- <type>org.exoplatform.upload.UploadService</type>
- <init-params>
- <value-param>
- <name>upload.limit.size</name>
- <description>Maximum size of the file to upload in MB</description>
- <value>10</value>
- </value-param>
- </init-params>
- </component>
+
+ <programlisting role="XML"><![CDATA[<component>
+ <type>org.exoplatform.upload.UploadService</type>
+ <init-params>
+ <value-param>
+ <name>upload.limit.size</name>
+ <description>Maximum size of the file to upload in MB</description>
+ <value>10</value>
+ </value-param>
+ </init-params>
+ </component>]]>
</programlisting>
- <para>
- As you can see, you can configure a default upload size limit for the service. The value unit is in MegaBytes. This limit will be used by default by all applications if no specific limit is set. You will see in the next chapter how to set a different limit for your application.
+ <para>
+ As you can see, you can configure a default upload size limit for the
+ service. The value unit is in MegaBytes. This limit will be
+ used by default by all applications if no specific limit is
+ set. You will see in the next chapter how to set a different
+ limit for your application.
</para>
- <para>
- If you set the value at 0, the upload size will be unlimited.
+ <para>
+ If you set the value at 0, the upload size will be unlimited.
</para>
- </section>
-
- <section id="sect-Reference_Guide-Upload_Component-How_to_use_the_upload_component_in_your_application">
- <title>How to use the upload component in your application</title>
- <para>
- To use the component, you must create an object of type org.exoplatform.webui.form.UIFormUploadInput, using one of the two available constructors :
+ </section>
+
+ <section
+ id="sect-Reference_Guide-Upload_Component-How_to_use_the_upload_component_in_your_application">
+ <title>How to use the upload component in your application
+ </title>
+ <para>
+ To use the component, you must create an object of type
+ org.exoplatform.webui.form.UIFormUploadInput, using one of the
+ two available constructors :
</para>
-
-<programlisting>public UIFormUploadInput(String name, String bindingExpression)
-</programlisting>
- <para>
- or:
+ <programlisting>public UIFormUploadInput(String name, String bindingExpression)</programlisting>
+ <para>
+ or:
</para>
-
-<programlisting>public UIFormUploadInput(String name, String bindingExpression, int limit)
-</programlisting>
- <para>
- Here is an example using the second form : {code} PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance(); PortletPreferences portletPref = pcontext.getRequest().getPreferences(); int limitMB = Integer.parseInt(portletPref.getValue("uploadFileSizeLimitMB", "").trim()); UIFormUploadInput uiInput = new UIFormUploadInput("upload", "upload", limitMB) ;
+ <programlisting>public UIFormUploadInput(String name, String bindingExpression, int limit)</programlisting>
+ <para>
+ Here is an example using the second form :
+ </para>
+ <programlisting role="JAVA"><![CDATA[PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
+PortletPreferences portletPref = pcontext.getRequest().getPreferences();
+int limitMB = Integer.parseInt(portletPref.getValue("uploadFileSizeLimitMB", "").trim());
+UIFormUploadInput uiInput = new UIFormUploadInput("upload", "upload", limitMB);
+]]></programlisting>
+
+ <para>
+ To get the limit from the xml configuration, you can add this piece of code in the files portlet.xml or portlet-preferences.xml :
+ </para>
+ <programlisting role="XML"><![CDATA[<preference>
+ <name>uploadFileSizeLimitMB</name>
+ <value>30</value>
+ <read-only>false</read-only>
+</preference>]]></programlisting>
+ <para>
+ Again, a 0 value means unlimited upload size, and the value unit is set in
+ MegaBytes.
</para>
-
-<programlisting>
-To get the limit from the xml configuration, you can add this piece of code in the files portlet.xml or portlet-preferences.xml :
-{code:xml}
-<preference>
- <name>uploadFileSizeLimitMB</name>
- <value>30</value>
- <read-only>false</read-only>
-</preference>
-</programlisting>
- <para>
- Again, a 0 value means unlimited upload size, and the value unit is set in MegaBytes.
+ <para>
+ To get the uploaded data use the <literal>getUploadDataAsStream()</literal> method:
+ </para>
+ <programlisting role="JAVA"><![CDATA[UIFormUploadInput input = (UIFormUploadInput)uiForm.getUIInput("upload");
+InputStream inputStream = input.getUploadDataAsStream();
+...
+jcrData.setValue(inputStream);]]></programlisting>
+ <para>Clean the uploaded file</para>
+ <para>
+ The upload service stores a temporary file on the filesystem during the
+ process. When the upload is finished, you must clean the
+ service in order to :
</para>
- <para>
- To get the uploaded data use the ~~getUploadDataAsStream()~~ method: {code} UIFormUploadInput input = (UIFormUploadInput)uiForm.getUIInput("upload"); InputStream inputStream = input.getUploadDataAsStream(); ... jcrData.setValue(inputStream) ; {code}
- </para>
- <para>
- 1 Clean the uploaded file
- </para>
- <para>
- The upload service stores a temporary file on the filesystem during the process. When the upload is finished, you must clean the service in order to :
- </para>
- <itemizedlist>
- <listitem>
- <para>
- delete the temporary file
+ <itemizedlist>
+ <listitem>
+ <para>
+ delete the temporary file
</para>
- </listitem>
- <listitem>
- <para>
- delete the classes used for the upload
+ </listitem>
+ <listitem>
+ <para>
+ delete the classes used for the upload
</para>
- </listitem>
- </itemizedlist>
- <para>
- To do that, use the ~~removeUpload()~~ method defined in the upload service, like this :
+ </listitem>
+ </itemizedlist>
+ <para>
+ To do that, use the<literal>removeUpload()</literal> method defined in the upload
+ service, like this :
</para>
-
-<programlisting>UploadService uploadService = uiForm.getApplicationComponent(UploadService.class) ;
+
+ <programlisting role="JAVA"><![CDATA[UploadService uploadService = uiForm.getApplicationComponent(UploadService.class) ;
UIFormUploadInput uiChild = uiForm.getChild(UIFormUploadInput.class) ;
-uploadService.removeUpload(uiChild.getUploadId()) ;
-</programlisting>
- <para>
- Be sure to get and save the file in a JCR node <emphasis role="bold">before</emphasis> you clean the service
- </para>
- </section>
+uploadService.removeUpload(uiChild.getUploadId()) ;]]></programlisting>
+ <para>
+ Be sure to get and save the file <emphasis role="bold">before</emphasis> you clean the service
+ </para>
+ </section>
</section>
15 years