gatein SVN: r1161 - portal/trunk/docs/user-guide/en/modules/portal.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-01-05 08:34:59 -0500 (Tue, 05 Jan 2010)
New Revision: 1161
Modified:
portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml
Log:
edits to Manage Portal section
Modified: portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml 2010-01-05 12:45:55 UTC (rev 1160)
+++ portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml 2010-01-05 13:34:59 UTC (rev 1161)
@@ -52,13 +52,8 @@
<procedure>
<step>
<para>
- Type the search title related to the user that you want to search. You do not need to enter an exact title.
+ Select the parameter (name, email, etc) by which you would like to search from the drop-down menu.
</para>
- </step>
- <step>
- <para>
- Select the field in which you would like to search
- </para>
<mediaobject>
<imageobject>
<imagedata fileref="images/SearchUser.png" format="PNG" width="444" />
@@ -67,9 +62,14 @@
</step>
<step>
<para>
- Click the magnifying glass icon!images/SearchIcon.png! to perform searching. It will return a searching result in form.
+ Type the search terms for the user that you want to locate. You may not need to enter the complete title as the tool will present partial match search results.
</para>
</step>
+ <step>
+ <para>
+ Click the magnifying glass icon to begin the search.
+ </para>
+ </step>
</procedure>
</section>
@@ -77,8 +77,13 @@
<title>Edit a user</title>
<procedure>
<step>
+ <para>
+ Locate the user you wish to edit.
+ </para>
+ </step>
+ <step>
<para>
- Click the edit icon!images/EditIcon.png! corresponding to the user that you want to edit.
+ Click the edit icon (next to the trash icon) in the list entry of that user.
</para>
<mediaobject>
<imageobject>
@@ -90,49 +95,56 @@
<para>
Select the <emphasis role="bold">Account Info</emphasis> tab to view and change the essential user information.
</para>
- <itemizedlist>
- <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>User Name</term>
+ <listitem>
<para>
- The <emphasis role="bold">User Name</emphasis> field can not be changed, other fields <emphasis role="bold">First Name</emphasis> , <emphasis role="bold">Last Name</emphasis> , <emphasis role="bold">Email Address</emphasis> can be changed.
+ The <emphasis role="bold">User Name</emphasis> field cannot be changed. Other fields <emphasis role="bold">First Name</emphasis> , <emphasis role="bold">Last Name</emphasis> , <emphasis role="bold">Email Address</emphasis> can be changed.
</para>
- </listitem>
- <listitem>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Change Password</term>
+ <listitem>
<para>
- The <emphasis role="bold">Change Password</emphasis> option allows making a new password for this user when he/she forgets his/her password. When the <emphasis role="bold">Change Password</emphasis> option is unchecked, <emphasis role="bold">New Password</emphasis> and <emphasis role="bold">Confirm Password</emphasis> are hidden. Passwords must contain at least 6 characters (letters, numbers and punctuation marks).
+ The <emphasis role="bold">Change Password</emphasis> option allows an administrator to set a new password for a user. When the <emphasis role="bold">Change Password</emphasis> option is unchecked, <emphasis role="bold">New Password</emphasis> and <emphasis role="bold">Confirm Password</emphasis> are hidden. Passwords must contain at least 6 characters and can contain letters, numbers and punctuation marks.
</para>
- </listitem>
- </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</step>
<step>
<para>
- Select the <emphasis role="bold">User Profile</emphasis> tab to view and change profile information. The <emphasis role="bold">Language</emphasis> field is used to set the display language of that user.
+ Select the <emphasis role="bold">User Profile</emphasis> tab to view and change profile information. The <emphasis role="bold">Language</emphasis> field is used to set the display language for that user.
</para>
</step>
<step>
<para>
- Select the <emphasis role="bold">User Membership</emphasis> tab to see user's information in groups.
+ Select the <emphasis role="bold">User Membership</emphasis> tab to see a user's group membership information.
</para>
<mediaobject>
<imageobject>
<imagedata fileref="images/Demo3.png" format="PNG" width="444" />
</imageobject>
</mediaobject>
- <itemizedlist>
- <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>User Membership</term>
+ <listitem>
<para>
- The <emphasis role="bold">User Membership</emphasis> tab indicates to which group the selected user belongs. In the above figure, the user "demo" is a member of two groups: "guests" and "users". The parent group of both is "platform".
+ The <emphasis role="bold">User Membership</emphasis> tab indicates which group (or groups) the selected user belongs to. In the above figure, the user "demo" is a member of two groups: "guests" and "users". The parent group of both is "platform".
</para>
- </listitem>
- <listitem>
<para>
- To remove the user from a group, click the trash can icon!images/DeleteIcon.png! on the row you want.
+ To remove the user from a group, click the trash can icon on the row of the membership you want to revoke.
</para>
- </listitem>
- </itemizedlist>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</step>
<step>
<para>
- Click the <emphasis role="bold">Save</emphasis> button to accept changes.
+ Click the <emphasis role="bold">Save</emphasis> button to submit changes.
</para>
</step>
</procedure>
@@ -143,12 +155,15 @@
<procedure>
<step>
<para>
- In the <emphasis role="bold">User Management</emphasis> form: Click the trash can icon !images/DeleteIcon.png! corresponding to the user that you want to delete.
+ Locate the user you wish to delete in the <emphasis role="bold">User Management</emphasis> form.
+ </para>
+ <para>
+ Click the trash icon in the list entry corresponding to the user that you want to delete.
</para>
</step>
<step>
<para>
- Click the <emphasis role="bold">OK</emphasis> button in the confirmation message to confirm or the <emphasis role="bold">Cancel</emphasis> button to quit without deleting anything.
+ Click the <emphasis role="bold">OK</emphasis> button in the confirmation message to confirm or the <emphasis role="bold">Cancel</emphasis> button to quit without changing anything.
</para>
</step>
</procedure>
@@ -174,7 +189,7 @@
<procedure>
<step>
<para>
- Choose the path to create a new group by selecting the groups from list on the left pane or clicking the arrow icon !images/ArrowIcon.png! if you want to create a group in a higher level. The selected path is displayed in the path bar.
+ Choose the path to create a new group by selecting the groups from list on the left pane or clicking the arrow icon if you want to create a group in a higher level. The selected path is displayed in the path bar.
</para>
<mediaobject>
<imageobject>
@@ -191,50 +206,36 @@
<imagedata fileref="images/AddGroup.png" format="PNG" width="444" />
</imageobject>
</mediaobject>
- <informaltable colsep="0" frame="none" rowsep="0">
- <tgroup cols="2">
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <tbody>
- <row>
- <entry>
- <emphasis role="bold"> Name </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Description </emphasis>
- </entry>
- </row>
- <row>
- <entry>
- Group Name
- </entry>
- <entry>
- The name of the new group. This field is required and any length from 3 to 30 characters is allowed.
- </entry>
- </row>
- <row>
- <entry>
- Label
- </entry>
- <entry>
- The display name of the group. Any length from 3 to 30 characters is allowed.
- </entry>
- </row>
- <row>
- <entry>
- Description
- </entry>
- <entry>
- The description about the group. Any length from 3 to 30 characters is allowed.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ <variablelist>
+ <varlistentry>
+ <term>Group Name</term>
+ <listitem>
+ <para>
+ The name of the new group. This field is required and any length from 3 to 30 characters is allowed. Once saved this name cannot be edited.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Label</term>
+ <listitem>
+ <para>
+ The display name of the group. Any length from 3 to 30 characters is allowed.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Description</term>
+ <listitem>
+ <para>
+ a description of the group. Any length from 3 to 30 characters is allowed.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</step>
<step>
<para>
- Fill in the required fields. Only alpha, digit and underscore characters are allowed for the <emphasis role="bold">Group Name</emphasis> field and it must be unique.
+ Fill in the required fields. Only letters, numbers and underscore characters are allowed for the <emphasis role="bold">Group Name</emphasis> field. The name must be unique within the portal.
</para>
</step>
<step>
@@ -255,23 +256,28 @@
</step>
<step>
<para>
- Click the edit icon!images/EditIcon1.png! to show the <emphasis role="bold">Edit Group</emphasis> form of the selected group. This form is identical with the <emphasis role="bold">New Group</emphasis> form.
+ Click the edit icon to show the <emphasis role="bold">Edit Group</emphasis> form for the selected group. This form is identical to the <emphasis role="bold">New Group</emphasis> form.
</para>
</step>
<step>
<para>
- You can not change the Group Name. Make changes for a <emphasis role="bold">Label</emphasis> or a <emphasis role="bold">Description</emphasis> field and then click the <emphasis role="bold">Save</emphasis> button to accept changes or the <emphasis role="bold">Cancel</emphasis> button to cancel changes and return to the <emphasis role="bold">Group Info</emphasis> form.
+ Make the desired changes in the approapraite fields. You can not change the Group Name, however you may change to the <emphasis role="bold">Label</emphasis> field if you wish to refer to the group by a different name. You are also able to edit the <emphasis role="bold">Description</emphasis> field should it be appropriate.
</para>
</step>
+ <step>
+ <para>
+ Click the <emphasis role="bold">Save</emphasis> button to accept changes or the <emphasis role="bold">Cancel</emphasis> button to cancel changes and return to the <emphasis role="bold">Group Info</emphasis> form.
+ </para>
+ </step>
</procedure>
</section>
- <section id="sect-User_Guide-User_Management-Add_a_new_user_to_the_group">
- <title>Add a new user to the group</title>
+ <section id="sect-User_Guide-User_Management-Add_a_new_user_to_a_group">
+ <title>Add a new user to a group</title>
<procedure>
<step>
<para>
- Select the path to the group you want to edit by selecting the groups from the list on the left pane. The Group's information is displayed including the user list and a form which allows to add a new user.
+ Select the path to the group you want to edit by selecting the groups from the list on the left pane. The Group's information is displayed including the user list and a form which allows the addition of a new user.
</para>
<mediaobject>
<imageobject>
@@ -281,39 +287,21 @@
</step>
<step>
<para>
- Enter the exact user name of the user that you want to add to the selected group or you can enter some characters if you are not sure about the exact spelling.
+ Enter the username of the new user of the selected group.
</para>
- <itemizedlist>
- <listitem>
- <para>
- Click the magnifying glass icon!images/MagnifyIcon.png! to select users.
- </para>
- </listitem>
- <listitem>
- <para>
- After clicking the magnifying icon!images/MagnifyIcon.png! , there will be a list of all existing users :
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/SelectUser.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
- </listitem>
- <listitem>
- <para>
- Select the check box of the user (s) that you would like to add to the group.
- </para>
- </listitem>
- <listitem>
- <para>
- After clicking the <emphasis role="bold">Add</emphasis> button you will see the complete user name(s) in the <emphasis role="bold">Add member</emphasis> form.
- </para>
- </listitem>
- </itemizedlist>
+ <para>
+ If you are unsure of the exact username of the user you wish to add to the group, you can use the search function to locate them.
+ </para>
+ <para>
+ Refer to <xref linkend="sect-User_Guide-User_Management-Search_a_user" /> for instructions on how to locate a user.
+ </para>
+ <para>
+ After you have found the required username, click the <emphasis role="bold">Add</emphasis> button and the complete username will populate the <emphasis role="bold">Add member</emphasis> form.
+ </para>
</step>
<step>
<para>
- Select the membership for the user in a group from memberships list. The refresh icon!images/RefreshIcon.png! can be used to update the memberships list in case there are any changes.
+ Select the membership for the user in a group from memberships list. The refresh icon can be used to update the memberships list if there are any changes to incorporate.
</para>
</step>
<step>
@@ -329,7 +317,7 @@
<procedure>
<step>
<para>
- Click the edit icon!images/EditIcon.png! corresponding to a specific user with a membership in the <emphasis role="bold">Group Info</emphasis> table to open the <emphasis role="bold">Edit Membership</emphasis> form :
+ Click the edit icon corresponding to a specific user with a membership in the <emphasis role="bold">Group Info</emphasis> table to open the <emphasis role="bold">Edit Membership</emphasis> form :
</para>
<mediaobject>
<imageobject>
@@ -360,7 +348,7 @@
</step>
<step>
<para>
- Click the trash can !images/DeleteIcon.png! icon in order to delete.
+ Click the trash icon to delete the group.
</para>
</step>
<step>
@@ -374,8 +362,17 @@
<section id="sect-User_Guide-User_Management-Manage_memberships">
<title>Manage memberships</title>
<para>
- The roles of an user in the specific group are managed in <emphasis role="bold">Membership Management</emphasis> form. Currently there are three membership types: Manager, Member and Validator. By default, Manager has the highest rights in a group. You can add new, edit or delete a membership type. Select the <emphasis role="bold">Membership Management</emphasis> tab in the <emphasis role="bold">Organization</emphasis> portlet. There will be a membership type list and a form to add new/edit:
+ The roles of an user in the specific group are managed in the <emphasis role="bold">Membership Management</emphasis> form.
</para>
+ <para>
+ Currently there are three membership types: <emphasis>Manager</emphasis>, <emphasis>Member</emphasis> and <emphasis>Validator</emphasis>. By default, Manager has the highest rights in a group.
+ </para>
+ <para>
+ Administrators can add new, edit or delete a membership type. Select the <emphasis role="bold">Membership Management</emphasis> tab in the <emphasis role="bold">Organization</emphasis> portlet.
+ </para>
+ <para>
+ This will open a membership type list and a form to add new/edit:
+ </para>
<mediaobject>
<imageobject>
<imagedata fileref="images/MembershipManage1.png" format="PNG" width="444" />
@@ -388,7 +385,7 @@
<procedure>
<step>
<para>
- In the <emphasis role="bold">Add/Edit Membership</emphasis> form at the bottom, the input value for the membership name field (required) and the description field (optional). Only letters, digits, dots, dashes and underscores are allowed for the membership name.
+ In the <emphasis role="bold">Add/Edit Membership</emphasis> form, enter the values for the membership name field (required) and the description field (optional). Only letters, digits, dots, dashes and underscores are allowed for the membership name.
</para>
</step>
<step>
@@ -404,12 +401,12 @@
<procedure>
<step>
<para>
- Click the edit icon!images/EditIcon.png! in the row of the membership type you want to edit. The selected Membership type information is displayed in the Add/Edit Membership form.
+ Click the edit icon in the row of the membership type you want to edit. The selected Membership type information is displayed in the Add/Edit Membership form.
</para>
</step>
<step>
<para>
- Make changes in this form.
+ Make the desired changes in this form.
</para>
</step>
<step>
@@ -425,7 +422,7 @@
<procedure>
<step>
<para>
- Click the trash can icon in the row of the membership type that you want to delete.
+ Click the trash icon in the row of the membership type that you want to delete.
</para>
</step>
<step>
@@ -435,5 +432,4 @@
</step>
</procedure>
</section>
-
</section>
14 years, 11 months
gatein SVN: r1160 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-05 07:45:55 -0500 (Tue, 05 Jan 2010)
New Revision: 1160
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
Log:
- Properly save consumer's id.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2010-01-05 11:57:55 UTC (rev 1159)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2010-01-05 12:45:55 UTC (rev 1160)
@@ -110,6 +110,7 @@
public void initFrom(Consumer consumer)
{
setName(consumer.getName());
+ setId(consumer.getId());
setConsumerAgent(consumer.getConsumerAgent());
setStatus(consumer.getStatus());
14 years, 11 months
gatein SVN: r1159 - in portal/trunk/component: common/src/test/resources/conf and 9 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-05 06:57:55 -0500 (Tue, 05 Jan 2010)
New Revision: 1159
Added:
portal/trunk/component/common/src/test/resources/conf/chromattic-configuration.xml
portal/trunk/component/portal/src/test/java/conf/portal-configuration.xml
portal/trunk/component/wsrp/src/test/resources/conf/wsrp-configuration.xml
Removed:
portal/trunk/component/common/src/test/resources/conf/test-configuration.xml
portal/trunk/component/portal/src/test/java/conf/test-configuration.xml
portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
Modified:
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
portal/trunk/component/test/jcr/src/main/resources/conf/jcr/repository-configuration.xml
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
Log:
- update GateInTest to create a tmp dir per runtime execution (allow to avoid mvn clean install)
- change ../temp to ${basedir}/target in test idm configuration as it's putting data at wrong place
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2010-01-05 11:57:55 UTC (rev 1159)
@@ -35,7 +35,7 @@
*/
@ConfiguredBy({
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/jcr/jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/chromattic-configuration.xml")
})
public class ChromatticIntegrationTestCase extends AbstractGateInTest
{
Copied: portal/trunk/component/common/src/test/resources/conf/chromattic-configuration.xml (from rev 1154, portal/trunk/component/common/src/test/resources/conf/test-configuration.xml)
===================================================================
--- portal/trunk/component/common/src/test/resources/conf/chromattic-configuration.xml (rev 0)
+++ portal/trunk/component/common/src/test/resources/conf/chromattic-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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.commons.chromattic.ChromatticManager</key>
+ <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
+ </component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>test</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-test</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.exoplatform.commons.chromattic.FooEntity</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Deleted: portal/trunk/component/common/src/test/resources/conf/test-configuration.xml
===================================================================
--- portal/trunk/component/common/src/test/resources/conf/test-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/common/src/test/resources/conf/test-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<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.commons.chromattic.ChromatticManager</key>
- <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
- <component-plugin>
- <name>chromattic</name>
- <set-method>addLifeCycle</set-method>
- <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
- <init-params>
- <value-param>
- <name>domain-name</name>
- <value>test</value>
- </value-param>
- <value-param>
- <name>workspace-name</name>
- <value>portal-test</value>
- </value-param>
- <values-param>
- <name>entities</name>
- <value>org.exoplatform.commons.chromattic.FooEntity</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Modified: portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/identity/src/test/java/conf/portal/idm-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -59,7 +59,7 @@
<!--CHANGEME HashtableCacheProvider shold not be used in production env-->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<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.url" value="jdbc:hsqldb:file:${basedir}/target/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"/>
Copied: portal/trunk/component/portal/src/test/java/conf/portal-configuration.xml (from rev 1154, portal/trunk/component/portal/src/test/java/conf/test-configuration.xml)
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/portal-configuration.xml (rev 0)
+++ portal/trunk/component/portal/src/test/java/conf/portal-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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">
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <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>
+ <value-param>
+ <name>initializing.failure.ignore</name>
+ <description>In the run method, use try catch or not (value is true/false)</description>
+ <value>true</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>test</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>portal</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/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>platform/test/legacy</string>
+ </value>
+ <value>
+ <string>platform/test/normalized</string>
+ </value>
+ <value>
+ <string>organization/management/executive-board</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/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>
+ <value>
+ <string>overwritelayout</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>user</string>
+ </field>
+ <field name="templateLocation">
+ <string>classpath:/portal</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>page.templates</name>
+ <description>List of page templates</description>
+ <object type="org.exoplatform.portal.config.PageTemplateConfig">
+ <field name="templates">
+ <collection type="java.util.ArrayList"></collection>
+ </field>
+ <field name="location">
+ <string>classpath:/portal/template/pages</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
+ <description>this listener populate organization data for the first launch</description>
+ <init-params>
+ <value-param>
+ <name>checkDatabaseAlgorithm</name>
+ <description>check database</description>
+ <value>entry</value>
+ </value-param>
+ <value-param>
+ <name>printInformation</name>
+ <description>Print information init database</description>
+ <value>true</value>
+ </value-param>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.services.organization.OrganizationConfig">
+ <field name="membershipType">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
+ <field name="type"><string>manager</string></field>
+ <field name="description"><string>manager membership type</string></field>
+ </object>
+ </value>
+ <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>validator</string></field>
+ <field name="description"><string>validator membership type</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>platform</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /platform group</string></field>
+ <field name="label"><string>Platform</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>administrators</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/administrators group</string></field>
+ <field name="label"><string>Administrators</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>users</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/users group</string></field>
+ <field name="label"><string>Users</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>guests</string></field>
+ <field name="parentId"><string>/platform</string></field>
+ <field name="description"><string>the /platform/guests group</string></field>
+ <field name="label"><string>Guests</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>organization</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the organization group</string></field>
+ <field name="label"><string>Organization</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>management</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/management group</string></field>
+ <field name="label"><string>Management</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>executive-board</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/executive-board group</string></field>
+ <field name="label"><string>Executive Board</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>human-resources</string></field>
+ <field name="parentId"><string>/organization/management</string></field>
+ <field name="description"><string>the /organization/management/human-resource group</string></field>
+ <field name="label"><string>Human Resources</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>communication</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/communication group</string></field>
+ <field name="label"><string>Communication</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>marketing</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/marketing group</string></field>
+ <field name="label"><string>Marketing</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>press-and-media</string></field>
+ <field name="parentId"><string>/organization/communication</string></field>
+ <field name="description"><string>the /organization/communication/press-and-media group</string></field>
+ <field name="label"><string>Press and Media</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>operations</string></field>
+ <field name="parentId"><string>/organization</string></field>
+ <field name="description"><string>the /organization/operations and media group</string></field>
+ <field name="label"><string>Operations</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>sales</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/sales group</string></field>
+ <field name="label"><string>Sales</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>finances</string></field>
+ <field name="parentId"><string>/organization/operations</string></field>
+ <field name="description"><string>the /organization/operations/finances group</string></field>
+ <field name="label"><string>Finances</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>customers</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /customers group</string></field>
+ <field name="label"><string>Customers</string></field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field name="name"><string>partners</string></field>
+ <field name="parentId"><string></string></field>
+ <field name="description"><string>the /partners group</string></field>
+ <field name="label"><string>Partners</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+
+ <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>gtn</string></field>
+ <field name="firstName"><string>Root</string></field>
+ <field name="lastName"><string>Root</string></field>
+ <field name="email"><string>root@localhost</string></field>
+ <field name="groups">
+ <string>
+ manager:/platform/administrators,member:/platform/users,
+ member:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>john</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>John</string></field>
+ <field name="lastName"><string>Anthony</string></field>
+ <field name="email"><string>john@localhost</string></field>
+ <field name="groups">
+ <string>
+ member:/platform/administrators,member:/platform/users,
+ manager:/organization/management/executive-board
+ </string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>mary</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Mary</string></field>
+ <field name="lastName"><string>Kelly</string></field>
+ <field name="email"><string>mary@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>demo</string></field>
+ <field name="password"><string>gtn</string></field>
+ <field name="firstName"><string>Demo</string></field>
+ <field name="lastName"><string>gtn</string></field>
+ <field name="email"><string>demo@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests,member:/platform/users</string>
+ </field>
+ </object>
+ </value>
+
+ <value>
+ <object type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field name="userName"><string>overwritelayout</string></field>
+ <field name="password"><string>whatever</string></field>
+ <field name="firstName"><string>whatever</string></field>
+ <field name="lastName"><string>whatever</string></field>
+ <field name="email"><string>whatever@localhost</string></field>
+ <field name="groups">
+ <string>member:/platform/guests</string>
+ </field>
+ </object>
+ </value>
+
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+
+ </external-component-plugins>
+
+</configuration>
Deleted: portal/trunk/component/portal/src/test/java/conf/test-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/test-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/portal/src/test/java/conf/test-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -1,406 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<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">
-
- <external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
- <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>
- <value-param>
- <name>initializing.failure.ignore</name>
- <description>In the run method, use try catch or not (value is true/false)</description>
- <value>true</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>test</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>portal</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/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>platform/test/legacy</string>
- </value>
- <value>
- <string>platform/test/normalized</string>
- </value>
- <value>
- <string>organization/management/executive-board</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>group</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/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>
- <value>
- <string>overwritelayout</string>
- </value>
- </collection>
- </field>
- <field name="ownerType">
- <string>user</string>
- </field>
- <field name="templateLocation">
- <string>classpath:/portal</string>
- </field>
- </object>
- </object-param>
- <object-param>
- <name>page.templates</name>
- <description>List of page templates</description>
- <object type="org.exoplatform.portal.config.PageTemplateConfig">
- <field name="templates">
- <collection type="java.util.ArrayList"></collection>
- </field>
- <field name="location">
- <string>classpath:/portal/template/pages</string>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.organization.OrganizationService</target-component>
- <component-plugin>
- <name>init.service.listener</name>
- <set-method>addListenerPlugin</set-method>
- <type>org.exoplatform.services.organization.OrganizationDatabaseInitializer</type>
- <description>this listener populate organization data for the first launch</description>
- <init-params>
- <value-param>
- <name>checkDatabaseAlgorithm</name>
- <description>check database</description>
- <value>entry</value>
- </value-param>
- <value-param>
- <name>printInformation</name>
- <description>Print information init database</description>
- <value>true</value>
- </value-param>
- <object-param>
- <name>configuration</name>
- <description>description</description>
- <object type="org.exoplatform.services.organization.OrganizationConfig">
- <field name="membershipType">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
- <field name="type"><string>manager</string></field>
- <field name="description"><string>manager membership type</string></field>
- </object>
- </value>
- <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>validator</string></field>
- <field name="description"><string>validator membership type</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <field name="group">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>platform</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /platform group</string></field>
- <field name="label"><string>Platform</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>administrators</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/administrators group</string></field>
- <field name="label"><string>Administrators</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>users</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/users group</string></field>
- <field name="label"><string>Users</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>guests</string></field>
- <field name="parentId"><string>/platform</string></field>
- <field name="description"><string>the /platform/guests group</string></field>
- <field name="label"><string>Guests</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>organization</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the organization group</string></field>
- <field name="label"><string>Organization</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>management</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/management group</string></field>
- <field name="label"><string>Management</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>executive-board</string></field>
- <field name="parentId"><string>/organization/management</string></field>
- <field name="description"><string>the /organization/management/executive-board group</string></field>
- <field name="label"><string>Executive Board</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>human-resources</string></field>
- <field name="parentId"><string>/organization/management</string></field>
- <field name="description"><string>the /organization/management/human-resource group</string></field>
- <field name="label"><string>Human Resources</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>communication</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/communication group</string></field>
- <field name="label"><string>Communication</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>marketing</string></field>
- <field name="parentId"><string>/organization/communication</string></field>
- <field name="description"><string>the /organization/communication/marketing group</string></field>
- <field name="label"><string>Marketing</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>press-and-media</string></field>
- <field name="parentId"><string>/organization/communication</string></field>
- <field name="description"><string>the /organization/communication/press-and-media group</string></field>
- <field name="label"><string>Press and Media</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>operations</string></field>
- <field name="parentId"><string>/organization</string></field>
- <field name="description"><string>the /organization/operations and media group</string></field>
- <field name="label"><string>Operations</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>sales</string></field>
- <field name="parentId"><string>/organization/operations</string></field>
- <field name="description"><string>the /organization/operations/sales group</string></field>
- <field name="label"><string>Sales</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>finances</string></field>
- <field name="parentId"><string>/organization/operations</string></field>
- <field name="description"><string>the /organization/operations/finances group</string></field>
- <field name="label"><string>Finances</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>customers</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /customers group</string></field>
- <field name="label"><string>Customers</string></field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$Group">
- <field name="name"><string>partners</string></field>
- <field name="parentId"><string></string></field>
- <field name="description"><string>the /partners group</string></field>
- <field name="label"><string>Partners</string></field>
- </object>
- </value>
- </collection>
- </field>
-
- <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>gtn</string></field>
- <field name="firstName"><string>Root</string></field>
- <field name="lastName"><string>Root</string></field>
- <field name="email"><string>root@localhost</string></field>
- <field name="groups">
- <string>
- manager:/platform/administrators,member:/platform/users,
- member:/organization/management/executive-board
- </string>
- </field>
- </object>
- </value>
-
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>john</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>John</string></field>
- <field name="lastName"><string>Anthony</string></field>
- <field name="email"><string>john@localhost</string></field>
- <field name="groups">
- <string>
- member:/platform/administrators,member:/platform/users,
- manager:/organization/management/executive-board
- </string>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>mary</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Mary</string></field>
- <field name="lastName"><string>Kelly</string></field>
- <field name="email"><string>mary@localhost</string></field>
- <field name="groups">
- <string>member:/platform/users</string>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>demo</string></field>
- <field name="password"><string>gtn</string></field>
- <field name="firstName"><string>Demo</string></field>
- <field name="lastName"><string>gtn</string></field>
- <field name="email"><string>demo@localhost</string></field>
- <field name="groups">
- <string>member:/platform/guests,member:/platform/users</string>
- </field>
- </object>
- </value>
-
- <value>
- <object type="org.exoplatform.services.organization.OrganizationConfig$User">
- <field name="userName"><string>overwritelayout</string></field>
- <field name="password"><string>whatever</string></field>
- <field name="firstName"><string>whatever</string></field>
- <field name="lastName"><string>whatever</string></field>
- <field name="email"><string>whatever@localhost</string></field>
- <field name="groups">
- <string>member:/platform/guests</string>
- </field>
- </object>
- </value>
-
- </collection>
- </field>
- </object>
- </object-param>
- </init-params>
- </component-plugin>
-
- </external-component-plugins>
-
-</configuration>
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2010-01-05 11:57:55 UTC (rev 1159)
@@ -33,7 +33,7 @@
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/jcr/jcr-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/organization/organization-configuration.xml"),
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/portal/portal-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/portal-configuration.xml")
})
public abstract class AbstractPortalTest extends AbstractGateInTest
{
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2010-01-05 11:57:55 UTC (rev 1159)
@@ -18,12 +18,17 @@
*/
package org.exoplatform.component.test;
+import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.RequestLifeCycle;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
/**
@@ -36,6 +41,9 @@
public abstract class AbstractGateInTest extends TestCase
{
+ /** The system property for gatein tmp dir. */
+ private static final String TMP_DIR = "gatein.tmp.dir";
+
/** . */
private PortalContainer container;
@@ -92,6 +100,60 @@
}
}
+ // Take care of creating tmp directory for unit test
+ if (System.getProperty(TMP_DIR) == null)
+ {
+ // Get base dir set by maven or die
+ File targetDir = new File(new File(System.getProperty("basedir")), "target");
+ if (!targetDir.exists())
+ {
+ throw new AssertionFailedError("Target dir for unit test does not exist");
+ }
+ if (!targetDir.isDirectory())
+ {
+ throw new AssertionFailedError("Target dir is not a directory");
+ }
+ if (!targetDir.canWrite())
+ {
+ throw new AssertionFailedError("Target dir is not writable");
+ }
+
+ //
+ Set<String> fileNames = new HashSet<String>();
+ for (File child : targetDir.listFiles(new FilenameFilter()
+ {
+ public boolean accept(File dir, String name)
+ {
+ return name.startsWith("gateintest-");
+ }
+ }))
+ {
+ fileNames.add(child.getName());
+ }
+
+ //
+ String fileName;
+ int count = 0;
+ while (true)
+ {
+ fileName = "gateintest-" + count;
+ if (!fileNames.contains(fileName)) {
+ break;
+ }
+ count++;
+ }
+
+ //
+ File tmp = new File(targetDir, fileName);
+ if (!tmp.mkdirs())
+ {
+ throw new AssertionFailedError("Could not create directory " + tmp.getCanonicalPath());
+ }
+
+ //
+ System.setProperty(TMP_DIR, tmp.getCanonicalPath());
+ }
+
//
// List<Throwable> failures = new ArrayList<Throwable>();
Modified: portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml
===================================================================
--- portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/test/core/src/main/resources/conf/portal-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -58,7 +58,7 @@
<name>ref-addresses</name>
<description>ref-addresses</description>
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:${basedir}/target/temp/hsqldb"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.tmp.dir}/hsqldb"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</properties-param>
Modified: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2010-01-05 11:57:55 UTC (rev 1159)
@@ -24,6 +24,7 @@
import javax.naming.InitialContext;
import javax.sql.DataSource;
+import java.io.File;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -36,6 +37,9 @@
public class BootstrapTestCase extends AbstractGateInTest
{
+ /** . */
+ private String previousTmpDirPath = null;
+
public void testRequestLifeCycle()
{
PortalContainer container = PortalContainer.getInstance();
@@ -55,4 +59,37 @@
DataSource ds = (DataSource)new InitialContext().lookup("jdbcexo");
assertNotNull(ds);
}
+
+ public void testTmpDir1() throws Exception
+ {
+ ensureTmpDir();
+ }
+
+ public void testTmpDir2() throws Exception
+ {
+ ensureTmpDir();
+ }
+
+ private void ensureTmpDir() throws Exception
+ {
+ String tmpDirPath = System.getProperty("gatein.tmp.dir");
+ assertNotNull(tmpDirPath);
+
+ //
+ if (previousTmpDirPath != null)
+ {
+ assertEquals(previousTmpDirPath, tmpDirPath);
+ }
+ else
+ {
+ previousTmpDirPath = tmpDirPath;
+ }
+
+ //
+ File f = new File(tmpDirPath);
+ assertTrue(f.exists());
+ assertTrue(f.isDirectory());
+ assertTrue(f.canWrite());
+ assertEquals(0, f.list().length);
+ }
}
Modified: portal/trunk/component/test/jcr/src/main/resources/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/component/test/jcr/src/main/resources/conf/jcr/repository-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/test/jcr/src/main/resources/conf/jcr/repository-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -34,12 +34,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="${basedir}/target/temp/jcr/swap/system"/>
+ <property name="swap-directory" value="${gatein.tmp.dir}/jcr/swap/system"/>
</properties>
<value-storages>
<value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="${basedir}/target/temp/jcr/values/system"/>
+ <property name="path" value="${gatein.tmp.dir}/jcr/values/system"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -61,14 +61,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="${basedir}/target/temp/jcr/jcrlucenedb/system"/>
+ <property name="index-dir" value="${gatein.tmp.dir}/jcr/jcrlucenedb/system"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="${basedir}/target/temp/jcr/lock/system"/>
+ <property name="path" value="${gatein.tmp.dir}/jcr/lock/system"/>
</properties>
</persister>
</lock-manager>
@@ -83,12 +83,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="${basedir}/target/temp/jcr/swap/portal-test"/>
+ <property name="swap-directory" value="${gatein.tmp.dir}/jcr/swap/portal-test"/>
</properties>
<value-storages>
<value-storage id="portal-test" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="${basedir}/target/temp/jcr/values/portal-test"/>
+ <property name="path" value="${gatein.tmp.dir}/jcr/values/portal-test"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -110,14 +110,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="${basedir}/target/temp/jcr/jcrlucenedb/portal-test"/>
+ <property name="index-dir" value="${gatein.tmp.dir}/jcr/jcrlucenedb/portal-test"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="${basedir}/target/temp/jcr/lock/portal-test"/>
+ <property name="path" value="${gatein.tmp.dir}/jcr/lock/portal-test"/>
</properties>
</persister>
</lock-manager>
Modified: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2010-01-05 11:57:55 UTC (rev 1159)
@@ -45,7 +45,7 @@
*/
@ConfiguredBy({
@ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/jcr/jcr-configuration.xml"),
- @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/test-configuration.xml")
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path = "conf/wsrp-configuration.xml")
})
public class ConsumerRegistryTestCase extends AbstractGateInTest
{
Deleted: portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
===================================================================
--- portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
+++ portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<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.commons.chromattic.ChromatticManager</key>
- <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
- </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="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/consumers-configuration-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
- <external-component-plugins>
- <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
- <component-plugin>
- <name>chromattic</name>
- <set-method>addLifeCycle</set-method>
- <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
- <init-params>
- <value-param>
- <name>domain-name</name>
- <value>wsrp</value>
- </value-param>
- <value-param>
- <name>workspace-name</name>
- <value>portal-test</value>
- </value-param>
- <values-param>
- <name>entities</name>
- <value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
- <value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Copied: portal/trunk/component/wsrp/src/test/resources/conf/wsrp-configuration.xml (from rev 1154, portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml)
===================================================================
--- portal/trunk/component/wsrp/src/test/resources/conf/wsrp-configuration.xml (rev 0)
+++ portal/trunk/component/wsrp/src/test/resources/conf/wsrp-configuration.xml 2010-01-05 11:57:55 UTC (rev 1159)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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.commons.chromattic.ChromatticManager</key>
+ <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
+ </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="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/consumers-configuration-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>wsrp</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-test</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
14 years, 11 months
gatein SVN: r1158 - in portal/trunk: web/portal/src/main/webapp/WEB-INF/conf/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-05 06:46:42 -0500 (Tue, 05 Jan 2010)
New Revision: 1158
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- Commented out ChromatticManager configuration as it's not currently used.
- Properly size mappingClasses.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-01-05 07:48:08 UTC (rev 1157)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-01-05 11:46:42 UTC (rev 1158)
@@ -58,7 +58,7 @@
{
persister = new JCRPersister(container);
- List<Class> mappingClasses = new ArrayList<Class>(5);
+ List<Class> mappingClasses = new ArrayList<Class>(6);
Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class, ConsumerMapping.class, ConsumerGroupMapping.class,
RegistrationMapping.class, ConsumerCapabilitiesMapping.class, RegistrationPropertiesMapping.class);
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2010-01-05 07:48:08 UTC (rev 1157)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2010-01-05 11:46:42 UTC (rev 1158)
@@ -42,7 +42,7 @@
</init-params>
</component>
- <external-component-plugins>
+ <!--<external-component-plugins>
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
<component-plugin>
<name>chromattic</name>
@@ -76,6 +76,6 @@
</values-param>
</init-params>
</component-plugin>
- </external-component-plugins>
+ </external-component-plugins>-->
</configuration>
14 years, 11 months
gatein SVN: r1157 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-01-05 02:48:08 -0500 (Tue, 05 Jan 2010)
New Revision: 1157
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
GTNPORTAL-441: The token in autologin feature is not removed
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2010-01-05 06:46:21 UTC (rev 1156)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2010-01-05 07:48:08 UTC (rev 1157)
@@ -43,6 +43,8 @@
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.services.resources.ResourceBundleManager;
import org.exoplatform.web.login.InitiateLoginServlet;
+import org.exoplatform.web.security.security.AbstractTokenService;
+import org.exoplatform.web.security.security.CookieTokenService;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -423,6 +425,14 @@
{
PortalRequestContext prContext = Util.getPortalRequestContext();
HttpServletRequest req = prContext.getRequest();
+
+ //Delete the token from JCR
+ String token = getTokenCookie(req);
+ if(token != null){
+ AbstractTokenService tokenService = AbstractTokenService.getInstance(CookieTokenService.class);
+ tokenService.deleteToken(token);
+ }
+
req.getSession().invalidate();
Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, "");
cookie.setPath(req.getContextPath());
@@ -435,6 +445,23 @@
prContext.getResponse().sendRedirect(redirect);
prContext.setResponseComplete(true);
}
+
+ private String getTokenCookie(HttpServletRequest req)
+ {
+ Cookie[] cookies = req.getCookies();
+ if (cookies != null)
+ {
+ for (Cookie cookie : cookies)
+ {
+ if (InitiateLoginServlet.COOKIE_NAME.equals(cookie.getName()))
+ {
+ return cookie.getValue();
+ }
+ }
+ }
+ return null;
+ }
+
}
static public class ChangeWindowStateActionListener extends EventListener<UIPortal>
14 years, 11 months
gatein SVN: r1156 - in portal/trunk/docs/user-guide/en/modules: portal and 1 other directory.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-01-05 01:46:21 -0500 (Tue, 05 Jan 2010)
New Revision: 1156
Modified:
portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml
portal/trunk/docs/user-guide/en/modules/portal/Toolbar.xml
portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml
Log:
edits to Portal Admin chapter
Modified: portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml 2010-01-04 01:45:02 UTC (rev 1155)
+++ portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml 2010-01-05 06:46:21 UTC (rev 1156)
@@ -68,7 +68,7 @@
<itemizedlist>
<listitem>
<para>
- If you selected <emphasis role="bold">Forgot my password</emphasis> option you will be prompted for your <emphasis role="bold">Username</emphasis>:
+ If you selected the <emphasis role="bold">Forgot my password</emphasis> option you will be prompted for your <emphasis role="bold">Username</emphasis>:
</para>
<mediaobject>
<imageobject>
@@ -78,7 +78,7 @@
</listitem>
<listitem>
<para>
- If you selected <emphasis role="bold">Forgot my username</emphasis> option:
+ If you selected <emphasis role="bold">Forgot my username</emphasis> you will be prompted for your email address.
</para>
<mediaobject>
<imageobject>
@@ -90,7 +90,7 @@
</step>
<step>
<para>
- Enter a value in the field of this form.
+ Enter the approprate value into the open field.
</para>
</step>
<step>
@@ -100,23 +100,17 @@
</step>
</procedure>
<para>
- After your information has been sent, you will be received an email with your User name/ Password in your email address that you registered.
+ After you submit the form an email will be send to your email address with the requested information, either your username or password.
</para>
- <itemizedlist>
- <listitem>
- <para>
- If you forget user name: when retrieving user name, your old user name still is remained and reused.
- </para>
- </listitem>
- <listitem>
- <para>
- If you forget old password: you will be set a new password (as temporary). Then you will be directed to change password the next time you sign in.
- </para>
- </listitem>
- </itemizedlist>
<para>
- The User name/Password that you received only have effect on 1 day. It means if current date is over 1 day from received date, you can not use the received User name/ Password thus you have to get another email active.
+ If you forgot your username, an old user name still is valid when retrieving username.
</para>
+ <para>
+ If you forgot your password you will be sent a new (temporary) password. You will be directed to change this password the next time you sign in.
+ </para>
+ <para>
+ 'Recovered' usernames or passwords are only valid for one (1) day after being sent. If these details are not used within this time a new retrieval/reset will be required.
+ </para>
</section>
Modified: portal/trunk/docs/user-guide/en/modules/portal/Toolbar.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/Toolbar.xml 2010-01-04 01:45:02 UTC (rev 1155)
+++ portal/trunk/docs/user-guide/en/modules/portal/Toolbar.xml 2010-01-05 06:46:21 UTC (rev 1156)
@@ -23,7 +23,7 @@
--><title>Toolbar</title>
<para>
- The convenient Toolbar helps users and administrators to manipulate all actions quickly.
+ The Toolbar offers a convenient way for users and administrators to undertake portal actions quickly and easily.
</para>
<section>
@@ -34,7 +34,7 @@
<term>Dashboard</term>
<listitem>
<para>
- You can change language, change skin and sign out from GateIn Portal.
+ You can use the Dashboard to change the language or skin used in the portal or to sign out.
</para>
<mediaobject>
<imageobject>
@@ -47,7 +47,7 @@
<term>Site</term>
<listitem>
<para>
- It shows all different sites available in GateIn Portal allows users to directly edit the navigation tree.
+ The Site navigation function shows the different sites available in this Portal and allows users to directly edit the navigation tree.
</para>
<mediaobject>
<imageobject>
@@ -60,7 +60,7 @@
<term>Group</term>
<listitem>
<para>
- Users can easily see and access pages in GateIn Portal.
+ Using the Group navigation function users can easily see and access pages in the Portal.
</para>
<mediaobject>
<imageobject>
@@ -74,46 +74,16 @@
<section>
<title>Administration Actions in the Toolbar</title>
-
<variablelist>
<varlistentry>
- <term>Editor</term>
- <listitem>
- <para>
- You easily edit a page or add a new page
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Edit.png" format="PNG" />
- </imageobject>
- </mediaobject>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>Administrator</term>
+ <term> Editor</term>
<listitem>
<para>
- You can add or edit pages to the current portal, manage details for othe rportals or create new portals.
+ Portal Administrators have access to another navigation that offers links to add a new page to the current portal, edit a particular page's properties or to change a page's layout. This navigation appears next to the Dashboard navigation in the Toolbar and is contextually-named. It will appear as either <emphasis role="bold">Site Editor</emphasis> or <emphasis role="bold">Group Editor</emphasis> dependinfg on the user's location within the portal.
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Admin2.6.png" format="PNG" />
- </imageobject>
- </mediaobject>
</listitem>
</varlistentry>
- <varlistentry>
- <term>Edit Inline</term>
- <listitem>
- <para>
- With the Edit Inline Composer popup that consists of two tabs: Applications and Containers, it is convenient for a user to select the component that he wants and to drag and drop it to the page.
- </para>
- <para>
- You also quickly edit, delete portlets in a page, change portal's properties or switch the view mode.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
+ </variablelist>
</section>
</section>
Modified: portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml 2010-01-04 01:45:02 UTC (rev 1155)
+++ portal/trunk/docs/user-guide/en/modules/portal/User_Management.xml 2010-01-05 06:46:21 UTC (rev 1156)
@@ -23,28 +23,31 @@
--><title>User management</title>
<para>
- It is so difficult to manage and set permissions for a great number of registered users in a system. To solve this problem, GateIn Portal helps Administrators manage users, groups and memberships easily as well as effectively.
+ To assist Administrators to manage a number of registered users &PRODUCT; offers a number of tools to manage users, groups and memberships easily and effectively.
</para>
- <para>
- Go to <emphasis role="bold">Administration</emphasis> / <emphasis role="bold">Community Management</emphasis> (or Organization/Management). The <emphasis role="bold">Organization</emphasis> form appears:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/UserManage.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
<section id="sect-User_Guide-User_Management-Manage_users">
<title>Manage users</title>
<para>
- Select the <emphasis role="bold">User Management</emphasis> tab in the <emphasis role="bold">Organization</emphasis> form. By default, it will show all existing registered users. With <emphasis role="bold">User Management</emphasis> , you can see all existing registered users, and also search, edit, delete them. For each user, you can see his groups and his memberships (roles) in these groups. You can not add users to a group but you can remove them from the group.
+ Select the <emphasis role="bold">Group</emphasis> navigation in the Toolbar. Under the <emphasis role="bold">Executive Board's Pages</emphasis> heading is a link to <emphasis role="bold">Organization</emphasis> options.
</para>
+ <para>
+ Clicking <emphasis>Users and Groups Management</emphasis> in this list will open an easily navigated table of current registered users.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/UserManage.png" format="PNG" width="444" />
+ </imageobject>
+ </mediaobject>
+ <para>
+ Administrators can see all existing registered users and search, edit or even delete them. Each user's groups and memberships (roles) in these groups are also available. You can not add users to a group but you can remove them from the group.
+ </para>
</section>
<section id="sect-User_Guide-User_Management-Search_a_user">
<title>Search a user</title>
<para>
- The Administrator can search users by user name, first name, last name or email address.
+ The Administrator can search for specific users by username, first name, last name or email address.
</para>
<procedure>
<step>
14 years, 11 months
gatein SVN: r1155 - in portal/trunk/docs/user-guide/en/modules: account and 1 other directory.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-01-03 20:45:02 -0500 (Sun, 03 Jan 2010)
New Revision: 1155
Modified:
portal/trunk/docs/user-guide/en/modules/Account.xml
portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml
portal/trunk/docs/user-guide/en/modules/account/Change_Account_Settings.xml
portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml
portal/trunk/docs/user-guide/en/modules/account/Sign_in_and_Sign_out.xml
Log:
Chapter 4 copy edit
Modified: portal/trunk/docs/user-guide/en/modules/Account.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/Account.xml 2010-01-01 18:01:10 UTC (rev 1154)
+++ portal/trunk/docs/user-guide/en/modules/Account.xml 2010-01-04 01:45:02 UTC (rev 1155)
@@ -23,10 +23,11 @@
--><title>Accounts</title>
<xi:include href="account/Register_New_Accounts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="account/Change_User_Password.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="account/Sign_in_and_Sign_out.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="account/Remember_User_Account.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="account/Change_Account_Settings.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="account/Sign_in_and_Sign_out.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<!-- <xi:include href="account/Change_User_Password.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> - Covered in Change_Account_Setings.xml -->
<xi:include href="account/Account_and_Password_Retrieval.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="account/Remember_User_Account.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
</chapter>
Modified: portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml 2010-01-01 18:01:10 UTC (rev 1154)
+++ portal/trunk/docs/user-guide/en/modules/account/Account_and_Password_Retrieval.xml 2010-01-04 01:45:02 UTC (rev 1155)
@@ -23,26 +23,23 @@
--><title>Account and Password Retrieval</title>
<para>
- This feature is really useful when you forget your account or password by recovering it quickly through following simple steps:
+ Should you forget your account or password you can recover it quickly by following these simple steps:
</para>
<procedure>
<step>
<para>
- Show the form that guides you step by step in recovering your User name/ Password by clicking the link 'Forget your User Name/Password?' beneath the <emphasis role="bold">Password</emphasis> field of the <emphasis role="bold">Sign in</emphasis> form.
+ Click the link 'Forget your User Name/Password?' (beneath the <emphasis role="bold">Password</emphasis> field of the <emphasis role="bold">Sign in</emphasis> form). This presents the form that guides you through recovering your username and/or password.
</para>
<mediaobject>
<imageobject>
<imagedata fileref="images/SignIn1.png" format="PNG" width="444" />
</imageobject>
</mediaobject>
+ </step>
+ <step>
<para>
This form offers two options to select:
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Forgot1.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
<itemizedlist>
<listitem>
<para>
@@ -55,20 +52,23 @@
</para>
</listitem>
</itemizedlist>
- </step>
- <step>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Forgot1.png" format="PNG" width="444" />
+ </imageobject>
+ </mediaobject>
<para>
- Select one of two options in this form.
+ Select the appropriate option and click <emphasis role="bold">Next</emphasis>.
</para>
</step>
<step>
<para>
- Click the <emphasis role="bold">Next</emphasis> button to go to the next step:
+ You will be prompted to provide identification information depending on which option you selected:
</para>
<itemizedlist>
<listitem>
<para>
- If you selected <emphasis role="bold">Forgot my password</emphasis> option:
+ If you selected <emphasis role="bold">Forgot my password</emphasis> option you will be prompted for your <emphasis role="bold">Username</emphasis>:
</para>
<mediaobject>
<imageobject>
Modified: portal/trunk/docs/user-guide/en/modules/account/Change_Account_Settings.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Change_Account_Settings.xml 2010-01-01 18:01:10 UTC (rev 1154)
+++ portal/trunk/docs/user-guide/en/modules/account/Change_Account_Settings.xml 2010-01-04 01:45:02 UTC (rev 1155)
@@ -22,15 +22,12 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
--><title>Change Account Settings</title>
- <!-- <para>
- There are two ways to change the account information:
- </para>
- <title>The 1^st^ way</title> -->
+
<para>
- All users can follow this guides to change your account information.
+ Users can follow this guide to change account information.
</para>
<para>
- To change your account information, you just click on your account:
+ To change your account information, click on the account name in the top navigation bar:
</para>
<mediaobject>
<imageobject>
@@ -46,22 +43,22 @@
</imageobject>
</mediaobject>
<para>
- If you want to change your <emphasis role="bold">Account Profiles</emphasis> :
+ If you want to change your Account Profile information:
</para>
<procedure>
<step>
<para>
- Select the <emphasis role="bold">Account Profiles</emphasis> tab. It will display your current basic information.
+ Select the <emphasis role="bold">Account Profiles</emphasis> tab. This will display your current basic information.
</para>
</step>
<step>
<para>
- Your <emphasis role="bold">User Name</emphasis> can not be changed. You can change these fields: <emphasis role="bold">First Name</emphasis> , <emphasis role="bold">Last Name</emphasis> and <emphasis role="bold">Email</emphasis> .
+ Your <emphasis role="bold">User Name</emphasis> cannot be changed. You can change your: <emphasis role="bold">First Name</emphasis> , <emphasis role="bold">Last Name</emphasis> and <emphasis role="bold">Email</emphasis>.
</para>
</step>
<step>
<para>
- Click the <emphasis role="bold">Save</emphasis> button to accept changes.
+ Once the desired changes have been made, click the <emphasis role="bold">Save</emphasis> button to submit them.
</para>
</step>
</procedure>
@@ -71,7 +68,7 @@
<procedure>
<step>
<para>
- Select the <emphasis role="bold">Change Password</emphasis> tab, it will display a form:
+ Select the <emphasis role="bold">Change Password</emphasis> tab, it will display the following form:
</para>
<mediaobject>
<imageobject>
@@ -91,7 +88,7 @@
</step>
<step>
<para>
- Reinput your password in the <emphasis role="bold">Confirm New Password</emphasis> field.
+ Re-enter your password in the <emphasis role="bold">Confirm New Password</emphasis> field.
</para>
</step>
<step>
@@ -100,18 +97,7 @@
</para>
</step>
</procedure>
- <!--
- <section>
- <title>The 2^nd^ way</title>
- <para>Only users who have the permission to access GateIn start in
- the
- User Workspace can follow this way.</para>
- <para>
- Go to
- <emphasis role="bold">GateIn Start</emphasis>
- -> <emphasis role="bold">Administration</emphasis> -> <emphasis role="bold">Account Settings</emphasis></para><mediaobject><imageobject><imagedata fileref="images/ChangeLanguage3.png" format="PNG"></imagedata></imageobject></mediaobject><para>It will also open the <emphasis role="bold">Account Profiles</emphasis> form.</para><mediaobject><imageobject><imagedata fileref="images/AccountProfiles1.png" format="PNG"></imagedata></imageobject></mediaobject><para>You can change your information in the <emphasis role="bold">Account Profiles</emphasis> tab and the <emphasis role="bold">Change Password</emphasis> tab as the same as the first way.</para>
- </section> -->
</section>
Modified: portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml 2010-01-01 18:01:10 UTC (rev 1154)
+++ portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml 2010-01-04 01:45:02 UTC (rev 1155)
@@ -23,7 +23,7 @@
--><title>Register New Accounts</title>
<para>
- Users who visit the Portal and who are not registered are limited in the content they can see. User who need access to deeper content or who need to undertake actions within the prtal should register themselves and then contact the portal administrator to have appropriate permissions added to their account.
+ Users who visit the Portal and who are not registered are limited in the content they can see. Users who need access to deeper content or who need to undertake actions within the prtal should register themselves and then contact the portal administrator to have appropriate permissions added to their account.
</para>
<para>
Users can quickly and easily register a new account by themselves. Just by completing the steps below, you will have a new account that helps you access more pages and take more actions in &PRODUCT;:
@@ -72,7 +72,7 @@
<term>Confirm Password</term>
<listitem>
<para>
- Re-type the password above. *Password* and *Confirm Password* must be the same.
+ Re-type the password above. The <emphasis>Password</emphasis> and <emphasis>Confirm Password</emphasis> fields must be the same.
</para>
</listitem>
</varlistentry>
@@ -117,7 +117,7 @@
Input values in the <emphasis role="bold">User Profile</emphasis> tab, include: Profile information, Home information, Business information. These fields are not required.
</para>
<para>
- &PRODUCT; facilitates users with four commonly used languagues: English, French, Vietnamese and Arabic in the <emphasis role="bold">Language</emphasis> field. You can select one of these languages to work with.
+ &PRODUCT; facilitates four commonly used languagues: English, French, Vietnamese and Arabic in the <emphasis role="bold">Language</emphasis> field. You can select one of these languages to work with.
</para>
<mediaobject>
<imageobject>
@@ -127,7 +127,7 @@
</step>
<step>
<para>
- Click <emphasis role="bold">Save</emphasis> to register a new account or <emphasis role="bold">Reset</emphasis> to refresh all entered values. There will be an alert message and you can not add a new account if one of these cases occurs:
+ Click <emphasis role="bold">Save</emphasis> to register a new account or <emphasis role="bold">Reset</emphasis> to refresh all entered values. You cannot add a new account if one of these cases occurs:
</para>
<itemizedlist>
<listitem>
Modified: portal/trunk/docs/user-guide/en/modules/account/Sign_in_and_Sign_out.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Sign_in_and_Sign_out.xml 2010-01-01 18:01:10 UTC (rev 1154)
+++ portal/trunk/docs/user-guide/en/modules/account/Sign_in_and_Sign_out.xml 2010-01-04 01:45:02 UTC (rev 1155)
@@ -24,7 +24,7 @@
--><title>Sign In and Sign Out</title>
<para>
- After registering your account, you can easily sign in to &PRODUCT; to go into your private mode:
+ After registering your account, you can sign in to &PRODUCT; to go into your private mode.
</para>
<procedure>
<title>Sign In</title>
@@ -35,7 +35,7 @@
</step>
<step>
<para>
- Click the <emphasis role="bold">Sign in</emphasis> link at the top right of a page if you are current in the Classic portal. The <emphasis role="bold">Sign in</emphasis> form appears:
+ Click the <emphasis role="bold">Sign in</emphasis> link at the top right of the page if you are current in the Classic portal. The <emphasis role="bold">Sign in</emphasis> form appears:
</para>
<mediaobject>
<imageobject>
@@ -55,79 +55,77 @@
</step>
<step>
<para>
- Click the <emphasis role="bold">Sign in</emphasis> button to accept or <emphasis role="bold">Discard</emphasis> to escape the <emphasis role="bold">Sign in</emphasis> form.
+ Click the <emphasis role="bold">Sign in</emphasis> button to submit the form or <emphasis role="bold">Discard</emphasis> to escape.
</para>
</step>
<step>
<para>
Details:
</para>
- <informaltable colsep="0" frame="none" rowsep="0">
- <tgroup cols="2">
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <tbody>
- <row>
- <entry>
- <emphasis role="bold"> Field </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Description </emphasis>
- </entry>
- </row>
- <row>
- <entry>
+ <variablelist>
+ <varlistentry>
+ <term>
User name
- </entry>
- <entry>
+ </term>
+ <listitem>
+ <para>
The registered user name.
- </entry>
- </row>
- <row>
- <entry>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
Password
- </entry>
- <entry>
+ </term>
+ <listitem>
+ <para>
The registered password.
- </entry>
- </row>
- <row>
- <entry>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
Remember My Login
- </entry>
- <entry>
- This option allows users to return to &PRODUCT; and be automatically authenticated based on the value of a cookie provided by the browser. Thus users do not have to perform an explicit authentication again.
- </entry>
- </row>
- <row>
- <entry>
+ </term>
+ <listitem>
+ <para>
+ This option allows users to return to &PRODUCT; and be automatically authenticated based on the value of a cookie provided by the bvarlistentryser. Thus users do not have to perform an explicit authentication again.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
Forgot your User Name/Password?
- </entry>
- <entry>
+ </term>
+ <listitem>
+ <para>
To follow some steps to get the forgotten user name or password. Please refer [Portal:Account and Password Retrieval] for more details.
- </entry>
- </row>
- <row>
- <entry>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
Sign in
- </entry>
- <entry>
+ </term>
+ <listitem>
+ <para>
To sign into &PRODUCT; with user name and password.
- </entry>
- </row>
- <row>
- <entry>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
Discard
- </entry>
- <entry>
+ </term>
+ <listitem>
+ <para>
To close the *Sign In* form.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
<para>
- In case, <emphasis role="bold">User Name</emphasis> does not exist or the inputted User name/Password is invalid, there will be an alert message requires you to input the right value. To login again, you click the <emphasis role="bold">OK</emphasis> button on the alert message and enter <emphasis role="bold">User Name</emphasis> and <emphasis role="bold">Password</emphasis> again.
+ If <emphasis role="bold">User Name</emphasis> does not exist or the User name/Password is invalid an alert message will appear. This alert requires you to input a recognised value. To attempt the login again; click the <emphasis role="bold">OK</emphasis> button on the alert message to be returned to the Sign In form. Enter <emphasis role="bold">User Name</emphasis> and <emphasis role="bold">Password</emphasis> again.
</para>
<para>
After signing in, you will be redirected to the authenticated homepage:
14 years, 11 months
gatein SVN: r1153 - in portal/branches: management and 18 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-01 09:50:44 -0500 (Fri, 01 Jan 2010)
New Revision: 1153
Added:
portal/branches/management/
portal/branches/management/component/common/src/main/java/conf/portal/
portal/branches/management/component/common/src/main/java/conf/portal/configuration.xml
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ResourceKey.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/Rest.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/RestManagementProvider.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/TestService.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ValueWrapper.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResource.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethod.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethodParameter.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceProperty.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/GetterInvoker.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/MethodInvoker.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/NoSuchMethodInvoker.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SetterInvoker.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SimpleMethodInvoker.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/JsonGeneratorExt.java
portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/MessageBodyWriterImpl.java
portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/Visit.java
portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/XMLVisitor.java
Modified:
portal/branches/management/component/common/pom.xml
portal/branches/management/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatisticService.java
portal/branches/management/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
portal/branches/management/pom.xml
portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java
portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatisticService.java
portal/branches/portalsession/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java
portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java
portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
working branch based on trunk revision 1148 + the kernel 2.2.0-Beta06-SNAPSHOT
Copied: portal/branches/management (from rev 1148, portal/trunk)
Modified: portal/branches/management/component/common/pom.xml
===================================================================
--- portal/trunk/component/common/pom.xml 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/common/pom.xml 2010-01-01 14:50:44 UTC (rev 1153)
@@ -32,6 +32,12 @@
<dependencies>
<dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ </dependency>
+
+
+ <dependency>
<groupId>org.gatein.common</groupId>
<artifactId>common-logging</artifactId>
</dependency>
Added: portal/branches/management/component/common/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/branches/management/component/common/src/main/java/conf/portal/configuration.xml (rev 0)
+++ portal/branches/management/component/common/src/main/java/conf/portal/configuration.xml 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+ <component>
+ <key>org.exoplatform.commons.management.RestManagementProvider</key>
+ <type>org.exoplatform.commons.management.RestManagementProvider</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.commons.management.TestService</key>
+ <type>org.exoplatform.commons.management.TestService</type>
+ </component>
+
+</configuration>
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ResourceKey.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ResourceKey.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ResourceKey.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public final class ResourceKey
+{
+
+ /** . */
+ private final String name;
+
+ public ResourceKey(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ this.name = name;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ResourceKey)
+ {
+ ResourceKey that = (ResourceKey)obj;
+ return name.equals(that.name);
+ }
+ return false;
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/Rest.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/Rest.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/Rest.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target(ElementType.TYPE)
+public @interface Rest
+{
+
+ String value();
+
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/RestManagementProvider.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/RestManagementProvider.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/RestManagementProvider.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management;
+
+import org.exoplatform.commons.management.data.RestResource;
+import org.exoplatform.commons.management.rs.MessageBodyWriterImpl;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.management.spi.ManagedResource;
+import org.exoplatform.management.spi.ManagementProvider;
+import org.exoplatform.services.rest.impl.ProviderBinder;
+import org.exoplatform.services.rest.resource.ResourceContainer;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@Path("management")
+public class RestManagementProvider implements ResourceContainer, ManagementProvider
+{
+
+ /** . */
+ private final ExoContainerContext context;
+
+ /** . */
+ private final Map<ResourceKey, RestResource> resourceMap = new HashMap<ResourceKey, RestResource>();
+
+ public RestManagementProvider(ExoContainerContext context)
+ {
+ //
+ ProviderBinder binders = ProviderBinder.getInstance();
+ binders.addMessageBodyWriter(MessageBodyWriterImpl.class);
+
+ //
+ this.context = context;
+ }
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public ValueWrapper list()
+ {
+ List<String> list = new ArrayList<String>();
+ for (RestResource mr : resourceMap.values())
+ {
+ list.add(mr.getName());
+ }
+ return ValueWrapper.wrap(list);
+ }
+
+ @Path("{resource}")
+ public RestResource dispatch(@PathParam("resource") String resourceName)
+ {
+ return resourceMap.get(new ResourceKey(resourceName));
+ }
+
+ // ManagementProvider implementation ********************************************************************************
+
+ public Object manage(ManagedResource managedResource)
+ {
+ Object resource = managedResource.getResource();
+
+ //
+ Rest annotation = resource.getClass().getAnnotation(Rest.class);
+
+ //
+ if (annotation != null)
+ {
+ String name = annotation.value();
+ ResourceKey key = new ResourceKey(name);
+ resourceMap.put(key, new RestResource(name, managedResource));
+ return key;
+ }
+
+ //
+ return null;
+ }
+
+ public void unmanage(Object key)
+ {
+ resourceMap.remove(key);
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/TestService.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/TestService.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/TestService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management;
+
+import org.exoplatform.management.annotations.Managed;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@Managed
+@Rest("test")
+public class TestService
+{
+
+ /** . */
+ private String foo;
+
+ @Managed
+ public String getFoo()
+ {
+ return foo;
+ }
+
+ @Managed
+ public void setFoo(String foo)
+ {
+ this.foo = foo;
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ValueWrapper.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ValueWrapper.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/ValueWrapper.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management;
+
+/**
+ * Temporary class until eXo JSON marshaller supports non java bean objects.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ValueWrapper<T>
+{
+
+ public static <T> ValueWrapper<T> wrap(T value)
+ {
+ return new ValueWrapper<T>(value);
+ }
+
+ /** . */
+ private final T value;
+
+ public ValueWrapper(T value)
+ {
+ this.value = value;
+ }
+
+ public T getValue()
+ {
+ return value;
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResource.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResource.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResource.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,239 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.data;
+
+import org.exoplatform.commons.management.ValueWrapper;
+import org.exoplatform.commons.management.invocation.MethodInvoker;
+import org.exoplatform.management.annotations.ImpactType;
+import org.exoplatform.management.spi.ManagedMethodMetaData;
+import org.exoplatform.management.spi.ManagedPropertyMetaData;
+import org.exoplatform.management.spi.ManagedResource;
+import org.exoplatform.management.spi.ManagedTypeMetaData;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RestResource
+{
+
+ /** . */
+ final Map<String, RestResourceProperty> properties;
+
+ /** . */
+ private final List<RestResourceMethod> methods;
+
+ /** . */
+ private final ManagedResource managedResource;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final String description;
+
+ public RestResource(String name, ManagedResource managedResource)
+ {
+ ManagedTypeMetaData managedType = managedResource.getMetaData();
+
+ //
+ HashMap<String, RestResourceProperty> properties = new HashMap<String, RestResourceProperty>();
+ for (ManagedPropertyMetaData managedProperty : managedType.getProperties()) {
+ RestResourceProperty resourceProperty = new RestResourceProperty(managedProperty);
+ properties.put(resourceProperty.getName(), resourceProperty);
+ }
+
+ //
+ List<RestResourceMethod> methods = new ArrayList<RestResourceMethod>();
+ for (ManagedMethodMetaData managedMethod : managedType.getMethods()) {
+ RestResourceMethod resourceMethod = new RestResourceMethod(managedMethod);
+ methods.add(resourceMethod);
+ }
+
+ //
+ this.name = name;
+ this.description = managedType.getDescription();
+ this.managedResource = managedResource;
+ this.properties = Collections.unmodifiableMap(properties);
+ this.methods = methods;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public Collection<RestResourceProperty> getProperties()
+ {
+ return properties.values();
+ }
+
+ public Collection<RestResourceMethod> getMethods()
+ {
+ return methods;
+ }
+
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public RestResource get()
+ {
+ return this;
+ }
+
+ @GET
+ @Path("{name}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Object get(@Context UriInfo info, @PathParam("name") String name)
+ {
+ // Try first to get a property
+ RestResourceProperty property = properties.get(name);
+ if (property != null)
+ {
+ MethodInvoker getter = property.getGetterInvoker();
+ if (getter != null)
+ {
+ return safeInvoke(getter, info.getQueryParameters());
+ }
+ }
+
+ //
+ return tryInvoke(name, info, ImpactType.READ);
+ }
+
+ @PUT
+ @Path("{name}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Object put(@Context UriInfo info, @PathParam("name") String name)
+ {
+ // Try first to get a property
+ RestResourceProperty property = properties.get(name);
+ if (property != null)
+ {
+ MethodInvoker setter = property.getSetterInvoker();
+ if (setter != null)
+ {
+ return safeInvoke(setter, info.getQueryParameters());
+ }
+ }
+
+ //
+ return tryInvoke(name, info, ImpactType.IDEMPOTENT_WRITE);
+ }
+
+ @POST
+ @Path("{name}")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Object post(@Context UriInfo info, @PathParam("name") String name)
+ {
+ return tryInvoke(name, info, ImpactType.WRITE);
+ }
+
+ /**
+ * Try to invoke a method with matching parameters from the query string
+ *
+ * @param info the uri info
+ * @param impact the expected impact
+ * @return a suitable response
+ */
+ private Object tryInvoke(String methodName, UriInfo info, ImpactType impact)
+ {
+ MultivaluedMap<String, String> parameters = info.getQueryParameters();
+
+ //
+ RestResourceMethod method = lookupMethod(methodName, parameters.keySet(), impact);
+
+ //
+ if (method != null)
+ {
+ MethodInvoker invoker = method.getMethodInvoker();
+ return safeInvoke(invoker, parameters);
+ }
+
+ //
+ return null;
+ }
+
+ private RestResourceMethod lookupMethod(String methodName, Set<String> argNames, ImpactType impact)
+ {
+ for (RestResourceMethod method : methods)
+ {
+ if (method.getName().equals(methodName) && method.metaData.getImpact() == impact && method.parameterNames.equals(argNames))
+ {
+ return method;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Invoke safely a method.
+ *
+ * @param invoker the method to invoke
+ * @param argMap the arguments
+ * @return the ok response or an object returned by the method wrapped by {@link ValueWrapper}
+ */
+ private Object safeInvoke(MethodInvoker invoker, Map<String, List<String>> argMap)
+ {
+ Object resource = managedResource.getResource();
+
+ //
+ managedResource.beforeInvoke(resource);
+
+ //
+ try
+ {
+ Object ret = invoker.invoke(resource, argMap);
+ return ret == null ? Response.ok() : ValueWrapper.wrap(ret);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return Response.serverError();
+ }
+ finally
+ {
+ managedResource.afterInvoke(resource);
+ }
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethod.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethod.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethod.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,113 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.data;
+
+import org.exoplatform.commons.management.invocation.MethodInvoker;
+import org.exoplatform.commons.management.invocation.SimpleMethodInvoker;
+import org.exoplatform.management.spi.ManagedMethodMetaData;
+import org.exoplatform.management.spi.ManagedMethodParameterMetaData;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RestResourceMethod
+{
+
+ /** . */
+ final ManagedMethodMetaData metaData;
+
+ /** . */
+ final List<RestResourceMethodParameter> parameters;
+
+ /** . */
+ final Set<String> parameterNames;
+
+ /** . */
+ final MethodInvoker methodInvoker;
+
+ public RestResourceMethod(ManagedMethodMetaData metaData)
+ {
+ List<RestResourceMethodParameter> parameters = new ArrayList<RestResourceMethodParameter>();
+ Set<String> parameterNames = new HashSet<String>();
+ for (ManagedMethodParameterMetaData parameterMD : metaData.getParameters())
+ {
+ parameters.add(new RestResourceMethodParameter(parameterMD));
+ parameterNames.add(parameterMD.getName());
+ }
+
+ //
+ this.metaData = metaData;
+ this.parameterNames = Collections.unmodifiableSet(parameterNames);
+ this.parameters = Collections.unmodifiableList(parameters);
+ this.methodInvoker = new SimpleMethodInvoker(metaData.getMethod())
+ {
+ @Override
+ protected String getArgumentName(int index)
+ {
+ RestResourceMethodParameter param = RestResourceMethod.this.parameters.get(index);
+ return param != null ? param.getName() : null;
+ }
+ };
+ }
+
+ public String getName()
+ {
+ return metaData.getName();
+ }
+
+ public String getMethod()
+ {
+ switch (metaData.getImpact())
+ {
+ case READ:
+ return "get";
+ case WRITE:
+ return "post";
+ case IDEMPOTENT_WRITE:
+ return "put";
+ default:
+ throw new AssertionError();
+ }
+ }
+
+ public String getDescription()
+ {
+ return metaData.getDescription();
+ }
+
+ public List<RestResourceMethodParameter> getParameters()
+ {
+ return parameters;
+ }
+
+ // Internal *********************************************************************************************************
+
+ MethodInvoker getMethodInvoker()
+ {
+ return methodInvoker;
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethodParameter.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethodParameter.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceMethodParameter.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.data;
+
+import org.exoplatform.management.spi.ManagedMethodParameterMetaData;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RestResourceMethodParameter
+{
+
+ /** . */
+ final ManagedMethodParameterMetaData metaData;
+
+ public RestResourceMethodParameter(ManagedMethodParameterMetaData metaData)
+ {
+ this.metaData = metaData;
+ }
+
+ public String getName()
+ {
+ return metaData.getName();
+ }
+
+ public String getDescription()
+ {
+ return metaData.getDescription();
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceProperty.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceProperty.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/data/RestResourceProperty.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.data;
+
+import org.exoplatform.commons.management.invocation.GetterInvoker;
+import org.exoplatform.commons.management.invocation.MethodInvoker;
+import org.exoplatform.commons.management.invocation.NoSuchMethodInvoker;
+import org.exoplatform.commons.management.invocation.SetterInvoker;
+import org.exoplatform.management.spi.ManagedPropertyMetaData;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RestResourceProperty
+{
+
+ /** . */
+ final ManagedPropertyMetaData metaData;
+
+ /** . */
+ private final MethodInvoker setterInvoker;
+
+ /** . */
+ private final MethodInvoker getterInvoker;
+
+ public RestResourceProperty(ManagedPropertyMetaData metaData)
+ {
+ Method getter = metaData.getGetter();
+ MethodInvoker getterInvoker = getter != null ? new GetterInvoker(getter) : new NoSuchMethodInvoker();
+
+ //
+ Method setter = metaData.getSetter();
+ MethodInvoker setterInvoker = setter != null ? new SetterInvoker(setter) : new NoSuchMethodInvoker();
+
+ //
+ this.metaData = metaData;
+ this.setterInvoker = setterInvoker;
+ this.getterInvoker = getterInvoker;
+ }
+
+ public String getName()
+ {
+ return metaData.getName();
+ }
+
+ public String getDescription()
+ {
+ return metaData.getDescription();
+ }
+
+ // Internal *********************************************************************************************************
+
+ MethodInvoker getSetterInvoker()
+ {
+ return setterInvoker;
+ }
+
+ MethodInvoker getGetterInvoker()
+ {
+ return getterInvoker;
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/GetterInvoker.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/GetterInvoker.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/GetterInvoker.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.invocation;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class GetterInvoker extends SimpleMethodInvoker
+{
+
+ public GetterInvoker(Method method)
+ {
+ super(method);
+ }
+
+ @Override
+ protected String getArgumentName(int index)
+ {
+ throw new IndexOutOfBoundsException();
+ }
+}
\ No newline at end of file
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/MethodInvoker.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/MethodInvoker.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/MethodInvoker.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.invocation;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface MethodInvoker
+{
+
+ Object invoke(Object o, Map<String, List<String>> argMap) throws IllegalAccessException, InvocationTargetException;
+
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/NoSuchMethodInvoker.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/NoSuchMethodInvoker.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/NoSuchMethodInvoker.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.invocation;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class NoSuchMethodInvoker implements MethodInvoker
+{
+ public Object invoke(Object o, Map<String, List<String>> argMap) throws IllegalAccessException, InvocationTargetException
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SetterInvoker.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SetterInvoker.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SetterInvoker.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.invocation;
+
+import org.exoplatform.commons.management.invocation.MethodInvoker;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SetterInvoker extends SimpleMethodInvoker
+{
+
+ public SetterInvoker(Method method)
+ {
+ super(method);
+ }
+
+ @Override
+ protected String getArgumentName(int index)
+ {
+ if (index == 0)
+ {
+ return "value";
+ }
+ else
+ {
+ throw new IndexOutOfBoundsException();
+ }
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SimpleMethodInvoker.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SimpleMethodInvoker.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/invocation/SimpleMethodInvoker.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.invocation;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class SimpleMethodInvoker implements MethodInvoker
+{
+
+ /** The method we invoke. */
+ private final Method method;
+
+ public SimpleMethodInvoker(Method method)
+ {
+ if (method == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+ this.method = method;
+ }
+
+ public Object invoke(Object o, Map<String, List<String>> argMap) throws IllegalAccessException, InvocationTargetException
+ {
+ Class[] paramTypes = method.getParameterTypes();
+ Object[] args = new Object[paramTypes.length];
+ for (int i = 0;i < paramTypes.length;i++)
+ {
+ String argName = getArgumentName(i);
+ List<String> argValues = argMap.get(argName);
+ Class paramType = paramTypes[i];
+ Object arg;
+ if (paramType.isPrimitive())
+ {
+ throw new UnsupportedOperationException("Todo " + paramType);
+ }
+ else if (paramType.isArray())
+ {
+ throw new UnsupportedOperationException("Todo " + paramType);
+ }
+ else if (paramType == String.class)
+ {
+ arg = (argValues != null && argValues.size() > 0) ? argValues.get(0) : null;
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Todo " + paramType);
+ }
+ args[i] = arg;
+ }
+
+ //
+ return method.invoke(o, args);
+ }
+
+ protected abstract String getArgumentName(int index);
+}
\ No newline at end of file
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/JsonGeneratorExt.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/JsonGeneratorExt.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/JsonGeneratorExt.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.rs;
+
+import org.exoplatform.ws.frameworks.json.impl.JsonException;
+import org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl;
+import org.exoplatform.ws.frameworks.json.value.JsonValue;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class JsonGeneratorExt extends JsonGeneratorImpl
+{
+
+ @Override
+ public JsonValue createJsonValue(Object object) throws JsonException
+ {
+ return super.createJsonValue(object);
+ }
+}
Added: portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/MessageBodyWriterImpl.java
===================================================================
--- portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/MessageBodyWriterImpl.java (rev 0)
+++ portal/branches/management/component/common/src/main/java/org/exoplatform/commons/management/rs/MessageBodyWriterImpl.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.commons.management.rs;
+
+import org.exoplatform.services.rest.impl.provider.JsonEntityProvider;
+import org.exoplatform.ws.frameworks.json.JsonWriter;
+import org.exoplatform.ws.frameworks.json.impl.JsonException;
+import org.exoplatform.ws.frameworks.json.impl.JsonWriterImpl;
+import org.exoplatform.ws.frameworks.json.value.JsonValue;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class MessageBodyWriterImpl extends JsonEntityProvider
+{
+
+ @Override
+ public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException
+ {
+ try
+ {
+ JsonValue jv = new JsonGeneratorExt().createJsonValue(t);
+ JsonWriter jsonWriter = new JsonWriterImpl(entityStream);
+ jv.writeTo(jsonWriter);
+ jsonWriter.flush();
+ }
+ catch (JsonException e)
+ {
+ throw new IOException("Can't write to output stream " + e);
+ }
+ }
+}
Modified: portal/branches/management/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,9 +19,12 @@
package org.exoplatform.portal.resource;
+import org.exoplatform.commons.management.Rest;
import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -56,6 +59,7 @@
@NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "management"),
@Property(key = "type", value = "skin")})
@ManagedDescription("Skin service")
+@Rest("skinservice")
public class SkinService implements Startable
{
@@ -558,6 +562,7 @@
@Managed
@ManagedDescription("Reload all skins")
+ @Impact(type = ImpactType.WRITE)
public void reloadSkins()
{
// remove all ltCache, rtCache
@@ -567,6 +572,7 @@
@Managed
@ManagedDescription("Reload a specified skin")
+ @Impact(type = ImpactType.WRITE)
public void reloadSkin(@ManagedDescription("The skin id")
@ManagedName("skinId")
String skinId)
Modified: portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -22,10 +22,13 @@
import groovy.lang.Writable;
import groovy.text.Template;
+import org.exoplatform.commons.management.Rest;
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.groovyscript.GroovyTemplate;
import org.exoplatform.groovyscript.GroovyTemplateEngine;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -36,6 +39,7 @@
import org.exoplatform.services.cache.ExoCache;
import java.io.InputStream;
+import java.util.ArrayList;
/**
* Created by The eXo Platform SAS Dec 26, 2005
@@ -44,6 +48,7 @@
@NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "management"),
@Property(key = "type", value = "template")})
@ManagedDescription("Template management service")
+@Rest("templateservice")
public class TemplateService
{
@@ -172,6 +177,7 @@
*/
@Managed
@ManagedDescription("Clear the template cache for a specified template identifier")
+ @Impact(type = ImpactType.IDEMPOTENT_WRITE)
public void reloadTemplate(@ManagedDescription("The template id") @ManagedName("templateId") String name)
{
try
@@ -185,4 +191,25 @@
e.printStackTrace();
}
}
+
+ @Managed
+ @ManagedDescription("List the identifiers of the cached templates")
+ @Impact(type = ImpactType.READ)
+ public String[] listCachedTemplates()
+ {
+ try
+ {
+ ArrayList<String> list = new ArrayList<String>();
+ for (GroovyTemplate template : templatesCache_.getCachedObjects())
+ {
+ list.add(template.getId());
+ }
+ return list.toArray(new String[list.size()]);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
}
Modified: portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatisticService.java
===================================================================
--- portal/trunk/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatisticService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/scripting/src/main/java/org/exoplatform/groovyscript/text/TemplateStatisticService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,12 +19,16 @@
package org.exoplatform.groovyscript.text;
+import org.exoplatform.commons.management.Rest;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -40,9 +44,12 @@
*/
@Managed
-@NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "statistic"),
- @Property(key = "type", value = "template")})
@ManagedDescription("Template statistic service")
+@NameTemplate({
+ @Property(key = "view", value = "portal"),
+ @Property(key = "service", value = "statistic"),
+ @Property(key = "type", value = "template")})
+@Rest("templatestatistics")
public class TemplateStatisticService
{
@@ -95,6 +102,7 @@
*/
@Managed
@ManagedDescription("The maximum rendering time of a specified template in seconds")
+ @Impact(type = ImpactType.READ)
public double getMaxTime(@ManagedDescription("The template id") @ManagedName("templateId") String name)
{
TemplateStatistic app = apps.get(name);
@@ -106,6 +114,7 @@
*/
@Managed
@ManagedDescription("The minimum rendering time of a specified template in seconds")
+ @Impact(type = ImpactType.READ)
public double getMinTime(@ManagedDescription("The template id") @ManagedName("templateId") String name)
{
TemplateStatistic app = apps.get(name);
@@ -117,6 +126,7 @@
*/
@Managed
@ManagedDescription("The rendering count of a specified template")
+ @Impact(type = ImpactType.READ)
public long getExecutionCount(@ManagedDescription("The template id") @ManagedName("templateId") String name)
{
TemplateStatistic app = apps.get(name);
@@ -128,6 +138,7 @@
*/
@Managed
@ManagedDescription("The average rendering time of a specified template in seconds")
+ @Impact(type = ImpactType.READ)
public double getAverageTime(@ManagedDescription("The template id") @ManagedName("templateId") String name)
{
TemplateStatistic app = apps.get(name);
@@ -142,12 +153,10 @@
public String[] getSlowestTemplates()
{
- Map application = new HashMap();
- List<Object> list = new LinkedList<Object>(apps.entrySet());
- for (Iterator it = list.iterator(); it.hasNext();)
+ Map<String, Double> application = new HashMap<String, Double>();
+ for (Map.Entry<String, TemplateStatistic> entry : apps.entrySet())
{
- Map.Entry entry = (Map.Entry)it.next();
- String url = (String)entry.getKey();
+ String url = entry.getKey();
application.put(url, getAverageTime(url));
}
@@ -162,12 +171,10 @@
public String[] getMostExecutedTemplates()
{
- Map application = new HashMap();
- List<Object> list = new LinkedList<Object>(apps.entrySet());
- for (Iterator it = list.iterator(); it.hasNext();)
+ Map<String, Long> application = new HashMap<String, Long>();
+ for (Map.Entry<String, TemplateStatistic> entry : apps.entrySet())
{
- Map.Entry entry = (Map.Entry)it.next();
- String url = (String)entry.getKey();
+ String url = entry.getKey();
application.put(url, getExecutionCount(url));
}
@@ -182,74 +189,39 @@
public String[] getFastestTemplates()
{
- Map application = new HashMap();
- List<Object> list = new LinkedList<Object>(apps.entrySet());
- for (Iterator it = list.iterator(); it.hasNext();)
+ Map<String, Double> application = new HashMap<String, Double>();
+ for (Map.Entry<String, TemplateStatistic> entry : apps.entrySet())
{
- Map.Entry entry = (Map.Entry)it.next();
- String url = (String)entry.getKey();
+ String url = entry.getKey();
application.put(url, getAverageTime(url));
}
return sort(application, ASC);
}
- private String[] sort(Map source, String order)
+ private <T extends Comparable<T>> String[] sort(Map<String, T> source, final String order)
{
String[] app = new String[10];
- List<Object> list = new LinkedList<Object>(source.entrySet());
- if (order.equals(ASC))
+ List<Map.Entry<String, T>> list = new ArrayList<Map.Entry<String, T>>(source.entrySet());
+ Collections.sort(list, new Comparator<Map.Entry<String, T>>()
{
- Collections.sort(list, new Comparator<Object>()
+ public int compare(Map.Entry<String, T> o1, Map.Entry<String, T> o2)
{
- public int compare(Object o1, Object o2)
+ T value1 = o1.getValue();
+ T value2 = o2.getValue();
+ if (DESC.equals(order))
{
- double value1 = Double.parseDouble(((Map.Entry)(o1)).getValue().toString());
- double value2 = Double.parseDouble(((Map.Entry)(o2)).getValue().toString());
- if (value1 > value2)
- {
- return 1;
- }
- else if (value1 < value2)
- {
- return -1;
- }
- else
- {
- return 0;
- }
+ T tmp = value1;
+ value1 = value2;
+ value2 = tmp;
}
- });
- }
- else if (order.equals(DESC))
- {
- Collections.sort(list, new Comparator<Object>()
- {
- public int compare(Object o1, Object o2)
- {
- double value1 = Double.parseDouble(((Map.Entry)(o1)).getValue().toString());
- double value2 = Double.parseDouble(((Map.Entry)(o2)).getValue().toString());
- if (value2 > value1)
- {
- return 1;
- }
- else if (value2 < value1)
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
- });
- }
-
+ return value1.compareTo(value2);
+ }
+ });
int index = 0;
- for (Iterator it = list.iterator(); it.hasNext();)
+ for (Map.Entry<String, T> entry : list)
{
- Map.Entry entry = (Map.Entry)it.next();
- app[index] = (String)entry.getKey();
+ app[index] = entry.getKey();
index++;
if (index >= app.length)
{
@@ -257,7 +229,6 @@
}
}
return app;
-
}
private double toSeconds(double value)
Modified: portal/branches/management/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -69,7 +69,7 @@
String cookieToken = tokenService.createToken(credentials);
Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, cookieToken);
cookie.setPath(req.getContextPath());
- cookie.setMaxAge((int)tokenService.getExpiredPeriodTime() / 1000);
+ cookie.setMaxAge((int)tokenService.getValidityTime() / 1000);
resp.addCookie(cookie);
}
}
Modified: portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/AbstractTokenService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -21,6 +21,8 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -41,10 +43,17 @@
/**
* Created by The eXo Platform SAS Author : liem.nguyen ncliam(a)gmail.com Jun 5,
* 2009
+ *
+ * todo julien :
+ * - make delay configuration from init param and @Managed setter
+ * - start/stop expiration daemon
+ * - manually invoke the daemon via @Managed
*/
@Managed
-@NameTemplate({@Property(key = "service", value = "TokenStore"), @Property(key = "name", value = "{Name}")})
@ManagedDescription("Token Store Service")
+@NameTemplate({
+ @Property(key = "service", value = "TokenStore"),
+ @Property(key = "name", value = "{Name}")})
public abstract class AbstractTokenService implements Startable, TokenStore
{
@@ -134,9 +143,10 @@
@Managed
@ManagedDescription("Clean all tokens are expired")
+ @Impact(type = ImpactType.IDEMPOTENT_WRITE)
public void cleanExpiredTokens()
{
- String[] ids = getAllTokens();
+ String[] ids = listTokens();
for (String s : ids)
{
Token token = getToken(s);
@@ -148,35 +158,49 @@
}
@Managed
- @ManagedDescription("Get period time of expired token")
- public long getExpiredPeriodTime()
+ @ManagedDescription("Get time for token expiration in seconds")
+ public long getValidityTime()
{
- return validityMillis;
+ return validityMillis / 1000;
}
@Managed
- @ManagedName("Name")
+ @ManagedDescription("The expiration daemon period time in seconds")
+ public long getPeriodTime()
+ {
+ return DELAY_TIME;
+ }
+
+ @Managed
@ManagedDescription("The token service name")
public String getName()
{
return name;
}
- @Managed
- @ManagedDescription("get a token by id")
public abstract Token getToken(String id);
@Managed
- @ManagedDescription("Delete a token by id")
+ @ManagedDescription("Destroy a token by id")
+ @Impact(type = ImpactType.IDEMPOTENT_WRITE)
+ public void destroyToken(@ManagedName("tokenId") @ManagedDescription("The token id") String id)
+ {
+ deleteToken(id);
+ }
+
public abstract Token deleteToken(String id);
+ // We don't make it a property as retrieving the value can be an expensive operation
@Managed
@ManagedDescription("The list of all tokens")
- public abstract String[] getAllTokens();
+ @Impact(type = ImpactType.READ)
+ public abstract String[] listTokens();
+ // We don't make it a property as retrieving the value can be an expensive operation
@Managed
@ManagedDescription("The number of tokens")
- public abstract long getNumberTokens() throws Exception;
+ @Impact(type = ImpactType.READ)
+ public abstract long size() throws Exception;
private enum TimeoutEnum {
SECOND(1000), MINUTE(1000 * 60), HOUR(1000 * 60 * 60), DAY(1000 * 60 * 60 * 24);
Modified: portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/CookieTokenService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -102,7 +102,7 @@
}
@Override
- public String[] getAllTokens()
+ public String[] listTokens()
{
return new TokenTask<String[]>() {
@Override
@@ -122,7 +122,7 @@
}
@Override
- public long getNumberTokens() throws Exception
+ public long size() throws Exception
{
return new TokenTask<Long>() {
@Override
Modified: portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/component/web/src/main/java/org/exoplatform/web/security/security/TransientTokenService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -70,13 +70,13 @@
}
@Override
- public String[] getAllTokens()
+ public String[] listTokens()
{
return tokens.keySet().toArray(new String[]{});
}
@Override
- public long getNumberTokens() throws Exception
+ public long size() throws Exception
{
return tokens.size();
}
Modified: portal/branches/management/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/pom.xml 2010-01-01 14:50:44 UTC (rev 1153)
@@ -37,7 +37,7 @@
<name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.2.0-Beta05</org.exoplatform.kernel.version>
+ <org.exoplatform.kernel.version>2.2.0-Beta06-SNAPSHOT</org.exoplatform.kernel.version>
<org.exoplatform.core.version>2.3.0-Beta05</org.exoplatform.core.version>
<org.exoplatform.ws.version>2.1.0-Beta05</org.exoplatform.ws.version>
<org.exoplatform.jcr.version>1.12.0-Beta05</org.exoplatform.jcr.version>
@@ -175,6 +175,11 @@
<artifactId>exo.ws.frameworks.servlet</artifactId>
<version>${org.exoplatform.ws.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ <version>${org.exoplatform.ws.version}</version>
+ </dependency>
<!-- GateIn components -->
<dependency>
Modified: portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,9 @@
package org.exoplatform.portal.application;
+import org.exoplatform.commons.management.Rest;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -38,9 +41,12 @@
* @version $Revision$
*/
@Managed
-@NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "statistic"),
+@ManagedDescription("Application statistic service")
+@NameTemplate({
+ @Property(key = "view", value = "portal"),
+ @Property(key = "service", value = "statistic"),
@Property(key = "type", value = "application")})
-@ManagedDescription("Application statistic service")
+@Rest("applicationstatistic")
public class ApplicationStatisticService implements Startable
{
@@ -66,8 +72,7 @@
/*
* get ApplicationStatistic by application id, if it isn't exits, create a new one
*/
- public ApplicationStatistic getApplicationStatistic(
- @ManagedDescription("The application id") @ManagedName("applicationId") String appId)
+ public ApplicationStatistic getApplicationStatistic(String appId)
{
ApplicationStatistic app = apps.get(appId);
if (app == null)
@@ -87,6 +92,7 @@
*/
@Managed
@ManagedDescription("The maximum execution time of a specified application in seconds")
+ @Impact(type = ImpactType.READ)
public double getMaxTime(@ManagedDescription("The application id") @ManagedName("applicationId") String appId)
{
ApplicationStatistic app = getApplicationStatistic(appId);
@@ -98,6 +104,7 @@
*/
@Managed
@ManagedDescription("The minimum execution time of a specified application in seconds")
+ @Impact(type = ImpactType.READ)
public double getMinTime(@ManagedDescription("The application id") @ManagedName("applicationId") String appId)
{
ApplicationStatistic app = getApplicationStatistic(appId);
@@ -109,6 +116,7 @@
*/
@Managed
@ManagedDescription("Return the average execution time of a specified application in seconds")
+ @Impact(type = ImpactType.READ)
public double getAverageTime(@ManagedDescription("The application id") @ManagedName("applicationId") String appId)
{
ApplicationStatistic app = getApplicationStatistic(appId);
@@ -120,6 +128,7 @@
*/
@Managed
@ManagedDescription("The execution count of a specified application")
+ @Impact(type = ImpactType.READ)
public long getExecutionCount(@ManagedDescription("The application id") @ManagedName("applicationId") String appId)
{
ApplicationStatistic app = getApplicationStatistic(appId);
Modified: portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatisticService.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatisticService.java 2009-12-29 02:50:05 UTC (rev 1148)
+++ portal/branches/management/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStatisticService.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,9 @@
package org.exoplatform.portal.application;
+import org.exoplatform.commons.management.Rest;
+import org.exoplatform.management.annotations.Impact;
+import org.exoplatform.management.annotations.ImpactType;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -36,9 +39,12 @@
* @version $Revision$
*/
@Managed
-@NameTemplate({@Property(key = "view", value = "portal"), @Property(key = "service", value = "statistic"),
+@ManagedDescription("The portal statistic service")
+@NameTemplate({
+ @Property(key = "view", value = "portal"),
+ @Property(key = "service", value = "statistic"),
@Property(key = "type", value = "portal")})
-@ManagedDescription("The portal statistic service")
+@Rest("portalstatistic")
public class PortalStatisticService implements Startable
{
@@ -94,6 +100,7 @@
*/
@Managed
@ManagedDescription("The maximum execution time of a specified portal in seconds")
+ @Impact(type = ImpactType.READ)
public double getMaxTime(@ManagedDescription("The portal id") @ManagedName("portalId") String id)
{
return toSeconds(getPortalStatistic(id).getMaxTime());
@@ -104,6 +111,7 @@
*/
@Managed
@ManagedDescription("The mininum execution time of a specified portal in seconds")
+ @Impact(type = ImpactType.READ)
public double getMinTime(@ManagedDescription("The portal id") @ManagedName("portalId") String id)
{
return toSeconds(getPortalStatistic(id).getMinTime());
@@ -114,6 +122,7 @@
*/
@Managed
@ManagedDescription("The average execution time of a specified portal in seconds")
+ @Impact(type = ImpactType.READ)
public double getAverageTime(@ManagedDescription("The portal id") @ManagedName("portalId") String id)
{
return toSeconds(getPortalStatistic(id).getAverageTime());
@@ -124,6 +133,7 @@
*/
@Managed
@ManagedDescription("The number of request per second of a specified portal")
+ @Impact(type = ImpactType.READ)
public double getThroughput(@ManagedDescription("The portal id") @ManagedName("portalId") String id)
{
return getPortalStatistic(id).getThroughput();
@@ -134,6 +144,7 @@
*/
@Managed
@ManagedDescription("The execution count of a specified portal")
+ @Impact(type = ImpactType.READ)
public long getExecutionCount(@ManagedDescription("The portal id") @ManagedName("portalId") String id)
{
return getPortalStatistic(id).viewCount();
Modified: portal/branches/portalsession/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java
===================================================================
--- portal/branches/portalsession/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java 2009-12-31 13:16:36 UTC (rev 1152)
+++ portal/branches/portalsession/component/application-registry/src/main/java/org/exoplatform/application/registry/Application.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,7 @@
package org.exoplatform.application.registry;
+import org.exoplatform.commons.Visit;
import org.exoplatform.portal.config.model.ApplicationType;
import java.util.ArrayList;
@@ -30,6 +31,7 @@
* Date: 15 juin 2004
*
*/
+@Visit
public class Application
{
Added: portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/Visit.java
===================================================================
--- portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/Visit.java (rev 0)
+++ portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/Visit.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.commons;
+
+import org.dom4j.Element;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)Target({ElementType.TYPE,ElementType.FIELD})
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface Visit
+{
+
+
+}
Added: portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/XMLVisitor.java
===================================================================
--- portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/XMLVisitor.java (rev 0)
+++ portal/branches/portalsession/component/common/src/main/java/org/exoplatform/commons/XMLVisitor.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.commons;
+
+import org.dom4j.Element;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class XMLVisitor
+{
+
+ public static Element build(Element parent, Object object)
+ {
+ Class<?> klass = object.getClass();
+
+ //
+ String name = klass.getSimpleName();
+ Element elt = parent.addElement(name);
+
+ // Add all relevant attributes via reflection
+ for (Class<?> current = klass;current != Object.class;current = current.getSuperclass())
+ {
+ for (Field field : current.getDeclaredFields())
+ {
+ Class fieldClass = field.getType();
+ int modifiers = field.getModifiers();
+ if (!Modifier.isStatic(modifiers) && !(Modifier.isTransient(modifiers)))
+ {
+ field.setAccessible(true);
+ Object o = null;
+ try
+ {
+ o = field.get(object);
+ }
+ catch (IllegalAccessException ignore)
+ {
+ }
+
+ //
+ if (o != null)
+ {
+ if ((fieldClass.isPrimitive() || fieldClass == String.class))
+ {
+ String value = o.toString();
+ elt.addAttribute(field.getName(), value);
+ }
+ else if (isPrinted(field))
+ {
+ if (o instanceof Iterable<?>)
+ {
+ Element childrenElt = null;
+ for (Object child : (Iterable)o)
+ {
+ if (childrenElt == null)
+ {
+ childrenElt = elt.addElement(field.getName());
+ }
+ build(childrenElt, child);
+ }
+ }
+ else
+ {
+ Element composedElt = elt.addElement(field.getName());
+ build(composedElt, o);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //
+ return elt;
+ }
+
+ private static boolean isPrinted(Field field)
+ {
+ return field.getAnnotation(Visit.class) != null || isFollowed(field.getType());
+ }
+
+ private static boolean isFollowed(Class<?> clazz)
+ {
+ return clazz != null && (clazz.getAnnotation(Visit.class) != null || isFollowed(clazz.getSuperclass()));
+ }
+}
Modified: portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
--- portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2009-12-31 13:16:36 UTC (rev 1152)
+++ portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.Visit;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.resolver.ResourceResolver;
import org.exoplatform.web.application.Parameter;
@@ -38,6 +39,7 @@
* Created by The eXo Platform SAS
* May 7, 2006
*/
+@Visit
abstract public class UIComponent
{
Modified: portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
===================================================================
--- portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2009-12-31 13:16:36 UTC (rev 1152)
+++ portal/branches/portalsession/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.commons.Visit;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -37,6 +38,7 @@
public class UIContainer extends UIComponent
{
+ @Visit
private List<UIComponent> children;
public void visit() throws Exception
Modified: portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java
===================================================================
--- portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java 2009-12-31 13:16:36 UTC (rev 1152)
+++ portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/application/PortalStateManager.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -19,6 +19,12 @@
package org.exoplatform.portal.application;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+import org.exoplatform.commons.XMLVisitor;
import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.SessionManagerContainer;
@@ -33,9 +39,12 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIComponent;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
@@ -58,6 +67,19 @@
@SuppressWarnings("unchecked")
public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception
{
+ UIApplication app = _restoreUIRootComponent(context);
+ Document document = DocumentHelper.createDocument();
+ Element rootElt = document.addElement(context.getApplication().getApplicationId());
+ XMLVisitor.build(rootElt, app);
+ OutputFormat format = OutputFormat.createPrettyPrint();
+ format.setIndentSize(1);
+ XMLWriter writer = new XMLWriter(System.out, format);
+ writer.write(document);
+ return app;
+ }
+
+ private UIApplication _restoreUIRootComponent(WebuiRequestContext context) throws Exception
+ {
context.setStateManager(this);
WebuiApplication app = (WebuiApplication)context.getApplication();
Modified: portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2009-12-31 13:16:36 UTC (rev 1152)
+++ portal/branches/portalsession/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2010-01-01 14:50:44 UTC (rev 1153)
@@ -108,6 +108,11 @@
private UIComponent maximizedUIComponent;
+ public UIPortal()
+ {
+ System.out.println("Constructed portal");
+ }
+
public String getStorageId()
{
return storageId;
14 years, 12 months