Author: thomas.heute(a)jboss.com
Date: 2009-11-30 16:03:01 -0500 (Mon, 30 Nov 2009)
New Revision: 874
Added:
portal/trunk/docs/reference-guide/
portal/trunk/docs/reference-guide/en/
portal/trunk/docs/reference-guide/en/Introduction.xml
portal/trunk/docs/reference-guide/en/images/
portal/trunk/docs/reference-guide/en/images/Dashboard.png
portal/trunk/docs/reference-guide/en/images/EditImportedOnline.png
portal/trunk/docs/reference-guide/en/images/EditImportedWebDAV.png
portal/trunk/docs/reference-guide/en/images/Frontpage.png
portal/trunk/docs/reference-guide/en/images/Import.png
portal/trunk/docs/reference-guide/en/images/Imported.png
portal/trunk/docs/reference-guide/en/images/Liste.png
portal/trunk/docs/reference-guide/en/images/New.png
portal/trunk/docs/reference-guide/en/images/image3.jpg
portal/trunk/docs/reference-guide/en/images/portal-change-skin.png
portal/trunk/docs/reference-guide/en/images/portal.gif
portal/trunk/docs/reference-guide/en/master.xml
portal/trunk/docs/reference-guide/en/modules/
portal/trunk/docs/reference-guide/en/modules/Configuration.xml
portal/trunk/docs/reference-guide/en/modules/Development.xml
portal/trunk/docs/reference-guide/en/modules/Gadgets.xml
portal/trunk/docs/reference-guide/en/modules/Integration.xml
portal/trunk/docs/reference-guide/en/modules/Introduction.xml
portal/trunk/docs/reference-guide/en/modules/Portlets.xml
portal/trunk/docs/reference-guide/en/modules/_archive/
portal/trunk/docs/reference-guide/en/modules/_archive/integration/
portal/trunk/docs/reference-guide/en/modules/_orphans/
portal/trunk/docs/reference-guide/en/modules/account/
portal/trunk/docs/reference-guide/en/modules/configuration/
portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/development/
portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml
portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml
portal/trunk/docs/reference-guide/en/modules/development/Dynamic_Layouts.xml
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml
portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
portal/trunk/docs/reference-guide/en/modules/development/Right_To_Left_Framework.xml
portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml
portal/trunk/docs/reference-guide/en/modules/development/XML_Resource_Bundles.xml
portal/trunk/docs/reference-guide/en/modules/gadgets/
portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml
portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml
portal/trunk/docs/reference-guide/en/modules/gadgetsAdmin/
portal/trunk/docs/reference-guide/en/modules/language/
portal/trunk/docs/reference-guide/en/modules/portal/
portal/trunk/docs/reference-guide/en/modules/portlets/
portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml
portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml
portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml
portal/trunk/docs/reference-guide/en/modules/portletsUser/
portal/trunk/docs/reference-guide/en/modules/security/
portal/trunk/docs/reference-guide/en/modules/terms/
portal/trunk/docs/reference-guide/pom.xml
Log:
Adding reference guide
Added: portal/trunk/docs/reference-guide/en/Introduction.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/Introduction.xml (rev 0)
+++ portal/trunk/docs/reference-guide/en/Introduction.xml 2009-11-30 21:03:01 UTC (rev
874)
@@ -0,0 +1,65 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+-->
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
"http://www.oasis-open.org/docbook/sgml/4.4/docbookx.dtd">
+<chapter>
+ <title>Introduction</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Frontpage.png" scalefit="1" />
+ </imageobject>
+ </mediaobject>
+
+ <para>GateIn portal is a merge of two mature projects that have
+ been around for a while, JBoss Portal and eXo Portal. It takes the
+ best of both into a single new project. The aim is to provide both an
+ intuitive portal to use as-is and a portal framework to build upon
+ depending on your needs.</para>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ GateIn homepage:
+ <ulink url="http://www.gatein.org">www.gatein.org</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn videos:
+ <ulink
url="http://www.jboss.org/gatein/videos.html">www.jboss.org/...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn documentation:
+ <ulink
url="http://www.jboss.org/gatein/documentation.html">www.jbo...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn downloads:
+ <ulink
url="http://www.jboss.org/gatein/downloads.html">www.jboss.o...
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</chapter>
Added: portal/trunk/docs/reference-guide/en/images/Dashboard.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/Dashboard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/EditImportedOnline.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/EditImportedOnline.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/EditImportedWebDAV.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/EditImportedWebDAV.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/Frontpage.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/Frontpage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/Import.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/Import.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/Imported.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/Imported.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/Liste.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/Liste.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/New.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/New.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/image3.jpg
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/image3.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/portal-change-skin.png
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/portal-change-skin.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/images/portal.gif
===================================================================
(Binary files differ)
Property changes on: portal/trunk/docs/reference-guide/en/images/portal.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: portal/trunk/docs/reference-guide/en/master.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/master.xml (rev 0)
+++ portal/trunk/docs/reference-guide/en/master.xml 2009-11-30 21:03:01 UTC (rev 874)
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+-->
+
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<book lang="en">
+ <bookinfo>
+ <title>GateIn Documentation</title>
+ <subtitle>GateIn</subtitle>
+ <releaseinfo>This is a very rough documentation issued from the merge,
+ content still has to be validated, we still hope that it can help the
+ beta testers. Thanks !</releaseinfo>
+
+ </bookinfo>
+ <toc />
+
+
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Introduction.xml" />
+ <!--
+ Table of content in Wiki Format <xi:include
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Portal_Manual.xml" />
+ -->
+
+ <!-- 1 Terms -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Terms.xml" />
+
+ <!--
+ Portal, Portlet, Navigation, Node, Gadget, Public mode and Private
+ mode, Permission levels, Workspace concept, Toolbar concept
+ -->
+
+ <!-- 4_Configuration -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Configuration.xml" />
+
+
+ <!-- 5_Security -->
+
+ <!-- Core/Security_Service -->
+ <!--
+ Outdated <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Security.xml" />
+ -->
+
+ <!-- 6_Integration -->
+
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Integration.xml" />
+
+ <!-- 7_SSO -->
+
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/SSO.xml" />
+
+
+ <!-- 8_Migration -->
+ <!--
+ Archived <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Migration_from_2-1_to_2-2.xml" /> <xi:include
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Migration_from_2-2_to_2-5.xml" /> <xi:include
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Export-Import_Portal_Configuration.xml" />
+ -->
+
+ <!-- 9_Technical_Foundations -->
+
+ <!-- Main/Overall_Architecture -->
+ <!-- Kernel/Inversion_of_Control -->
+ <!-- Portlet_Container -->
+ <!-- Java_Content_Repository -->
+ <!-- Web_Services -->
+ <!-- GateIn_Core -->
+ <!-- GateIn_Kernel -->
+
+ <!-- 10_Development_ -->
+
+ <!-- Main/Developers -->
+ <!--
http://docs.exoplatform.org -->
+ <!-- Products_Tech_Overview/Components_Registry -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Development.xml" />
+
+ <!-- Portlets -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Portlets.xml" />
+
+ <!-- Gadgets -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/Gadgets.xml" />
+
+ <!-- Single Sign On -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="modules/SSO.xml" />
+
+
+ <!--
+ 11_Support
+
http://www.exoplatform.com/portal/public/en/forum?portal:componentId=foru...
+
http://faq.exoplatform.com/ http://jira.exoplatform.org/browse/Portal
+ -->
+
+
+ <!-- Orphan from XWiki site -->
+ <chapter>
+ <title>Orphans chapters: TODO: move and integrate those</title>
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/_orphans/Setup_GadgetServer.xml" />
+ <!--
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/_orphans/Internationalization_Guidelines.xml" />
+ -->
+ </chapter>
+
+
+ <!--
+ Deprecated <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Advanced_User_Guide.xml" /> <xi:include
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Create_a_predefined_Portal_Navigation.xml" />
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/RTL.xml" /> Was in HowTo <xi:include
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="modules/Skin_Config.xml" />
+ -->
+
+</book>
Added: portal/trunk/docs/reference-guide/en/modules/Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Configuration.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/Configuration.xml 2009-11-30 21:03:01 UTC
(rev 874)
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Configuration</title>
+ <xi:include href="configuration/IDM_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Default_Portal_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Portal_Navigation_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Predefined_User_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/User_Workspace_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include
href="configuration/Portal_Default_Permission_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- Kernel/Service_Configuration_for_Beginners --><!--
Kernel/Service_Configuration_in_Detail --><xi:include
href="configuration/Database_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Data_Injector_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!-- Core/LDAP_Configuration --><xi:include
href="configuration/Skin_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/JavaScript_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Dashboard_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Authentication_Token_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="configuration/Varnish_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</chapter>
+
Added: portal/trunk/docs/reference-guide/en/modules/Development.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Development.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/Development.xml 2009-11-30 21:03:01 UTC
(rev 874)
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Development">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Development</title>
+ <xi:include href="development/Portal_Lifecycle.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Right_To_Left_Framework.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Internationalization_Configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/XML_Resource_Bundles.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Dynamic_Layouts.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include
href="development/JavaScript_Inter_Application_Communication.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Upload_Component.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Ajax_Loading_Mask_Layer_Deactivation.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="development/Accessing_User_Profile.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</chapter>
+
Added: portal/trunk/docs/reference-guide/en/modules/Gadgets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Gadgets.xml (rev
0)
+++ portal/trunk/docs/reference-guide/en/modules/Gadgets.xml 2009-11-30 21:03:01 UTC (rev
874)
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Gadget_development">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Gadget development</title>
+ <xi:include href="gadgets/Gadgets.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="gadgets/Setup_a_Gadget_Server.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</chapter>
+
Added: portal/trunk/docs/reference-guide/en/modules/Integration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Integration.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/Integration.xml 2009-11-30 21:03:01 UTC
(rev 874)
@@ -0,0 +1,36 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Integration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Integration</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ <!--
+<xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="integration/Use_an_Existing_Portlet_Application.xml" />
+<xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="integration/Package_Gadgets.xml" />
+<xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="integration/JSF1_2_JBossPortletBridge_Richfaces.xml" />
+<xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="integration/JSF1_1_MyFaces_Spring.xml" />
+<xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="integration/Changing_GateIn_URL.xml" />
+ -->
+</chapter>
+
Added: portal/trunk/docs/reference-guide/en/modules/Introduction.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Introduction.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/Introduction.xml 2009-11-30 21:03:01 UTC
(rev 874)
@@ -0,0 +1,60 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Introduction">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Introduction</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Frontpage.png" format="PNG"
scalefit="1" />
+ </imageobject>
+ </mediaobject>
+ <para>
+ Enterprise Portal Platform 5.0 comes from a merge of two mature projects; the JBoss
Portal and the eXo Portal. It takes the best of both into a single new project. The aim is
to provide both an intuitive portal to use as-is and a portal framework to build upon
depending on your needs.
+ </para>
+ <section id="sect-Reference_Guide-Introduction-Links">
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ GateIn homepage: <ulink
url="http://www.gatein.org">www.gatein.org</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn videos: <ulink
url="http://www.jboss.org/gatein/videos.html">www.jboss.org/...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn documentation: <ulink
url="http://www.jboss.org/gatein/documentation.html">www.jbo...
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn downloads: <ulink
url="http://www.jboss.org/gatein/downloads.html">www.jboss.o...
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+</chapter>
+
Added: portal/trunk/docs/reference-guide/en/modules/Portlets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/Portlets.xml (rev
0)
+++ portal/trunk/docs/reference-guide/en/modules/Portlets.xml 2009-11-30 21:03:01 UTC (rev
874)
@@ -0,0 +1,32 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Reference_Guide-Portlet_development">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Portlet development</title>
+ <xi:include href="portlets/WebUI.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/AJAX_in_GateIn_Framework.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Groovy_Templates.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Create_a_WebUI_Portlet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Portlet_Lifecycle.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="portlets/Sample_Basic_Portlet.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</chapter>
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Authentication_Token_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Authentication_Token_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Authentication Token Configuration</title>
+ <section
id="sect-Reference_Guide-Authentication_Token_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ What token services are.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Implement a token service for using in GateIn portal.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Configure a token service with a token's life-time.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-Authentication_Token_Configuration-What_is_token_service">
+ <title>What is token service</title>
+ <para>
+ Token service is used in authentication.
+ </para>
+ <para>
+ Using token helps preventing information such as user name, password into user request
so the system will become more secure.
+ </para>
+ <para>
+ Token service provides the way to manipulate tokens such as create, delete, retrieve,
clean ... Token service also defines the life-time of token. After the life-time, token
has no more effect. The life-time definition must be configured.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Authentication_Token_Configuration-Implement_token_services_API">
+ <title>Implement token service's API</title>
+ <para>
+ All token services used in GateIn portal's authentication must be a subclass of an
abstract class <emphasis role="bold">AbstractTokenService</emphasis>
. So they must have these following methods:
+ </para>
+
+<programlisting>
+ public Token getToken(String id) throws PathNotFoundException,
+ RepositoryException;
+ public Token deleteToken(String id) throws PathNotFoundException,
+ RepositoryException;
+ public String[] getAllTokens();
+ public long getNumberTokens() throws Exception;
+ public String createToken(Credentials credentials) throws
+ IllegalArgumentException,NullPointerException;
+ public Credentials validateToken(String tokenKey, boolean remove) throws
+ NullPointerException;
+</programlisting>
+ <para>
+ These methods show how the token-service manipulates its tokens.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Authentication_Token_Configuration-Configure_token_services">
+ <title>Configure token services</title>
+ <para>
+ Token services configuration is also known as specifying the life-time of token in the
configuration file. The token service is configured as a portal component.
+ </para>
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+<component>
+
<key>org.exoplatform.web.security.security.CookieTokenService</key>
+
<type>org.exoplatform.web.security.security.CookieTokenService</type>
+ <init-params>
+ <values-param>
+ <name>tokenTimeout</name>
+ <value>jcr-token</value>
+ <value>7</value>
+ <value>DAY</value>
+ </values-param>
+ </init-params>
+</component>
+</programlisting>
+ <para>
+ In this example, <emphasis>CookieTokenService</emphasis> is a subclass of
<emphasis role="bold">AbstractTokenService</emphasis> so it has a
property which specifies <emphasis>how long token can live</emphasis>.
+ </para>
+ <para>
+ Service will initiate this property by looking for an init-param named as
"<emphasis role="bold">service.configuration</emphasis>".
This property must have 3 values (service's name, amount of time, unit of time). In
this case, we can see the service's name is "jcr-token", the token's
expiration time is a week.
+ </para>
+ <para>
+ At this time, GateIn Portal supports <emphasis>four</emphasis> timing
units: <emphasis role="bold">SECOND</emphasis>, <emphasis
role="bold">MINUTE</emphasis>, <emphasis
role="bold">HOUR</emphasis> and <emphasis
role="bold">DAY</emphasis>.
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Dashboard_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,66 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Dashboard_configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU Lesser
+ General Public License as published by the Free Software Foundation;
+ either version 2.1 of the License, or (at your option) any later
+ version. This software is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details. You should have
+ received a copy of the GNU Lesser General Public License along with
+ this software; if not, write to the Free Software Foundation, Inc., 51
+ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ site:
http://www.fsf.org.
+ --><title>Dashboard configuration</title>
+ <section
id="sect-Reference_Guide-Dashboard_configuration-Parameters_in_edit_mode">
+ <title>Parameters (in edit mode)</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Dashboard_configuration-owner">
+ <title>owner</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ if empty, everyone share the same dashboard and can edit it
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if set to <emphasis>CURRENTUSER</emphasis> , every user has his own
dashboard
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if set to a username, everyone will see the dashboard of this person
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Dashboard_configuration-isPrivate">
+ <title>isPrivate</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ if set to 1, only the owner of the dashboard can edit it
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if set to 0, everyone can edit it
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Data_Injector_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,189 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Data_Injector_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --> <title>Data Injector Configuration</title>
+ <section
id="sect-Reference_Guide-Data_Injector_Configuration-Data_Injector">
+ <title>Data Injector</title>
+ <para>
+ <emphasis>Data-injector</emphasis> is an utility to initialize enterprise
data for Portal. It is packed in a .jar and deployed under $TOMCATHOME/lib. It is started
automatically when Tomcat starts.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Data_Injector_Configuration-OrganizationInitializer">
+ <title>OrganizationInitializer</title>
+ <para>
+ <emphasis>OrganizationInitializer</emphasis> is the service that allows
creating a large organization with many groups and users. It also creates portal
navigation and page(s) for each group, each user.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Data_Injector_Configuration-Service_configuration_file">
+ <title>Service configuration file</title>
+
+<programlisting>
+<configuration>
+ <component>
+
<key>org.exoplatform.portal.initializer.organization.OrganizationInitializer</key>
+
<type>org.exoplatform.portal.initializer.organization.OrganizationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>auto.create.group.page.navigation</name>
+ <description>true or false</description>
+ <value>true</value>
+ </value-param>
+
+ <value-param>
+ <name>auto.create.user.page.navigation</name>
+ <description>number of pages per user</description>
+ <value>10</value>
+ </value-param>
+ <object-param>
+ <name>organization</name>
+ <description>description</description>
+ <object
type="org.exoplatform.portal.initializer.organization.OrganizationConfig">
<field name="groups">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
type="org.exoplatform.portal.initializer.organization.OrganizationConfig$GroupsConfig">
<field name="group">
+ <object
type="org.exoplatform.services.organization.OrganizationConfig$Group">
+ <field
name="name"><string>province</string></field>
+ <field
name="parentId"><string>/africa/tanzania</string></field>
+ <field
name="description"><string>Tanzania's
province</string></field>
+ <field
name="label"><string>Province</string></field>
+ </object>
+ </field>
+ <field
name="from"><string>1</string></field>
+ <field
name="to"><string>10</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="users">
+ <collection type="java.util.ArrayList">
+
+ <value>
+ <object
type="org.exoplatform.portal.initializer.organization.OrganizationConfig$UsersConfig">
+ <field name="user">
+ <object
type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field
name="userName"><string>user</string></field>
+ <field
name="password"><string>GateInPlatform</string></field>
+ <field
name="firstName"><string>First-Name</string></field>
+ <field
name="lastName"><string>Last-Name</string></field>
+ <field
name="email"><string>exo@localhost</string></field>
+ <field
name="groups"><string>member:/africa</string></field>
+ </object>
+ </field>
+ <field
name="from"><string>0</string></field>
+ <field
name="to"><string>9</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+</configuration>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_Group">
+ <title>Parameters for Group</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>name</emphasis>: The name of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>parentId</emphasis>: The id of parent group. If the parent id
is null, it means that the group is at the first level. If parent groups do not exist, it
will be created automatically.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>description</emphasis>: The description of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>label</emphasis>: The label of group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>from and to</emphasis>: This group can be cloned to may copies
and each copy is marked a number from!images/number.png!images/ to!images/ number.png!.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-Data_Injector_Configuration-Parameters_for_User">
+ <title>Parameters for User</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>userName</emphasis>: The ID of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>password</emphasis>: The password of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>firstName</emphasis>: The first name of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>lastName</emphasis>: The last name of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>email</emphasis>: The email of user.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>groups</emphasis>: The list of groups that user join with
membership type
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>from and to</emphasis>: This user can be cloned to may copies
and each copy is marked a number from!images/number.png!images/ to!images/ number.png!.
With this configuration we can create a range of users and put them to various groups and
other range to other groups.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The " <emphasis>auto.create.group.page.navigation</emphasis> "
Parameter Value is true or false. If TRUE it automatically create portal navigation and
page for each group. If FALSE it does not create portal navigation and page for each
group.
+ </para>
+ <para>
+ The "<emphasis>auto.create.user.page.navigation</emphasis> "
Parameter Value is number of pages that automatically created for each user.
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Database_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,201 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Database_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Database Configuration</title>
+ <section id="sect-Reference_Guide-Database_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ GateIn Portal has two different database dependencies. One is the Hibernate service
configuration, which depends on the the Hibernate and c3p0 projects. The other database
dependency is Java content repository (JCR) service, which depends on the native JDBC API
and it can integrate with any existing datasource implementation.
+ </para>
+ <para>
+ When you change the database configuration for the first time, GateIn will
automatically generate the proper schema (assuming that the database user has the
appropriate permissions).
+ </para>
+ <para>
+ Currently (as of GateIn r23239 or GateIn Portal 2.5 and later), GateIn assumes the
default encoding for your database is <code>latin1</code>. You
will need to change this parameter for your database in order to work properly.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Database_Configuration-DB_and_datasource_configuration">
+ <title>DB and datasource configuration</title>
+ <para>
+ You can find the database configuration in the
portal/WEB-INF/conf/database/database-configuration.xml file (located in your application
server's web application directory).
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<configuration>
+ [...]
+ <component>
+
<key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+
<type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.show_sql"
value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
+ <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit"
value="true"/>
+ <property name="hibernate.connection.username"
value="sa"/>
+ <property name="hibernate.connection.password"
value=""/>
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size"
value="5"/>
+ <property name="hibernate.c3p0.max_size"
value="20"/>
+ <property name="hibernate.c3p0.timeout"
value="1800"/>
+ <property name="hibernate.c3p0.max_statements"
value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+ <external-component-plugins>
+
<target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+
<type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName"
value="org.hsqldb.jdbcDriver"/>
+ <property name="url"
value="jdbc:hsqldb:file:../temp/data/exodb"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ [...]
+</configuration>
+</programlisting>
+ <para>
+ The first component configuration is for the Hibernate service. You can enter any
additional properties in a hibernate.properties file, but GateIn will override
hibernate.properties with values read in from this configuration file.
+ </para>
+ <para>
+ The second component configuration is for the JCR datasource. The
InitialContextInitializer component will load the factory class, use the factory object to
create a datasource, and bind that datasource in the JNDI tree with the value of the
"bind-name" parameter. If you want to change the bind-name, for example
"jdbcexo" to "myjdbc", you also need to change JCR repository
configuration in order that the service picks up the right datasource.
+ </para>
+ <para>
+ Make sure you update the database connection properties and dialect for both of these
component configurations.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Database_Configuration-JCR_database_configuration">
+ <title>JCR database configuration</title>
+ <para>
+ There are two JCR configuration files that must be changed to support a different
database. In both files, <emphasis role="bold">edit the dialect (and the
data source name if necessary)</emphasis>.
+ </para>
+ <para>
+ The first file is portal/WEB-INF/conf/jcr/jcr-configuration.xml:
+ </para>
+
+<programlisting>[...]
+ <component>
+
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+
<value>war:/conf/jcr/repository-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="persisterClassName"
value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ <property name="sourceName" value="jdbcexo"/>
+ <property name="dialect" value="hsqldb"/>
+ </properties-param>
+ </init-params>
+ </component>
+[...]
+</programlisting>
+ <para>
+ The second file is portal/WEB-INF/conf/jcr/repository-configuration.xml:
+ </para>
+
+<programlisting>[...]
+ <workspaces>
+ <workspace name="system"
auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="*:/platform/administrators
read;*:/platform/administrators add_node;*:/platform/administrators
set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName"
value="jdbcexo"/>
+ <property name="dialect" value="hsql"/>
+ <!-- property name="db-type" value="mysql"/
-->
+ <property name="multi-db"
value="false"/>
+ <property name="update-storage"
value="true"/>
+ <property name="max-buffer-size"
value="204800"/>
+ <property name="swap-directory"
value="../temp/swap/system"/>
+ </properties>
+[...]
+ </workspace>
+ <workspace name="collaboration"
auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="any read;*:/platform/administrators
read;*:/platform/administrators add_node;*:/platform/administrators
set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName"
value="jdbcexo"/>
+ <property name="dialect"
value="hsqldb"/>
+ <property name="multi-db"
value="false"/>
+ <property name="update-storage"
value="true"/>
+ <property name="max-buffer-size"
value="204800"/>
+ <property name="swap-directory"
value="../temp/swap/collaboration"/>
+ </properties>
+[...]
+ </workspace>
+ <workspace name="backup"
auto-init-root-nodetype="nt:unstructured"
+ auto-init-permissions="any read;*:/platform/administrators
read;*:/platform/administrators add_node;*:/platform/administrators
set_property;*:/platform/administrators remove" >
+ <!-- for system storage -->
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="sourceName"
value="jdbcexo"/>
+ <property name="dialect" value="mysql"/>
+ <!-- property name="db-type" value="mysql"/
-->
+ <property name="multi-db"
value="false"/>
+ <property name="update-storage"
value="true"/>
+ <property name="max-buffer-size"
value="204800"/>
+ <property name="swap-directory"
value="../temp/swap/backup"/>
+ </properties>
+ </workspace>
+[...]
+ </workspaces>
+[...]
+</programlisting>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Default_Portal_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,66 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Default_Portal_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --> <title>Default Portal Configuration</title>
+ <section
id="sect-Reference_Guide-Default_Portal_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ default portal will be accessed by default when user doesn't specify the portal.
For example:
http://hostname:port/portal/. And the default portal be used for checking at
starting of tomcat to determine whether database is empty or not, too.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Default_Portal_Configuration-Configuration">
+ <title>Configuration</title>
+ <para>
+ Configuration file path :
"portal/WEB-INF/conf/portal/portal-configuration.xml"
+ </para>
+
+<programlisting> <component>
+
<key>org.exoplatform.portal.config.UserPortalConfigService</key>
+
<type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal
configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or
not</description>
+ <value>classic</value>
+ </value-param>
+ ..........
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+</programlisting>
+ <para>
+ You can see in the configuration above, we defined the classic as a default portal.
Notes that the definition should be as a initial parameter of the NewPortalConfigListener
component-plugin
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/IDM_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,243 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-JBoss_Identity_IDM_integration">
+ <title>JBoss Identity IDM integration</title>
+ <para>
+ GateIn by default uses JBoss Identity IDM component to persist identity information
(user, groups, memberships and etc.). While still legacy exo interfaces are used
(org.exoplatform.services.organization) for identity management the wrapper implementation
delegates to the JBoss Identity IDM framework. This section won't provide information
about JBoss Identity IDM and its configuration - please refer to proper project
documentation. It is important to fully understand concepts behind this framework design
before changing configuration
+ </para>
+ <para>
+ Identity model represented in 'org.exoplatform.services.organization'
interfaces and one used in JBoss Identity IDM have some major differences. JBoss Identity
IDM provides greater abstraction - for example it is possible for groups in IDM framework
to form memberships with many parents while GateIn model allows only pure tree like
membership structures - this requires recursive ID translation. Additionally GateIn
membership concept needs to be translated into IDM Role concept. Therefore JBoss Identity
IDM model is used in a limited way. All those translations are applied by the integration
layer
+ </para>
+ <section
id="sect-Reference_Guide-JBoss_Identity_IDM_integration-Configuration_files">
+ <title>Configuration files</title>
+ <para>
+ Main configuration file is <emphasis
role="bold">idm-configuration</emphasis>:
+ </para>
+
+<programlisting>
+
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+
<key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
+
<type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>config</name>
+
<value>war:/conf/organization/idm-config.xml</value>
+ </value-param>
+ <values-param>
+ <name>hibernate.annotations</name>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
+
<value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ </values-param>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <property name="hibernate.hbm2ddl.auto"
value="update"/>
+ <property name="hibernate.current_session_context_class"
value="thread"/>
+ <property name="hibernate.show_sql"
value="false"/>
+ <property name="hibernate.cglib.use_reflection_optimizer"
value="true"/>
+ <property name="hibernate.connection.url"
value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit"
value="true"/>
+ <property name="hibernate.connection.username"
value="sa"/>
+ <property name="hibernate.connection.password"
value=""/>
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size"
value="5"/>
+ <property name="hibernate.c3p0.max_size"
value="20"/>
+ <property name="hibernate.c3p0.timeout"
value="1800"/>
+ <property name="hibernate.c3p0.max_statements"
value="50"/>
+ <property name="hibernate.connection.provider_class"
value="org.hibernate.connection.C3P0ConnectionProvider" />
+ </properties-param>
+
+ </init-params>
+ </component>
+
+ <component>
+
<key>org.exoplatform.services.organization.OrganizationService</key>
+
<type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ </component>
+
+</configuration>
+</programlisting>
+ <para>
+ <emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis>
is a main entrypoint implementing <emphasis
role="bold">org.exoplatform.services.organization.OrganizationService</emphasis>
and is dependant on <emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMService</emphasis>
+ </para>
+ <para>
+ <emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</emphasis>
service has following options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">hibernate.properties</emphasis> -
(properties-para) - a list of hibernate properties used to create SessionFactory that will
be injected to JBoss Identity IDM configuration registry
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">hibernate.annotations</emphasis> -
(values-param) - list of annotated classes that will be added to hibernate configuration
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">hibernate.mappings</emphasis> -
(values-param) - list of xml files that will be added to hibernate configuration as
mapping files
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">config</emphasis> - (value-param) -
JBoss Identity IDM configuration file
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">jndiName</emphasis> - (value-param) - in
case 'config' parameter is not provided this will be used to perform JNDI lookup
for IdentitySessionFactory
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">PortalRealm</emphasis> - (value-param) -
name of a realm that should be used to obtain proper IdentitySession - default is
'PortalRealm'.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <emphasis
role="bold">org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</emphasis>
service has following options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">exoGroupTypeName</emphasis> -
(value-param) - Name of JBoss Identity IDM GroupType that will be used to store groups.
Default is 'EXO_GROUP_TYPE'
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">exoRootGroupName</emphasis> -
(value-param) - Name of JBoss Identity IDM Group that will be used as a root parent.
Default is 'EXO_ROOT_GROUP'
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">exoRootGroupTypeName</emphasis> -
(value-param) - Name of JBoss Identity IDM GroupType of a Group used as a parent root.
Default is 'EXO_GROUP_TYPE'
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">passwordAsAttribute</emphasis> -
(value-param) - (default false) - Specifies if password should be stored using JBoss
Identity IDM Credential object or as a plain attribute
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Additionally <emphasis
role="bold">JBossIDMOrganizationServiceImpl</emphasis> uses those
defaults to perform identity management operations
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ GateIn User interface properties fields are persisted in JBoss Identity IDM using
those attributes names: firstName, lastName, email, createdDate, lastLoginTime,
organizationId, password (if password is configured to be stored as attribute)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn Group interface properties fields are persisted in JBoss Identity IDM using
those attributes names: label, description
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GateIn MembershipType interface properties fields are persisted in JBoss Identity
IDM using those RoleType properties: description, owner, create_date, modified_date
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Sample JBoss Identity IDM configuration file is shown below. To understand all options
present in it please refer to the JBoss Identity IDM Reference Guide
+ </para>
+
+<programlisting>
+
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>PortalRealm</id>
+
<repository-id-ref>PortalRepository</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>PortalRepository</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+
<default-identity-store-id>HibernateStore</default-identity-store-id>
+
<default-attribute-store-id>HibernateStore</default-attribute-store-id>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>HibernateStore</id>
+
<class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+
<credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+
<name>hibernateSessionFactoryRegistryName</name>
+
<value>hibernateSessionFactory</value>
+ </option>
+ <option>
+
<name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+
<name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+
<name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+
<name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
+</programlisting>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/JavaScript_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Javascript_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Javascript Configuration</title>
+ <para>
+ Manaing Javascript scripts in an application like GateIn Platform is a critical part of
the configuration work if you want to get good response time.
+ </para>
+ <para>
+ Every portlet can have its own javscript code but in many cases it is more convenient
to reuse some existing shared libraries. For that reason, GateIn has a mechanism to easily
register the libraries that will be loaded when the first page will be rendered. To do so,
every WAR deployed in GateIn can register the js files thanks to a groovy script
"WEB-INF/conf/script/groovy/JavascriptScript.groovy". The next file is the one
you can find in the GateInResources.war
+ </para>
+
+<programlisting>JavascriptService.addJavascript("GateIn",
"/javascript/GateIn.js", ServletContext);
+/* Animation Javascripts */
+JavascriptService.addJavascript("GateIn.animation.ImplodeExplode",
"/javascript/GateIn/animation/ImplodeExplode.js", ServletContext);
+/* Application descriptor */
+JavascriptService.addJavascript("GateIn.application.ApplicationDescriptor",
"/javascript/GateIn/application/ApplicationDescriptor.js", ServletContext);
+/* CORE Javascripts */
+JavascriptService.addJavascript("GateIn.core.Utils",
"/javascript/GateIn/core/Util.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.DOMUtil",
"/javascript/GateIn/core/DOMUtil.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.Browser",
"/javascript/GateIn/core/Browser.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.MouseEventManager",
"/javascript/GateIn/core/MouseEventManager.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.UIMaskLayer",
"/javascript/GateIn/core/UIMaskLayer.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.Skin",
"/javascript/GateIn/core/Skin.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.DragDrop",
"/javascript/GateIn/core/DragDrop.js", ServletContext);
+JavascriptService.addJavascript("GateIn.core.TemplateEngine",
"/javascript/GateIn/core/TemplateEngine.js", ServletContext);
+/* Widget Javascripts */
+JavascriptService.addJavascript("GateIn.widget.UIWidget",
"/javascript/GateIn/widget/UIWidget.js", ServletContext);
+JavascriptService.addJavascript("GateIn.widget.UIAddWidget",
"/javascript/GateIn/widget/UIAddWidget.js", ServletContext);
+JavascriptService.addJavascript("GateIn.widget.UIExoWidget",
"/javascript/GateIn/widget/UIExoWidget.js", ServletContext);
+/* Desktop Javascripts */
+JavascriptService.addJavascript("GateIn.desktop.UIDockbar",
"/javascript/GateIn/desktop/UIDockbar.js", ServletContext);
+JavascriptService.addJavascript("GateIn.desktop.UIDesktop",
"/javascript/GateIn/desktop/UIDesktop.js", ServletContext);
+/* WebUI Javascripts */
+JavascriptService.addJavascript("GateIn.webui.UIItemSelector",
"/javascript/GateIn/webui/UIItemSelector.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIForm",
"/javascript/GateIn/webui/UIForm.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIPopup",
"/javascript/GateIn/webui/UIPopup.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIPopupSelectCategory",
"/javascript/GateIn/webui/UIPopupSelectCategory.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIPopupWindow",
"/javascript/GateIn/webui/UIPopupWindow.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIVerticalScroller",
"/javascript/GateIn/webui/UIVerticalScroller.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIHorizontalTabs",
"/javascript/GateIn/webui/UIHorizontalTabs.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIPopupMenu",
"/javascript/GateIn/webui/UIPopupMenu.js", ServletContext);
+JavascriptService.addJavascript("GateIn.webui.UIDropDownControl",
"/javascript/GateIn/webui/UIDropDownControl.js", ServletContext);
+/* Portal Javascripts */
+JavascriptService.addJavascript("GateIn.portal.PortalHttpRequest",
"/javascript/GateIn/portal/PortalHttpRequest.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIPortal",
"/javascript/GateIn/portal/UIPortal.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIWorkspace",
"/javascript/GateIn/portal/UIWorkspace.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIPortalControl",
"/javascript/GateIn/portal/UIPortalControl.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.PortalDragDrop",
"/javascript/GateIn/portal/PortalDragDrop.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIPortalNavigation",
"/javascript/GateIn/portal/UIPortalNavigation.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIMaskWorkspace",
"/javascript/GateIn/portal/UIMaskWorkspace.js", ServletContext);
+JavascriptService.addJavascript("GateIn.portal.UIExoStartMenu",
"/javascript/GateIn/portal/UIExoStartMenu.js", ServletContext);
+/* Desktop Javascripts 2 */
+JavascriptService.addJavascript("GateIn.desktop.UIWindow",
"/javascript/GateIn/desktop/UIWindow.js", ServletContext);
+</programlisting>
+ <para>
+ Note that even if the you register dedicated javascripts, they will be merged into a
single <literal>merged.js</literal> file when the server will load in order to
reduce the number of HTTP calls as seen in the home page source code:
+ </para>
+
+<programlisting> <script type="text/javascript"
src="/portal/javascript/merged.js"></script>
+</programlisting>
+ <para>
+ Although this optimization is useful for a production environment, you may find it
easier to deactivate this optimization while debugging your javascript. For that, you
simply need to set the java system property
<literal>exo.product.developing</literal> to
<literal>true</literal>. But if you <emphasis>want to see or use the
merged file</emphasis> you have to set this property to
<literal>false</literal>. You can pass the property as a JVM parameter with
the <literal>-D</literal> option in your
<literal>GateIn.sh</literal> or <literal>GateIn.bat</literal>
startup script: {code} EXO{code}
+ </para>
+ <para>
+ Every javascript file is referenced with a module name of type
"GateIn.core.DragDrop" which acts like a namespace. Inside the associated files,
global javascript functions are used following the same namespace convention:
+ </para>
+
+<programlisting>GateIn.core.DragDrop = new DragDrop() ;
+</programlisting>
+ <para>
+ It is also possible to use the GateIn.require() javascript method to lazy load and
evaluate some javascript code. This is quite useful from the portlet or widget
applications that will use this javascript only once. Otherwise, if the library is
reusable in several places it is better to reference it in the groovy file.
+ </para>
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Default_Permission_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,125 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section
id="sect-Reference_Guide-Portal_Default_Permission_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --> <title>Portal Default Permission Configuration</title>
+ <section
id="sect-Reference_Guide-Portal_Default_Permission_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ The permission configuration for the portal is defined in the file
portal/WEB-INF/conf/portal/portal-configuration.xml. The component UserACL is described
there along with other portal component configurations.
+ </para>
+ <para>
+ It defines 5 permissions types:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>super.user</emphasis>: The super user has all the rights on
the platform, by default this user is called root
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>portal.creator.groups</emphasis>: This list defines all groups
that will be able to manage the different portals, they also have the permission to create
new portals. The format is "membership:/group/subgroup".
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>navigation.creator.membership.type</emphasis>: Defines the
membership type of the group managers. The group managers have the permission to create
and edit group pages and they can modify the group navigation.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>guests.group</emphasis>: Contains the name of the group that
is used as guest group. Any anonymous user becomes automatically member of this group when
he enters the public pages.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>access.control.workspace</emphasis>: Defines the users that
have access to the control workspace. In the demo version the control workspace is
accessible only to 'root' and 'john'. They can expand/collapse the
workspace at the left hand side. The format is "membership:/group/subgroup", An
asterisk '' gives permission to all memberships.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+<programlisting> <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+ <value-param>
+ <name>super.user</name>
+ <description>administrator</description>
+ <value>root</value>
+ </value-param>
+
+ <value-param>
+ <name>portal.creator.groups</name>
+ <description>groups with membership type have permission to manage
portal</description>
+
<value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
+
+ <value-param>
+ <name>navigation.creator.membership.type</name>
+ <description>specific membership type have full permission with
group navigation</description>
+ <value>manager</value>
+ </value-param>
+ <value-param>
+ <name>guests.group</name>
+ <description>guests group</description>
+ <value>/platform/guests</value>
+ </value-param>
+ <value-param>
+ <name>access.control.workspace</name>
+ <description>groups with memberships that have the right to access
the User Control Workspace</description>
+
<value>*:/platform/administrators,*:/organization/management/executive-board</value>
+ </value-param>
+ </init-params>
+ </component>
+</programlisting>
+ <para>
+ 1 Overwrite Portal Default Permissions In GateIn Portal 2.5 and later the UserACL
component supports adding a PortalACLPlugin plugin that allows to overwrite portal default
permissions.
+ </para>
+
+<programlisting> <external-component-plugins>
+
<target-component>org.exoplatform.portal.config.UserACL</target-component>
+ <component-plugin>
+ <name>addPortalACLPlugin</name>
+ <set-method>addPortalACLPlugin</set-method>
+
<type>org.exoplatform.portal.config.PortalACLPlugin</type>
+ <description>setting some permission for
portal</description>
+ <init-params>
+ <values-param>
+ <name>access.control.workspace.roles</name>
+ <value>*:/platform/administrators</value>
+
<value>*:/organization/management/executive-board</value>
+ </values-param>
+ <values-param>
+ <name>portal.creation.roles</name>
+ <value>*:/platform/administrators</value>
+
<value>*:/organization/management/executive-board</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</programlisting>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Portal_Navigation_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,392 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Portal_Navigation_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Portal Navigation Configuration</title>
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ When a user logs in he sees three types of navigation tree:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Portal Navigation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Group Navigation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ User Navigation
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ they all are configured thanks to the usual XML configuration syntax in a file:
"portal/WEB-INF/conf/portal/portal-configuration.xml"
+ </para>
+
+<programlisting> <component>
+
<key>org.exoplatform.portal.config.UserPortalConfigService</key>
+
<type>org.exoplatform.portal.config.UserPortalConfigService</type>
+ <component-plugins>
+ <component-plugin>
+ <name>new.portal.config.user.listener</name>
+ <set-method>initListener</set-method>
+
<type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal
configuration</description>
+ <init-params>
+ <value-param>
+ <name>default.portal</name>
+ <description>The default portal for checking db is empty or
not</description>
+ <value>classic</value>
+ </value-param>
+ <object-param>
+ <name>portal.configuration</name>
+ <description>description</description>
+ <object
type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+
<value><string>classic</string></value>
+
<value><string>webos</string></value>
+ </collection>
+ </field>
+ <field
name="ownerType"><string>portal</string></field>
+ <field
name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object
type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+
<value><string>platform/administrators</string></value>
+
<value><string>platform/users</string></value>
+
<value><string>platform/guests</string></value>
+
<value><string>organization/management/executive-board</string></value>
+ </collection>
+ </field>
+ <field
name="ownerType"><string>group</string></field>
+ <field
name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>user.configuration</name>
+ <description>description</description>
+ <object
type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+
<value><string>root</string></value>
+
<value><string>john</string></value>
+
<value><string>marry</string></value>
+
<value><string>demo</string></value>
+ </collection>
+ </field>
+ <field
name="ownerType"><string>user</string></field>
+ <field
name="templateLocation"><string>war:/conf/portal</string></field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+</programlisting>
+ <para>
+ In the previous XML file we define, for the 3 navigation types, some sets of
predefined portal, groups or users that will have some XML files inside the war. Those
files will be used to create an initial navigation the first time the portal is launched.
That information will then be stored in the JCR and hence only modifiable from the portal
UI.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal_Navigation">
+ <title>Portal Navigation</title>
+ <para>
+ The portal navigation incorporates the pages that can be accessed even when the user
is not logged in (if the permission allow a public access). Several portal navigations are
used for example when a company has several trademarks and each trade would have its own
website.
+ </para>
+ <para>
+ The configuration of a portal called "classic" is made by providing 4 XML
files under the directory portal/WEBINF/conf/portal/portal/classic:
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Portal.xml">
+ <title>Portal.xml</title>
+ <para>
+ That file describes the layout and portlets that will be shown for all pages. Usually
the layout contains the banner, footer, menu, breadcrumbs portlets. Indeed, in GateIn,
every area is a portlet even the banner and footer which makes the platform extremely
configurable.
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <factory-id>office</factory-id>
+ <access-permissions>Everyone</access-permissions>
+
<edit-permission>*:/platform/administrators</edit-permission>
+ <creator>root</creator>
+
+ <portal-layout>
+ <application>
+
<instance-id>portal#classic:/web/BannerPortlet/banner</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ <application>
+
<instance-id>portal#classic:/web/NavigationPortlet/toolbar</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+ <application>
+
<instance-id>portal#classic:/web/BreadcumbsPortlet/breadcumbs</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+
+
+ <page-body> </page-body>
+
+ <application>
+
<instance-id>portal#classic:/web/FooterPortlet/footer</instance-id>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </portal-layout>
+
+</portal-config>
+</programlisting>
+ <para>
+ Even if not shown in the previous XML file, it is also possible to apply a nested
container that can also contain portlets. Containers are then responsible of the layout of
their children (row, column or tabs containers exist).
+ </para>
+ <para>
+ Each application references a portlet using the id
portal#{portalName}:/{portletWarName}/{portletName}/{uniqueId}
+ </para>
+ <para>
+ In order to define at which location GateIn Portal shall render the current page use
the page-body tag.
+ </para>
+ <para>
+ The defined classic portal is accessible to "Everyone" (that means it can be
accessed through the URL /portal/public/classic) but only members of the group
/platform/administrators can edit it.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Navigation.xml">
+ <title>Navigation.xml</title>
+ <para>
+ This file defines all the navigation nodes the portal will have. The syntax is simple
as we get nested node tags. Each node references a page that is defined in the next XML
file.
+ </para>
+ <para>
+ If the label #{} is used then it means the i18n mechanism is activated and that the
real label to render is taken from an associated properties file for the current locale.
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="UTF-8"?>
+<node-navigation>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <priority>1</priority>
+ <page-nodes>
+ <node>
+ <uri>home</uri>
+ <name>home</name>
+ <label>#{portal.classic.home}</label>
+
<page-reference>portal::classic::homepage</page-reference>
+ </node>
+ <node>
+ <uri>webexplorer</uri>
+ <name>webexplorer</name>
+ <label>#{portal.classic.webexplorer}</label>
+
<page-reference>portal::classic::webexplorer</page-reference>
+ </node>
+ </page-nodes>
+</node-navigation>
+</programlisting>
+ <para>
+ This navigation tree can have multiple views inside portlets such as the breadcrumbs
that render the current view node, the site map or the menu portlets.
+ </para>
+ <para>
+ +Warning+: For top nodes, the <emphasis
role="bold">uri</emphasis> and the <emphasis
role="bold">name</emphasis> of your navigation nodes must have the
<emphasis role="bold">same</emphasis> value. For the other nodes the
uri is composed like
<emphasis><uri>contentmanagement/fileexplorer</uri></emphasis>
where 'contentmanagement' is the name of the parent node and
'fileexplorer' the name of the node
(<emphasis><name>fileexplorer</name></emphasis>).
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Pages.xml">
+ <title>Pages.xml</title>
+ <para>
+ This XML file structure is very similar to portal.xml and it can also contain
container tags. Each application can decide if it wishes to render the portlet border, the
window state icons or the mode.
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<page-set>
+ <page>
+ <page-id>portal::classic::homepage</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>homepage</name>
+ <title>Home Page</title>
+ <access-permissions>Everyone</access-permissions>
+
<edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+
<instance-id>portal#classic:/web/HomePagePortlet/homepageportlet</instance-id>
+ <title>Home Page portlet</title>
+ <show-info-bar>false</show-info-bar>
+ <show-application-state>false</show-application-state>
+ <show-application-mode>false</show-application-mode>
+ </application>
+ </page>
+
+ <page>
+ <page-id>portal::classic::webexplorer</page-id>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+ <name>webexplorer</name>
+ <title>Web Explorer</title>
+
<access-permissions>*:/platform/users</access-permissions>
+
<edit-permission>*:/platform/administrators</edit-permission>
+ <application>
+
<instance-id>group#platform/users:/web/BrowserPortlet/WebExplorer</instance-id>
+ <title>Web Explorer</title>
+ <show-info-bar>false</show-info-bar>
+ </application>
+ </page>
+</page-set>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Portlet_preferences.xml">
+ <title>Portlet-preferences.xml</title>
+ <para>
+ Porlet instances can be associated with portlet-preferences that override the one
defined in the usual portlet.xml file of the portlet application WAR.
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<portlet-preferences-set>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+
<window-id>portal#classic:/web/BannerPortlet/banner</window-id>
+ <preference>
+ <name>template</name>
+
<value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+
<window-id>portal#classic:/web/NavigationPortlet/toolbar</window-id>
+ <preference>
+ <name>useAJAX</name>
+ <value>true</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+
<window-id>portal#classic:/web/FooterPortlet/footer</window-id>
+ <preference>
+ <name>template</name>
+
<value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+
+
+ <portlet-preferences>
+ <owner-type>portal</owner-type>
+ <owner-id>classic</owner-id>
+
<window-id>portal#classic:/web/GroovyPortlet/groovyportlet</window-id>
+ <preference>
+ <name>template</name>
+
<value>par:/groovy/groovy/webui/component/UIGroovyPortlet.gtmpl</value>
+ <read-only>false</read-only>
+ </preference>
+ </portlet-preferences>
+</portlet-preferences-set>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Group_Navigation">
+ <title>Group Navigation</title>
+ <para>
+ Group navigations are dynamically added (mounted) to the user navigation when he logs
in. This means that a user sees in his menu also all the pages that are assigned to the
groups to which he belongs to.
+ </para>
+ <para>
+ Here only 3 XML files are necessary: navigation.xml, pages.xml and
portlet-preferences.xml. The syntax is the same as for portal navigations.
+ </para>
+ <para>
+ The 3 files are located in the directory:
"portal/WEB-INF/conf/portal/group/group-name-path/" like for example
"portal/WEB-INF/conf/portal/group/platform/administrators/"
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-User_Navigation">
+ <title>User Navigation</title>
+ <para>
+ The user navigation is the set of nodes and pages that is owned by a user. You can see
that part as the user dashboard. The files needed are navigation.xml, pages.xml,
portlet-preferences.xml. You will also find gadgets.xml (formerly called widgets.xml)
which defines the gadgets (widgets) that will be located in the user workspace. The user
workspace is located at the left hand side, the access is restricted to some privileged
users, see <xref linkend="sect-Reference_Guide-Predefined_User_Configuration"
/>
+ </para>
+ <para>
+ Those files are located in the directory
"portal/WEB-INF/conf/portal/users/{userName}"
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<widgets>
+ <owner-type>user</owner-type>
+ <owner-id>root</owner-id>
+
+ <container id="Information">
+ <name>Information</name>
+ <description>Information's Description</description>
+ <application>
+
<instance-id>user#root:/GateInWidgetWeb/WelcomeWidget/WelcomeWidget1</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+
+ <application>
+
<instance-id>user#root:/GateInWidgetWeb/StickerWidget/StickerWidget</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+
+ <application>
+
<instance-id>user#root:/GateInWidgetWeb/InfoWidget/InfoWidget1</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+ </container>
+
+ <container id="Calendar">
+ <name>Calendar</name>
+ <description>Calendar's Description</description>
+ <application>
+
<instance-id>user#root:/GateInWidgetWeb/CalendarWidget/CalendarWidget</instance-id>
+ <application-type>GateInWidget</application-type>
+ </application>
+ </container>
+
+</widgets>
+</programlisting>
+ <para>
+ Note that when you develop a portal, we advise you to use the XML instead of the User
Interface as XML will allow you to provide a preconfigured package to your customer. But
as each time you start the server the first time, the XML files are stored in the JCR, it
will be necessary to remove the database (the jcr leverages a database). During the
development phase using tomcat it simply means to delete the directory: exo-tomcat/temp
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Navigation_Configuration-Tips">
+ <title>Tips</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Predefined_User_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,130 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Predefined_User_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --> <title>Predefined User Configuration</title>
+ <section
id="sect-Reference_Guide-Predefined_User_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ To specify the initial Organization configuration, the content of
<literal>portal.war:WEB-INF/conf/organization/organization-configuration.xml</literal>
should be edited. This file complies with the XML GateIn configuration schema. It lists
several configuration plugins.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_adding_users_groups_and_membership_types">
+ <title>Plugin for adding users, groups and membership types</title>
+ <para>
+ The plugin of type
<literal>org.exoplatform.services.organization.OrganizationDatabaseInitializer</literal>
specifies the list of users, groups and membership types to be created. The initialization
parameter named "checkDatabaseAlgorithm" determines how the creation is
triggered. Thus, the value "entry" means that each user, group and membership
listed in the configuration is checked each time GateIn is started. If not existing, it is
created. The value "empty" means that the whole list of preconfigured users,
groups and memberships is processed only if the database is empty.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Predefined_User_Configuration-Membership_types">
+ <title>Membership types</title>
+ <para>
+ The predefined membership types are specified in the "membershipType" field
of the "OrganizationConfig" plugin parameter. {code} <field
name="membershipType"> <collection
type="java.util.ArrayList"> <value> <object
type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
<field
name="type"><string>member</string></field>
<field name="description"><string>member membership
type</string></field> </object>
</value> <value> <object
type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
<field
name="type"><string>owner</string></field>
<field name="description"><string>owner membership
type</string></field> </object>
</value> <value> <object
type="org.exoplatform.services.organization.OrganizationConfig$MembershipType">
<field name="type"><string>valid!
ator</string></field> <field
name="description"><string>validator membership
type</string></field> </object>
</value> </collection> </field> {code}
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Predefined_User_Configuration-Groups">
+ <title>Groups</title>
+ <para>
+ The predefined groups are specified in the "group" field of the
"OrganizationConfig" plugin parameter. {code} <field
name="group"> <collection
type="java.util.ArrayList"> <value> <object
type="org.exoplatform.services.organization.OrganizationConfig$Group">
<field
name="name"><string>portal</string></field>
<field
name="parentId"><string></string></field>
<field
name="type"><string>hierachy</string></field>
<field name="description"><string>the /portal
group</string></field> </object>
</value> <value> <object
type="org.exoplatform.services.organization.OrganizationConfig$Group">
<field
name="name"><string>community</string></field>
<field
name="parentId"><string>/portal</string></field>
<field
name="type"><string>hierachy</string></field>
<field name="desc!
ription"><string>the /portal/community
group</string></field> </object>
</value> ... </collection> </field> {code}
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Predefined_User_Configuration-Users">
+ <title>Users</title>
+ <para>
+ The predefined users are specified in the "membershipType" field of the
"OrganizationConfig" plugin parameter.
+ </para>
+
+<programlisting> <field name="user">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field
name="userName"><string>root</string></field>
+ <field
name="password"><string>exo</string></field>
+ <field
name="firstName"><string>root</string></field>
+ <field
name="lastName"><string>root</string></field>
+ <field
name="email"><string>exoadmin@localhost</string></field>
+ <field
name="groups"><string>member:/admin,member:/user,owner:/portal/admin</string></field>
+ </object>
+ </value>
+ <value>
+ <object
type="org.exoplatform.services.organization.OrganizationConfig$User">
+ <field
name="userName"><string>exo</string></field>
+ <field
name="password"><string>exo</string></field>
+ <field
name="firstName"><string>site</string></field>
+ <field
name="lastName"><string>site</string></field>
+ <field
name="email"><string>exo@localhost</string></field>
+ <field
name="groups"><string>member:/user</string></field>
+ </object>
+ </value>
+ ...
+ </collection>
+ </field>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Predefined_User_Configuration-Plugin_for_monitoring_user_creation">
+ <title>Plugin for monitoring user creation</title>
+ <para>
+ The plugin of type
<literal>org.exoplatform.services.organization.impl.NewUserEventListener</literal>
specifies which groups should join all newly created users. It notably specifies the
groups and memberships to be used. It also specifies a list of users that should be
excepted.
+ </para>
+
+<programlisting> <component-plugin>
+ <name>new.user.event.listener</name>
+ <set-method>addListenerPlugin</set-method>
+
<type>org.exoplatform.services.organization.impl.NewUserEventListener</type>
+ <description>this listener assign group and membership to a new
created user</description>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <description>description</description>
+ <object
type="org.exoplatform.services.organization.impl.NewUserConfig">
+ <field name="group">
+ <collection type="java.util.ArrayList">
+ <value>
+ <object
type="org.exoplatform.services.organization.impl.NewUserConfig$JoinGroup">
+ <field
name="groupId"><string>/user</string></field>
+ <field
name="membership"><string>member</string></field>
+ </object>
+ </value>
+ </collection>
+ </field>
+ <field name="ignoredUser">
+ <collection type="java.util.HashSet">
+
<value><string>exo</string></value>
+
<value><string>root</string></value>
+
<value><string>company</string></value>
+
<value><string>community</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+</programlisting>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Skin_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,593 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Skin_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Skin Configuration</title>
+ <section id="sect-Reference_Guide-Skin_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ GateIn provides support for skinning the entire portal User Interface (UI) including
your own portlets. Skins are designed to help you pack and reuse common graphic
resources.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Skin_Configuration-Skin_Switching">
+ <title>Skin Switching</title>
+ <para>
+ Skins can be switched dynamically at runtime by the <emphasis>Skin
Settings</emphasis> action in <emphasis> "User Workspace"
</emphasis> <!-- <link linkend="User Workspace">User
Workspace</link> --> .
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/portal-change-skin.png"
format="PNG" />
+ </imageobject>
+ </mediaobject>
+ <para>
+ When you switch, the whole portal will be repainted and new styles will be applied to
the UI.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-Skins_in_Page_Markups">
+ <title>Skins in Page Markups</title>
+ <para>
+ An GateIn skin contains css styles for GateIn portal's components but also shares
components that may be reused in portlets. When GateIn generates a portal page markup, it
inserts stylesheet links in the page's <literal>head</literal> tag.
+ </para>
+
+<programlisting><head>
+...
+<link id="CoreSkin" rel="stylesheet" type="text/css"
href="/GateInResources/skin/Stylesheet.css" />
+<link id="web_FooterPortlet" rel="stylesheet"
type="text/css" href=
"/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css"
/>
+<link id="web_NavigationPortlet" rel="stylesheet"
type="text/css" href=
"/web/skin/portal/webui/component/UINavigationPortlet/DefaultStylesheet.css"
/>
+<link id="web_HomePagePortlet" rel="stylesheet"
type="text/css" href=
"/portal/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css"
/>
+<link id="web_BannerPortlet" rel="stylesheet"
type="text/css" href=
"/web/skin/portal/webui/component/UIBannerPortlet/DefaultStylesheet.css"
/>
+...
+</head>
+</programlisting>
+ <para>
+ In the snipped code above, you can see two types of links :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Portal skin stylesheet (<literal>id="CoreSkin"</literal>).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Portlets skin stylesheets (all others) : each portlet within the page may contribute
its own styles.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Skin_Configuration-Types_of_Styles">
+ <title>Types of Styles</title>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ portal skin is typically made of 3 types of styles:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Portlet themes : decorations for portlet windows.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Portal styles : default styles for html tags (ex div,th,td...) + the portal UI
including the sidebar and portal admin screens.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Shared styles : GateIn WebUI components styles are reused among different GateIn
portlets.
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ This is revealed easily by the main portal skin stylesheets. For example <emphasis
role="bold">/GateInVistaSkin/skin/Stylesheet.css</emphasis>
+ </para>
+
+<programlisting>{code} @import
url(/GateInResources/skin/PortletThemes/Stylesheet.css) ; @import
url(VistaSkin/portal/webui/component/UIPortalApplicationSkin.css) ; @import
url(VistaSkin/webui/component/Stylesheet.css) ; {code}
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Skin_Configuration-Portlet_Styles">
+ <title>Portlet Styles</title>
+ <para>
+ Portlets often require additionnal styles that may not be defined by the portal skin.
GateIn allows portlets to define additional stylesheets for each portlet and will append
the corresponding <literal>link</literal> tags to the
<literal>head</literal>.
+ </para>
+ <para>
+ The link ID will be of the form
{portletAppName}{}<literal>$$<literal>PortletName</literal>. For
example: <literal>ContentPortlet</literal> in
<literal>content.war</literal>, will give
<parameter>id="content</parameter>ContentPortlet"</literal>
+ </para>
+ <para>
+ TODO: give some rules to follow in order to avoid overriding portal styles
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-How_to_Configure_a_Portal_Skin">
+ <title>How to Configure a Portal Skin</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Skin_Configuration-SkinService">
+ <title>SkinService</title>
+ <para>
+ The <ulink
url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/web...
is an GateIn service that manages portal skin, portlet styles and portlet themes (windows
borders). The code snippet below is an excerpt of the API offered by this service.
+ </para>
+
+<programlisting> /**
+ * Register the stylesheet for a portal Skin.
+ * @param module skin module identifier
+ * @param skinName skin name
+ * @param cssPath path uri to the css file. This is relative to the root context, use
leading '/'
+ * @param scontext the webapp's {@link ServletContext}
+ */
+ public void addPortalSkin(String module, String skinName, String cssPath,
ServletContext scontext) {
+ [...]
+ }
+ /**
+ * Register a portlet stylesheet for a Skin.
+ * @param module skin module. Typically of the form
'portletAppName/portletName' .
+ * @param skinName Name of the skin
+ * @param cssPath path uri to the css file. This is relative to the root context, use
leading '/'
+ * @param scontext the webapp's {@link ServletContext}
+ */
+ public void addSkin(String module, String skinName, String cssPath, ServletContext
scontext) {
+ [...]
+ }
+ /**
+ * Get a skin configuration for a given Skin
+ * @param module skin module such as registered in {@link #addSkin(String, String,
String, ServletContext)}
+ * @param skinName skin name
+ * @return the skin configuration or, if not found try to find the default skin
+ */
+ public SkinConfig getSkin(String module, String skinName) {
+ [...]
+ }
+ /**
+ * Register multiple portlet themes
+ * @param categoryName portlet theme category
+ * @param themesName names of the themes
+ */
+ public void addTheme(String categoryName, List<String> themesName) {
+ [...]
+ }
+</programlisting>
+ <para>
+ Use the skin service to register your own portal skins, portlet styles and portlet
themes.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-SkinConfigListener">
+ <title>SkinConfigListener</title>
+ <para>
+ GateIn provides a servlet listener that allows you to register your own skins and
styles when your webapp starts up. Your first step is to add the listener to your portlet
app <literal>web.xml</literal>.
+ </para>
+
+<programlisting> <web-app>
+ [::]
+ <listener>
+
<listener-class>org.exoplatform.portal.webui.skin.SkinConfigListener</listener-class>
+ </listener>
+ [::]
+ </web-app>
+</programlisting>
+ <para>
+ 1.1 SkinConfigScript.groovy
+ </para>
+ <para>
+ The <tt>SkinListener</tt> looks for the groovy script file
located in your war under:
<filename>/WEB-INF/conf/script/groovy/SkinConfigScript.groovy</filename>
+ </para>
+ <para>
+ In this script, you have full access to the
<tt>SkinService</tt> and
<tt>ServletContext</tt> which are bound as scripting variables
under the same name. As an example, take a look at the following script. It can be found
in the <tt>GateInResources.war</tt> and is used by GateIn to
register the <tt>Default</tt> portal skin and some portlet
themes.
+ </para>
+
+<programlisting>SkinService.addPortalSkin("CoreSkin","Default",
"/GateInResources/skin/Stylesheet.css", ServletContext);
+SkinService.addTheme("Simple",
["SimpleBlue","SimpleViolet","SimpleOrange","SimplePink","SimpleGreen"]);
+SkinService.addTheme("RoundConer",
["RoundConerBlue","RoundConerViolet","RoundConerOrange","RoundConerPink","RoundConerGreen"]);
+SkinService.addTheme("Shadow",
["ShadowBlue","ShadowViolet","ShadowOrange","ShadowPink","ShadowGreen"]);
+SkinService.addTheme("MacStyle",
["MacTheme","MacGray","MacGreenSteel","MacBlack"]);
+SkinService.addTheme("VistaStyle",
["VistaTheme","VistaBlue"]);
+</programlisting>
+ <para>
+ The syntax of addTheme() is:<!-- LB -->
<tt>addTheme(String categoryName, List<String>
themesName)</tt>
+ </para>
+ <para>
+ So, to provide your own skin you could use the following: {code}
SkinService.addSkin("mywebapp/MyPortlet", "MyPortalSkin",
"/mywebapp/skin/Stylesheet.css", ServletContext); {code}
+ </para>
+ <para>
+ This simple line would register a styleesheet for a portlet named
<tt>MyPortlet</tt> in a portlet app named
<tt>mywebapp</tt>. The stylesheet would be used when a skin
named <tt>MyPortalSkin</tt> is selected in portal.
+ </para>
+ <para>
+ The syntax of addSkin() is:<!-- LB --> <tt>addSkin(String
module, String skinName, String cssPath, ServletContext scontext, boolean
overwrite)</tt>
+ </para>
+ <para>
+ <parameter>~~overwrite~~</parameter> is optional, its default value is
"false". If its value is true, the later call of addSkin() for the same skin key
(combination of module + skinName) replaces the skin of the previous call.
+ </para>
+ <para>
+ Similarly, to configure a particular portal you can use the following :
+ </para>
+
+<programlisting> {code} SkinService.addSkin("myportalname",
"skin", "/path/to/skin/Stylesheet.css", ServletContext); {code}
+</programlisting>
+ <para>
+ The syntax of addPortalSkin() is:<!-- LB -->
<tt>addPortalSkin(String module, String skinName, String cssPath,
ServletContext scontext, boolean overwrite)</tt>
+ </para>
+ <para>
+ 1 Tips and Tricks
+ </para>
+ <para>
+ 1.1 Easier css debugging
+ </para>
+ <para>
+ By default, CSS files are cached and their imports are merged, at the server side,
into a single CSS file to reduce the number of HTTP requests from the browser to the
server.
+ </para>
+ <para>
+ The <tt>ServletContext</tt> parameter is there to allow
the direct access to the CSS files from the
<tt>SkinService</tt>. The optimization code is quite simple as
all the CSS files are parsed at the server startup time and all the @import and url(...)
references are rewritten to support a single flat file. The result is stored in a cache
directly used from the <tt>ResourceRequestFilter</tt>.
+ </para>
+ <para>
+ Although the optimization is useful for a production environments, you may find it
easier to deactivate this optimization while debugging your stylesheets. For that, you
simply need to set the java system property
<tt>exo.product.developing</tt> to
<tt>true</tt>.
+ </para>
+ <para>
+ For example, you can pass the property as a JVM parameter with the
<tt>-D</tt> option in your
<tt>GateIn.sh</tt> startup script: {code} EXO{code}
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ warning("This is option may cause display bugs with certain browsers like
Internet Explorer")
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ 1.1 Change portlet icons
+ </para>
+ <para>
+ Each portlet is represented by an icon that you can see in the portlet registry, or
the webos dock. You can change this icon by adding an image in the directory :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ $project/portlet/myportlets/src/main/webapp/skin/DefaultSkin/portletIcons/<emphasis
role="bold">and by naming the icon after the portlet,
eg:</emphasis>ExoPortlet.png
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ For example, in portal we have an account portlet named AccountPortlet, the icon is
located in :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ portal/tags/2.1.1/portlet/exoadmin/src/main/webapp/skin/DefaultSkin/portletIcons/AccountPortlet.png
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ 1.1 Set the default skin for Portal
+ </para>
+ <para>
+ When not configured, the default skin of portal is Default. If you want to change this
value (to Mac skin, Vista skin, or your own), add a skin tag in the
<tt>portal.xml</tt> that defines your portal:
+ </para>
+
+<programlisting><portal-config>
+ <portal-name>classic</portal-name>
+ <locale>en</locale>
+ <factory-id>office</factory-id>
+ <access-permissions>Everyone</access-permissions>
+
<edit-permission>*:/platform/administrators</edit-permission>
+ <skin>Mac</skin>
+ <creator>root</creator>
+...
+</programlisting>
+ <para>
+ factory-id was removed since Portal 2.5
+ </para>
+ <para>
+ Portal 2.6 and after will not take the order of the tags into account. Before 2.6, the
order must be the same as in the example.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-Some_CSS_techniques">
+ <title>Some CSS techniques</title>
+ <para>
+ Before studying GateIn CSS, make sure you already have some experience with css and
read the css spec at
http://www.w3.org/TR/REC-CSS2/selector.html
+ </para>
+ <para>
+ GateIn relies heavily on CSS to create the layout and special effects for the UI.
Below we explain some common techniques you may find often inside GateIn's markup. We
explain them here to help you better understand GateIn generated markup, ease css issues
fixing or get inspration for styling your own apps.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-Decorator_pattern">
+ <title>Decorator pattern</title>
+ <para>
+ The decorator is a pattern to create a contour or a curve around an area. In order to
achieve this effect you need to create 9 cells. The BODY is the central area that you want
to decorate. The other 8 cells are distributed around the BODY cell. You can use the
width, height and background image properties to achieve any decoration effect that you
want.
+ </para>
+
+<programlisting>
+~UWC_TOKEN_START~1255420331338~UWC_TOKEN_END~
+| | | |
+| TopLeft | TopCenter | TopRight |
+| | | |
+----
+| | | |
+| | | |
+| CenterLeft | BODY | CenterRight |
+| | | |
+| | | |
+~UWC_TOKEN_START~1255420331340~UWC_TOKEN_END~
+| | | |
+| BottomLeft | BottomCenter | BottomRight |
+| | | |
+~UWC_TOKEN_START~1255420331341~UWC_TOKEN_END~
+<div class="Parent">
+ <div class="TopLeft">
+ <div class="TopRight">
+ <div
class="TopCenter"><span></span></div>
+ </div>
+ </div>
+ <div class="CenterLeft">
+ <div class="CenterRight">
+ <div class="CenterCenter">BODY</div>
+ </div>
+ </div>
+ <div class="BottomLeft">
+ <div class="BottomRight">
+ <div
class="BottomCenter"><span></span></div>
+ </div>
+ <div>
+</div>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-Left_margin_left_pattern">
+ <title>Left margin left pattern</title>
+ <para>
+ Left margin left pattern is a technique to create 2 blocks side by side. The left
block will have a fixed size and the right block will take the rest of the available
space. When the user resizes the browser the added or removed space will be taken from the
right block.
+ </para>
+
+<programlisting>~UWC_TOKEN_START~1255420331342~UWC_TOKEN_END~
+| | |
+| | |
+| |<--- fixed width --->| | will expand to right
----> |
+| | |
+| | |
+| | |
+----
+<div class="Parent">
+ <div style="float: left; width: 100px">
+ </div>
+ <div style="margin-left: 105px;">
+ <div>
+ <div style="clear:
left"><span></span></div>
+</div>
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-How_to_create_a_new_skin">
+ <title>How to create a new skin</title>
+ <para>
+ New skin can be created by the configuration. Firstly, you have to definy the new skin
in <literal>WEB-INF/conf/script/groovy/SkinConfigScript.groovy</literal> in
your <literal>Ressource</literal> (for example, in the project MyPortal, you
can put it in <literal>GateInResourcesMyPortal</literal>).
+ </para>
+
+<programlisting>
+SkinService.addPortalSkin("MyPortalSkin","MyPortal","/GateInResourcesMyPortal/skin/Stylesheet.css",ServletContext);
+</programlisting>
+ <para>
+ Secondly, you put all your new skin into <literal>folder
skinyourSkin</literal> and create new file
<literal>Stylesheet.css</literal> here. In this file, you will import all
links to your CSS. For example in MyPortal project.
+ </para>
+
+<programlisting>
+@import url(MyPortalSkin/portal/webui/component/UIPortalApplicationSkin.css) ;
+@import url(MyPortalSkin/webui/component/Stylesheet.css) ;
+</programlisting>
+ <para>
+ Finally, you have to definy the name of new skin and the image preview for the
<emphasis>Skin Settings</emphasis> action in <emphasis> "User
Workspace" </emphasis> <!-- <link linkend="User
Workspace">User Workspace</link> -->.
+ </para>
+ <para>
+ By default, if you don not set new name for skin, its name is
<t>label></tt>. Looking in the file and add yout new
name here.
+ </para>
+
+<programlisting>
+#############################################################################
+# Change Skin #
+#############################################################################
+
+UIChangeSkin.action.save=Appliquer
+UIChangeSkin.action.close=Fermer
+UIChangeSkin.title.SkinSetting=Configuration des styles
+UIChangeSkin.MyPortal.label=Style MyPortal
+UIChangeSkin.Default.label=Style par d?faut
+UIChangeSkin.Mac.label=Style Mac
+UIChangeSkin.Vista.label=Style Vista
+Skin.title=Liste des styles
+Skin.left.title=Voir et s?lectionner un style
+</programlisting>
+ <para>
+ The image peeview can be set in file
<literal>ressource/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/Stylesheet.css</literal>
of Portal.
+ </para>
+
+<programlisting>
+.UIChangeSkinForm .UIItemSelector .TemplateContainer .MyPortalImage {
+ margin: auto;
+ width: 329px; height:204px;
+ background: url('background/MyPortal.jpg') no-repeat top;
+ cursor: pointer ;
+}
+</programlisting>
+ <para>
+ And now, you copy your image <literal>MyPortal.jpg</literal> (that you
definy above) to the folder
<literal>ressource/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/background</literal>
and test your new skin.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Skin_Configuration-How_to_create_new_themes">
+ <title>How to create new themes</title>
+ <para>
+ Firstly, you have to definy the new theme in
<literal>WEB-INF/conf/script/groovy/SkinConfigScript.groovy</literal> in your
<literal>Ressource</literal> (for example, in the project MyPortal, you can
put it in <literal>GateInResourcesCp060508</literal>).
+ </para>
+
+<programlisting>
+SkinService.addTheme("MyPortal-MacTheme",
["MacGray","MacBlue","MacBlack"]);
+</programlisting>
+ <para>
+ Secondly, you put all your new theme into <literal>folder
skinyourSkin</literal> and create new file
<literal>Stylesheet.css</literal> here. In this file, you will import all
links to your CSS. For example in MyPortal project.
+ </para>
+
+<programlisting>
+@import url(MyPortalSkin/PortletThemes/Stylesheet.css) ;
+</programlisting>
+ <para>
+ You can see here, in the
<literal>GateInResourcesCp060508/skin/MyPortalSkin/PortletThemes/Stylesheet.css</literal>,
you put all your CSS of new theme.
+ </para>
+
+<programlisting>
+/*---- MyPortalTheme ----*/
+.MyPortalTheme .WindowBarCenter .WindowPortletInfo {
+ margin-right: 80px; /* orientation=lt */
+ margin-left: 80px; /* orientation=rt */
+}
+.MyPortalTheme .WindowBarCenter .ControlIcon {
+ float: right;/* orientation=lt */
+ float: left;/* orientation=rt */
+ width: 24px;
+ height: 17px;
+ cursor: pointer;
+ background-image: url('background/MyPortalTheme.png');
+}
+.MyPortalTheme .ArrowDownIcon {
+ background-position: center 20px;
+}
+.MyPortalTheme .OverArrowDownIcon {
+ background-position: center 116px;
+}
+.MyPortalTheme .MinimizedIcon {
+ background-position: center 44px;
+}
+.MyPortalTheme .OverMinimizedIcon {
+ background-position: center 140px;
+}
+.MyPortalTheme .MaximizedIcon {
+ background-position: center 68px;
+}
+.MyPortalTheme .OverMaximizedIcon {
+ background-position: center 164px;
+}
+.MyPortalTheme .RestoreIcon {
+ background-position: center 92px;
+}
+.MyPortalTheme .OverRestoreIcon {
+ background-position: center 188px;
+}
+.MyPortalTheme .NormalIcon {
+ background-position: center 92px;
+}
+.MyPortalTheme .OverNormalIcon {
+ background-position: center 188px;
+}
+.UIPageDesktop .MyPortalTheme .ResizeArea {
+ float: right;/* orientation=lt */
+ float: left;/* orientation=rt */
+ width: 18px; height: 18px;
+ cursor: nw-resize;
+ background: url('background/ResizeArea18x18.gif') no-repeat left top; /*
orientation=lt */
+ background: url('background/ResizeArea18x18-rt.gif') no-repeat right top; /*
orientation=rt */
+}
+.MyPortalTheme .Information {
+ height: 18px; line-height: 18px;
+ vertical-align: middle; font-size: 10px;
+ padding-left: 5px;/* orientation=lt */
+ padding-right: 5px;/* orientation=rt */
+ margin-right: 18px;/* orientation=lt */
+ margin-left: 18px;/* orientation=rt */
+}
+.MyPortalTheme .WindowBarCenter .WindowPortletIcon {
+ background-position: left top; /* orientation=lt */
+ background-position: right top; /* orientation=rt */
+ padding-left: 20px; /* orientation=lt */
+ padding-right: 20px; /* orientation=rt */
+ height: 16px;
+ line-height: 16px;
+}
+.MyPortalTheme .WindowBarCenter .PortletName {
+ font-weight: bold;
+ color: #333333;
+ overflow: hidden;
+ white-space: nowrap;
+ width: 100%;
+}
+.MyPortalTheme .WindowBarLeft {
+ padding-left: 12px;
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: no-repeat;
+ background-position: left -148px;
+}
+.MyPortalTheme .WindowBarRight {
+ padding-right: 11px;
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: no-repeat;
+ background-position: right -119px;
+}
+.MyPortalTheme .WindowBarCenter {
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: repeat-x;
+ background-position: left -90px;
+}
+.MyPortalTheme .WindowBarCenter .FixHeight {
+ height: 21px;
+ padding-top: 8px;
+}
+.MyPortalTheme .MiddleDecoratorLeft {
+ padding-left: 12px;
+ background: url('background/MMyPortalTheme.png') repeat-y left;
+}
+.MyPortalTheme .MiddleDecoratorRight {
+ padding-right: 11px;
+ background: url('background/MMyPortalTheme.png') repeat-y right;
+}
+.MyPortalTheme .MiddleDecoratorCenter {
+ background: #ffffff;
+}
+.MyPortalTheme .BottomDecoratorLeft {
+ padding-left: 12px;
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: no-repeat;
+ background-position: left -60px;
+}
+.MyPortalTheme .BottomDecoratorRight {
+ padding-right: 11px;
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: no-repeat;
+ background-position: right -30px;
+}
+.MyPortalTheme .BottomDecoratorCenter {
+ background-image: url('background/MyPortalTheme.png');
+ background-repeat: repeat-x;
+ background-position: left top;
+}
+.MyPortalTheme .BottomDecoratorCenter .FixHeight {
+ height: 30px;
+}
+</programlisting>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/User_Workspace_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,99 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-User_Workspace_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --> <title>User Workspace Configuration</title>
+ <section
id="sect-Reference_Guide-User_Workspace_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ The User Workspace is give privileged users access to administration actions. Please
refer to the <emphasis>"User Workspace"</emphasis> <!--
<link linkend="Portal:User Workspace">User Workspace Guide</link>
--> to know more details.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-User_Workspace_Configuration-Default_Configuration">
+ <title>Default Configuration</title>
+ <para>
+ The default configuration defines two groups:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code>:/platform/administrators</code> and
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>:/platform/organization/management/executive-board</code>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ anyone in these groups can access and use the User Workspace. The asterisk symbol
stands for "any membership type".
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ user that wants to access the User Workspace he or she a member of at least one of
these groups with the appropriate membership.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-User_Workspace_Configuration-Customize_the_Configuration">
+ <title>Customize the Configuration</title>
+ <para>
+ If an administrator wants to allow someone to access the User Workspace, the admin can
add the user to one of these groups or he or she modifies the workspace access
configuration. This permission is set in the
<emphasis>portal-configuration.xml</emphasis> file.
+ </para>
+
+<programlisting> <component>
+ <key>org.exoplatform.portal.config.UserACL</key>
+ <type>org.exoplatform.portal.config.UserACL</type>
+ <init-params>
+...
+<value-param>
+ <name>access.control.workspace</name>
+ <description>groups with memberships that have the right to access
the User Control Workspace</description>
+
<value>*:/platform/administrators,*:/organization/management/executive-board</value>
+</value-param>
+</programlisting>
+ <para>
+ Modify the content of the <code>value</code> tag depending
on your needs. The configuration is taken into account after you restarted the application
server.
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ info(" Remember to specify the groups in
<code>organization-configuration.xml</code>" )
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-User_Workspace_Configuration-Related_links">
+ <title>Related links</title>
+ <para>
+ Please refer to <emphasis>"User Workspace"</emphasis> <!--
<link linkend="Portal:User Workspace">User Workspace Guide</link>
--> to see the user workspace.
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/configuration/Varnish_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,464 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Varnish_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Varnish Configuration</title>
+ <section id="sect-Reference_Guide-Varnish_Configuration-Introduction">
+ <title>Introduction</title>
+ <para>
+ This document is an overview of Varnish configuration for GateIn SEA Portal. It is
organized as follows:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Section one gives an introduction to Varnish software (version 1.1.2)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Section two explains how to install it, we are using Linux kernel version 2.6.27.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The third section gives a brief description of Varnish configuration files for
GateIn Portal
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Whereas the last one discusses some of the practical issues encountered during the
deployment of Varnish, the last section analyzes the speed gain by Varnish.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The configuration given below is more convenient for static content such as images,
css ,javascript and html files. By this way after modifying an object belonging to static
content you must refresh the varnish cache. To do this, first off all, connect to varnish
administration port, it can easily be done this way: <emphasis>telnet localhost
6083</emphasis> ( <emphasis
role="bold">Note:</emphasis><emphasis>this command should be
typed on the machine where Varnish is installed</emphasis> ). And then write the
following in the command line. <emphasis>url.purge ^/$</emphasis> This purge
your <emphasis>/</emphasis> document. As you can see that
<emphasis>url.purge</emphasis> takes an regular expression as its argument.
Hence the <emphasis>^</emphasis> and <emphasis>$</emphasis> at the
front and end. If the <emphasis>^</emphasis> is omitted, all the documents
ending in a <emphasis>/</emphasis> in the cache would be deleted. So to delete
all the documents in the cache, type in!
the command line.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Varnish_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ Varnish is a HTTP/web accelerator, it was written from the beginning to be a
high-performance open source reverse proxy caching implementation. Varnish, like other
caching reverse HTTP proxy implementations, is most frequently used to alleviate/reduce
origin web servers of undue load, giving you the ability to handle a higher number of
concurrent hits.
+ </para>
+ <para>
+ Nowadays, more and more web sites present dynamic web pages consisting of a number of
different elements. Combining these elements is both time consuming and CPU intensive. The
bad news is that the same process is repeated for every individual user, even when the
content is identical. Fortunately in such a case a solution like Varnish can help to
improve web server performance. How can Varnish accomplish this? Varnish temporarily
stores the most frequently requested pages in its cache. It is more effective to present
these pages from the Varnish cache. Therefore, users are offered an improved service, and
Content/Document Management System server requirements are reduced.
+ </para>
+ <para>
+ Why are we using Varnish? In contrast with other HTTP accelerators, many of which
began life as client-side proxies or origin servers, Varnish was designed from the scratch
as an accelerator for incoming traffic. In addition, Varnish via his DSL (Domain Specific
Language) is very flexible. In fact, this way, it provides users not only with a means of
modifying and rewriting client requests or in certain cases server responses. But Varnish
also enable the user to load multiple configurations concurrently. So users can
instantaneously switch from one VCL (Varnish Configuration Language) to another. It is not
all, Varnish TTL (Time to Live) parameter enables users to decide how long an object
should be cached.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-Installation_of_Varnish">
+ <title>Installation of Varnish</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Varnish_Configuration-Prerequisite">
+ <title>Prerequisite</title>
+ <para>
+ Before building Varnish, make sure that the following tools are installed :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ GCC compiler
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ A POSIX-compatible make
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ GNU autotools (automake, autoconf, libtool, ncurses)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Varnish_Configuration-Installation">
+ <title>Installation</title>
+ <para>
+ If you are using a system with a graphical user interface, installation of Varnish
1.1.2 is quite easy via synaptic package manager. If not, you can run in a terminal by the
following command to install Varnish on your computer:
+ </para>
+
+<programlisting>sudo apt-get install varnish
+</programlisting>
+ <para>
+ You can also install Varnish from source, see the following web site for more
information:
+ </para>
+ <para>
+ <ulink type="http"
url="http://varnish.projects.linpro.no">http://varnish.projects.linpro.no</ulink>.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-Varnish_configuration_for_GateIn_Portal">
+ <title>Varnish configuration for GateIn Portal</title>
+ <para>
+ Varnish uses Varnish Configuration Language (VCL). The VCL language is a small
domain-specific language designed to be used to define request handling and document
caching policies for the Varnish HTTP accelerator. When a new configuration is loaded, the
varnished management process translates the VCL code to C and compiles it to a shared
object which is then dynamically linked into the server process.
+ </para>
+ <para>
+ Installation of Varnish automatically create two files named default.vcl and varnish
in the repositories <emphasis>/etc/varnish/</emphasis> and
<emphasis>/etc/default</emphasis> respectively. One is VCL and another one
contains values that will be passed as parameters to
<emphasis>varnished</emphasis> . We will not make use of the first one, that
is default.vcl. Create a new file named vcl.conf in /etc/varnish with the following
contents:
+ </para>
+ <para>
+ Backend declaration, here we need to specify the web server host name and the
listening http port.
+ </para>
+
+<programlisting>backend default {
+ set backend.host = "127.0.0.1";
+ set backend.port = "8080";
+}
+#
+## Called when a client request is received
+#
+sub vcl_recv {
+ if (req.url ~ "^/$") {
+ set req.url = regsub(req.url,"^/$","/portal");
+ set req.http.Accept-Language = "vi";
+ }
+ if (req.url ~ ".*vnwebsite.*"){
+ set req.http.Accept-Language = "vi";
+ } else {
+ set req.http.Accept-Language = "en";
+ }
+ if (req.request!images/= "GET" && req.request!images/ =
"HEAD") {
+ pipe;
+ }
+ if (req.http.Expect) {
+ pipe;
+ }
+ if (req.request == "GET" && req.url ~
"\.(jpg|jpeg|gif|ico|tiff|tif|svg|css|js|html)$") {
+ set req.url = regsub(req.url, "\?.*", "");
+ remove req.http.cookie;
+ remove req.http.authenticate;
+ lookup;
+ }
+ if (req.http.Authenticate || req.http.Authorization) {
+ pass;
+ }
+ if (req.http.Cache-Control ~ "no-cache") {
+ set req.http.Cache-Control = regsub(req.http.Cache-Control,
"no-cache", "set-cookie2");
+ }
+ # force lookup even when cookies are present
+ if (req.request == "GET" && req.http.cookie) {
+ lookup;
+ }
+ lookup;
+}
+</programlisting>
+ <para>
+ In order to specify the default language for each web site, that is Vietnamese (vi)
for vnwebsite and English (en) for enwebsite; the following statement <emphasis>set
req.http.Accept-Language = "language code"</emphasis> is useful.
+ </para>
+
+<programlisting>#
+## Called when entering pipe mode
+#
+sub vcl_pipe {
+ pipe;
+}
+#
+## Called when entering pass mode
+#
+sub vcl_pass {
+ pass;
+}
+#
+## Called when the requested object was found in the cache
+#
+sub vcl_hit {
+ if (req.url ~ ".*vnwebsite.*"){
+ set req.http.Accept-Language = "vi";
+ } else {
+ set req.http.Accept-Language = "en";
+ }
+ deliver;
+}
+## Called when the requested object has been retrieved from the
+## backend, or the request to the backend has failed
+sub vcl_fetch {
+ if (!obj.valid) {
+ error;
+ }
+ if (req.url ~ ".*vnwebsite.*"){
+ set req.http.Accept-Language = "vi";
+ } else {
+ set req.http.Accept-Language = "en";
+ }
+ if (req.http.Cache-Control ~ "no-cache") {
+ set req.http.Cache-Control = regsub(req.http.Cache-Control,
"no-cache", "set-cookie2");
+ }
+ if(obj.cacheable){
+ remove req.http.Set-Cookie;
+ set obj.http.Cache-Control = "no-cache";
+ remove obj.http.Etag;
+ if(obj.ttl < 7d){
+ set obj.ttl = 7d;
+ }
+ insert;
+ }
+ insert;
+}
+</programlisting>
+ <para>
+ If the cookie is intended for use by a single user, the Set-Cookie2 header
<emphasis>should not</emphasis> be cached. A Set-Cookie2 header that is
intended to be shared by multiple users <emphasis
role="bold">may</emphasis> be cached.
+ </para>
+ <note>
+ <title>Note</title>
+ <para>
+ Since <emphasis role="bold">Etag</emphasis> (entity tag) in an
HTTP response header that may be returned by an HTTP/1.1 compliant web server is used by
the user-agent to determine change in content at a given URL. It is removed in order to
instruct the user-agent that there is no change in content of cacheable objects. In fact,
when a new HTTP response contains the same ETag as an older HTTP response, the client can
conclude that the content is the same without further downloading.
+ </para>
+ </note>
+
+<programlisting>## Called before a cached object is delivered to the client
+sub vcl_deliver {
+ deliver;
+}
+## Called when an object nears its expiry time
+sub vcl_timeout {
+ discard;
+}
+## Called when an object is about to be discarded
+sub vcl_discard {
+ discard;
+}
+</programlisting>
+ <para>
+ This configuration tells Varnish to always cache all cacheable objects and don't
invalidate them for at least one week.
+ </para>
+ <para>
+ Then modify the file <emphasis>/etc/default/varnish</emphasis> and make
yourself sure that its content is not too different to this one, particularly the
DAEMONOPTS part. Note that we are using the advanced configuration, that is alternative
3.
+ </para>
+
+<programlisting># Configuration file for varnish
+#
+# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this
+# shell script fragment.
+#
+# Maximum number of open files (for ulimit -n)
+NFILES=131072
+# Default varnish instance name is the local nodename. Can be overridden with
+# the -n switch, to have more instances on a single server.
+INSTANCE=$(uname -n)
+## Alternative 3, Advanced configuration
+## We choose advance configuration
+#
+# See varnishd(1) for more information.
+#
+# # Main configuration file. You probably want to change it :)
+VARNISH_VCL_CONF=/etc/varnish/default.vcl
+#
+# # Default address and port to bind to
+# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
+# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
+VARNISH_LISTEN_ADDRESS=0.0.0.0
+VARNISH_LISTEN_PORT=80
+#
+# # Telnet admin interface listen address and port
+VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
+VARNISH_ADMIN_LISTEN_PORT=6082
+#
+# # The minimum number of worker threads to start
+VARNISH_MIN_THREADS=1
+#
+# # The Maximum number of worker threads to start
+VARNISH_MAX_THREADS=2048
+#
+# # Idle timeout for worker threads
+VARNISH_THREAD_TIMEOUT=120
+#
+# # Cache file location
+VARNISH_STORAGE_FILE=/var/lib/varnish/$INSTANCE/varnish_storage.bin
+#
+# # Cache file size: in bytes, optionally using k / M / G / T suffix,
+# # or in percentage of available disk space using the % suffix.
+VARNISH_STORAGE_SIZE=5G
+#
+# # Backend storage specification
+VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"
+#
+# # Default TTL used when the backend does not specify one
+VARNISH_TTL=7d
+#
+# # DAEMON_OPTS is used by the init script. If you add or remove options, make
+# # sure you update this section, too.
+DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
+ -f ${VARNISH_VCL_CONF} \
+ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
+ -t ${VARNISH_TTL} \
+ -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
+ -s ${VARNISH_STORAGE}"
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-How_fast_is_Varnish">
+ <title>How fast is Varnish?</title>
+ <para>
+ When using an HTTP accelerator, it is important to know whether our web server
performance has improved or not. Thus, this section shows the performance gained by the
use of Varnish.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-Varnish_testbed_configuration">
+ <title>Varnish testbed configuration</title>
+ <para>
+ Our Varnish testbed consists of a desktop PC acting as a web server (WS), and 10
PC-based Linux acting as clients stations. The system hardware configuration is summarized
in the following table. All machines except the WS use a Linux 2.6.27 kernel. The
user-agent used on client stations is <emphasis
role="bold">wget</emphasis>
+ </para>
+ <para>
+ The following table is the testbed summary:
+ </para>
+ <informaltable colsep="0" frame="none" rowsep="0">
+ <tgroup cols="3">
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <tbody>
+ <row>
+ <entry>
+ <emphasis role="bold"> Hardware </emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold"> Processor </emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold"> Frequency </emphasis>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ One x (WS)
+ </entry>
+ <entry>
+ Intel(R) Pentium(R) 4
+ </entry>
+ <entry>
+ 3.00GHz
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Two x (PC)
+ </entry>
+ <entry>
+ Intel(R) Core(TM)2 Duo
+ </entry>
+ <entry>
+ 2.00GHz
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>
+ It is well known that performance of a software like varnish depends on part on the
communication link between server host and client stations. So, without loss of
generality, we assume that our wireless connection is fair.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-Varnish_analyzes_method">
+ <title>Varnish analyzes method</title>
+ <para>
+ In other to evaluate Vanish performance, we first access all pages of our web site
through Varnish to ensure that all cacheable objects can be found in Varnish cache. It
takes in average 6.9s. Then we simultaneously send 100 download requests from each of our
2 client stations to the web server using wget user-agent through Varnish. After this
operation, we evaluate the average time required by each client station to perform a
download request. The same process is done without using Varnish. We then compare the
obtained results.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Varnish_Configuration-Varnish_performance_analyzes">
+ <title>Varnish performance analyzes</title>
+ <para>
+ This part discuss about Varnish performance in term of time of response. That is the
time that a given client should wait to get the requested object (or the server response).
In this case the requested object is our entire web site. The collected measurements are
summarized in the below table:
+ </para>
+ <informaltable colsep="0" frame="none" rowsep="0">
+ <tgroup cols="5">
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <colspec align="center"></colspec>
+ <tbody>
+ <row>
+ <entry>
+ <emphasis role="bold"> Host </emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold"> Average waiting time using Varnish as
reverse proxy </emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold"> Average waiting time without use of Varnish
</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold">Number of trials </emphasis>
+ </entry>
+ <entry>
+ <emphasis role="bold"> Data size </emphasis>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ First
+ </entry>
+ <entry>
+ 02. 791070
+ </entry>
+ <entry>
+ 26.889563
+ </entry>
+ <entry>
+ 100
+ </entry>
+ <entry>
+ 104 files, 1.4M
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Second
+ </entry>
+ <entry>
+ 02.708190
+ </entry>
+ <entry>
+ 26. 378669
+ </entry>
+ <entry>
+ 100
+ </entry>
+ <entry>
+ 104 files, 1.4M
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <note>
+ <title>Note</title>
+ <para>
+ All times above are in second, these times include the time needed by the client to
connect to the server.
+ </para>
+ </note>
+ <para>
+ Measurements listed above obviously shows that our web server performance are
considerably improved by the use of Varnish software. In average per user request, we gain
from Varnish 24 (twenty-four) seconds. That is using Varnish, user requests are at least
10 times faster than previously (without Varnish).
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Accessing_User_Profile.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Accessing_User_Profile">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Accessing User Profile</title>
+ <para>
+ To retrieve the logged in user you can do as follows :
+ </para>
+
+<programlisting>// Alternative context: WebuiRequestContext context =
+ WebuiRequestContext.getCurrentInstance() ;
+ PortalRequestContext context = PortalRequestContext.getCurrentInstance() ;
+ // Get the id of the user logged
+ String userId = context.getRemoteUser();
+ // Request the information from OrganizationService:
+ OrganizationService orgService = getApplicationComponent(OrganizationService.class) ;
+ if(userId!images/= null) {
+ User user = orgService.getUserHandler().findUserByName(userId) ;
+ if (user!images/= null) {
+ String firstName = user.getFirstName();
+ String lastName = user.getLastName();
+ String email = user.getEmail();
+ }
+ }
+</programlisting>
+ <para>
+ Alternatives for retrieving the Organization Service
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ OrganizationService service = (OrganizationService)
ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(OrganizationService.class);
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ OrganizationService service = (OrganizationService)
PortalContainer.getInstance().getComponentInstanceOfType(OrganizationService.class);
+ </para>
+ </listitem>
+ </orderedlist>
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Ajax_Loading_Mask_Layer_Deactivation.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,126 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section
id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Deactivation of the Ajax Loading Mask Layer</title>
+ <section
id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Purpose of ajax-loading mask.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ How to deactivate ajax-loading mask.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Synchronous / Asynchronous issue.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Purpose_of_requirement">
+ <title>Purpose of requirement</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Loading mask layer is displayed after ajax-call for blocking GUI to prevent
user's action until the the ajax-request is completed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Sometimes portal needs to be ready for user instructions without waiting previous
instructions completed. So mask layer may need to be deactivated.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-How_to_deactivate_ajax_loading_mask_in_your_code">
+ <title>How to deactivate ajax-loading mask in your code</title>
+ <para>
+ To generate script to make an asynchronous ajax-call, we use uicomponent.doAsync()
method instead of uicomponent.event() method.
+ </para>
+ <para>
+ Here is an example:
+ </para>
+ <para>
+ <a href="<%=uicomponent.doAsync(action, beanId,
params)%>" alt="">Asynchronous</a>
+ </para>
+ <para>
+ Method doAsync() automatically adds a parameter into parameters list. Parameter
async<emphasis>param = new Parameter(AJAX</emphasis>ASYNC,"true");
(AJAX<emphasis>ASYNC == "ajax</emphasis>async")
+ </para>
+ <para>
+ After all, its call method event() to generate script that make Ajax Request. This
request is asynchronous and ajax-loading mask will not displayed.
+ </para>
+ <para>
+ Note:
+ </para>
+ <para>
+ 1. You still also make an asynchronous request by using method uicomponent.event(). By
this way, you must add asyncparam manually.
+ </para>
+ <para>
+ 2. GUI is blocked so that user can do only one action at a time (Request seems to be
synchronous). But in fact ajax request always be asynchronous. See Synchronous issue
section.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Deactivation_of_the_Ajax_Loading_Mask_Layer-Synchronous_issue">
+ <title>Synchronous issue</title>
+ <para>
+ Almost web browser such as (IE, Chrome, Safari .. ) told that ajax request may used in
two modes: Synchronous / Asynchronous with boolean value of bAsyn parameter. View
reference.
+ </para>
+ <para>
+ var bAsync = false; // Synchronous
+ </para>
+ <para>
+ request.open(instance.method, instance.url, bAsync);
+ </para>
+ <para>
+ But Mozilla say no. They doesn't support synchronous request. var bAsync = false;
// Synchronous
+ </para>
+ <para>
+ request.open(instance.method, instance.url, bAsync); // Firefox will not execute
+ </para>
+ <para>
+ So we decide to set bAsync always true (Ajax request always be asynchronous).
+ </para>
+ <para>
+ // Asynchronous request
+ </para>
+ <para>
+ request.open(instance.method, instance.url, true);
+ </para>
+ <para>
+ It is cause that Ajax Request always be asynchronous.
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/development/Dynamic_Layouts.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Dynamic_Layouts.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Dynamic_Layouts.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,67 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Dynamic_Layouts">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Dynamic Layouts</title>
+ <section id="sect-Reference_Guide-Dynamic_Layouts-Overview">
+ <title>Overview</title>
+ <para>
+ Indeed, the usual way of rendering a portal page is a static one where you need a
template, usually a jsp page, for each layout (2 columns, 3 columns and so on). That makes
you depend on the integrator or developers as for each new layout you will need to ask for
a custom development.
+ </para>
+ <para>
+ GateIn, with its dynamic way that creates a tree of nested UI containers that contain
portlets as shown in the picture below. Each container is responsible for rendering its
children. In the picture, the main container renders its children in several rows while
the nested container displays them as columns.
+ </para>
+ <para>
+ Furthermore, by manipulating the tree using the WYSIWYG editor, it allows you to
create new containers, define how they will render their children, add new portlets.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/portal.gif" format="GIF" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section
id="sect-Reference_Guide-Dynamic_Layouts-Advanced_Drag_and_Drop_mechanism">
+ <title>Advanced Drag and Drop mechanism</title>
+ <para>
+ As most portal use the static layout mechanism, they can only drag portlets from one
static location, let's say a column, to another one.
+ </para>
+ <para>
+ With GateIn Portal, it is possible to also drag the UI containers and the portlets and
drop them in containers that are deeper or upper in the Portal component tree. This
feature is unique and not just a tool!
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/image3.jpg" format="JPG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Dynamic_Layouts-Summary">
+ <title>Summary</title>
+ <para>
+ With this innovative concept of dynamic layout, you can easily create portal pages
with complex layout.
+ </para>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,258 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Internationalization_Configuration">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Internationalization Configuration</title>
+ <section
id="sect-Reference_Guide-Internationalization_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ All aspects of internationalization in GateIn products are covered. You should have a
general knowledge of Internationalization in Java products. Sun created a <ulink
url="
http://java:sun.com-docs-books-tutorial-i18n-TOC.html">good
internationalization tutorial</ulink> .
+ </para>
+ <section id="sect-Reference_Guide-Overview-Introduction">
+ <title>Introduction</title>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ typical locale file can be found in:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ .../WEB-INF/classes/locale/navigation/group/organization/management/executive-board
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ You should notice that
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ the file is located in the <emphasis
role="bold">classes</emphasis> folder of your WEB-INF, this way they
are loaded by the ClassLoader.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ all resource files are in the subfolder <emphasis
role="bold">locale</emphasis> .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ resources for the <xref
linkend="sect-Reference_Guide-Portal_Navigation_Configuration" /> are located
in a <emphasis role="bold">navigation</emphasis> subfolder of
locale.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ resources concerning the navigation of a group are in a <emphasis
role="bold">navigation/group</emphasis> subfolder. The other possible
navigations are <emphasis role="bold">user</emphasis> and
<emphasis role="bold">portal</emphasis> .
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Furthermore there are properties files in portal sub-folder, they form together the
<emphasis role="bold">portal resource bundle</emphasis> .:<!--
<ulink
url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-src-main-webapp-WEB-INF-classes-locale-portal">::/WEB-INF/classes/locale/portal></ulink>
-->
+ </para>
+ <para>
+ The <emphasis>executive-board</emphasis> en.properties{code:none}{code}
The keys (example: ~~organization.newstaff~~) can have any name but must not contain
spaces. The values (~~New Staff~~) contain the translation to the language of the resource
file. The suffix "en" means in this case "English".
+ </para>
+ <orderedlist numeration="arabic">
+ <listitem>
+ <para>
+ info("There are also resource bundles in XML format <xref
linkend="sect-Reference_Guide-XML_Resources_Bundles" /> which are a
proprietary format of GateIn Platform.")
+ </para>
+ </listitem>
+ </orderedlist>
+ <para>
+ 1 LocalesConfig
+ </para>
+ <!-- <ulink
url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-src-main-webapp-WEB-INF-conf-common-common-configuration.xml?r=28705">/WEB-INF/conf/common/common-configuration.xml"</ulink>
-->
+ <para>
+ In the <filename>/WEB-INF/conf/common/common-configuration.xml</filename>
file of your installation you find:
+ </para>
+
+<programlisting> <component>
+
<key>org.exoplatform.services.resources.LocaleConfigService</key>
+
<type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>war:/conf/common/locales-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+</programlisting>
+ <para>
+ The configuration points to the locale configuration file like this one<ulink
type="http"
url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-src-main-webapp-WEB-INF-conf-common-locales-config.xml?r=24696"
/>
+ </para>
+
+<programlisting>{code:xml} <locale-config>
<locale>ar</locale>
<output-encoding>UTF-8</output-encoding>
<input-encoding>UTF-8</input-encoding>
<description>Default configuration for the Arabic
locale</description>
<orientation>rt</orientation> </locale-config>
{code}
+</programlisting>
+ <para>
+ The locale has to be defined using <ulink type="http"
url="http://ftp.ics.uci.edu-pub-ietf-http-related-iso639.txt" />, in this
example "ar" is Arabic.
+ </para>
+ <para>
+ This configuration defines also the list of languages in the "Change
Language" section of the portal.
+ </para>
+ <para>
+ 1.1 Encoding It's highly recommended to always use <emphasis
role="bold">UTF-8</emphasis>. You should also encode all property files
in UTF-8.
+ </para>
+ <para>
+ In the java implementation, the encoding parameters will be used for the request
response stream. The input-encoding parameter will be used for request
setCharacterEncoding(..).
+ </para>
+ <para>
+ 1.1 Orientation The default orientation of text and images is Left-To-Right. As you
know GateIn support <emphasis role="bold">Right-To-Left</emphasis>
orientation. Therefore for Arabic you define
+ </para>
+ <para>
+ <orientation>rt</orientation>
+ </para>
+ <para>
+ 1 ResourceBundleService
+ </para>
+ <para>
+ The resource bundle service is configured here: // <ulink
url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/web...
+ </para>
+ <para>
+ Caution: Other GateIn products like DMS use dedicated configuration file called
"resource-bundle-configuration.xml".
+ </para>
+ <para>
+ A typical configuration looks like this one: {code:xml} <component>
<key>org.exoplatform.services.resources.ResourceBundleService</key>
<type>org.exoplatform.services.resources.jcr.ResourceBundleServiceImpl</type>
<init-params>
+ </para>
+ <para>
+ <values-param>
<name>classpath.resources</name>
<description>The resources that start with the following package name should
be loaded from file system</description>
<value>locale.portlet</value> </values-param>
+ </para>
+ <para>
+ <values-param> <name>init.resources</name>
<description>Store the following resources in the DB for the first launch
</description>
<value>locale.portal.expression</value>
<value>locale.portal.services</value>
<value>locale.portal.webui</value>
<value>locale.portal.custom</value>
+ </para>
+ <para>
+ <value>locale.navigation.portal.classic</value>
<value>locale.navigation.group.platform.administrators</value>
<value>locale.navigation.group.platform.users</value>
<value>locale.navigation.group.platform.guests</value>
<value>locale.navigation.group.organization.management.executive-board</value>
</values-param>
+ </para>
+ <para>
+ <values-param>
<name>portal.resource.names</name>
<description>The properties files of the portal, these files will be merged
into one ResoruceBundle properties </description>
<value>locale.portal.expression</value>
<value>locale.portal.services</value>
<value>locale.portal.webui</value>
<value>locale.portal.custom</value>
</values-param>
+ </para>
+ <para>
+ </init-params> </component>
+ </para>
+
+<programlisting>
+There are three parameters: *classpath.resources*, *init.resources*, and
*portal.resource.names*. We will talk later about _classpath.resources_.
+In _init.resources_ you have to define _*all resources*_ that you want use in the
product, independently of the fact that they belong to the portal or to the navigation.
All these resources are stored in JCR at the first launch of your product. After that, you
only can modify these resources using the [Portal:Internationalization Portlet].
+h2. Portal Resource Bundle
+The parameter *portal.resource.names* defines all resources that belong to the *Portal
Resource Bundle*. This means that these resources are merged to a *single resource bundle*
which is accessible from anywhere in GateIn products. As mentioned, all these keys are
located in the same bundle, which is separated from the navigation resource bundles.
+h2. Navigation Resource Bundles
+There is a resource bundle for each navigation. A navigation can exist for user, groups,
and portal. In the example above you see bundle definitions for the navigation of the
classic portal and of four different groups. Each of these resource bundles lives in a
different sphere, they are independent of each other and they do not belong to the
portal.resource.names parameter (because they are not mentioned in
_portal.resource.names_).
+As you learned in the introduction you must put the properties for a group in the
_WEB-INF/classes/locale/navigation/group/_ folder.
+Example:
+*.../portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_en.properties*
+The folder and file names must correspond to the group hierarchy. The group name
"executive-board" is followed by the iso 639 code. For each language you defined
in the LocalesConfig you must provide a resource file.
+If you ever change the name of a group you also need to change the name of the folder
and/or files of the correspondent navigation resource bundles.
+You already know the content of _executive-board_en.properties_:
+{code:none}
+organization.title=Organization
+organization.newstaff=New Staff
+organization.management=Management
+</programlisting>
+ <para>
+ This resource bundle is only accessible for the navigation of the
~~organization.management.executive-board~~ group.
+ </para>
+ <para>
+ 1 Portlet
+ </para>
+ <para>
+ 1.1 classpath.resources
+ </para>
+ <para>
+ Portlets are independent application and they deliver their own resource files. You
can find an example for the GadgetPortlet: <!-- LB -->
.../WEB-INF/classes/locale/portlet/gadget/GadgetPortlet/en.properties <ulink
url="http://fisheye.exoplatform.org/browse/projects/portal/trunk/por...
/>
+ </para>
+ <para>
+ All portlet resources are located in the <emphasis
role="bold">locale/portlet</emphasis> subfolder. The
ResourceBundleService parameter <emphasis
role="bold">classpath.resources</emphasis> defines exactly this
subfolder. Doing so the resource file that are in ~~locale/portlet~~ will never be stored
in the JCR and reloaded at each start of the application server.
+ </para>
+
+<programlisting><values-param>
+ <name>classpath.resources</name>
+ <description>The resources that start with the following package name
should
+ be loaded from file system</description>
+ <value>locale.portlet</value>
+</values-param>
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Overview-Example">
+ <title>Example</title>
+ <para>
+ Let's suppose you want to add a Spanish translation to the GadgetPortlet.
+ </para>
+ <para>
+ Create the file in:
<filename>.../WEB-INF/classes/locale/portlet/gadget/GadgetPortlet</filename>
+ </para>
+ <para>
+ In <emphasis role="bold">portlet.xml</emphasis>, add Spanish as
a <emphasis role="bold">supported-locale</emphasis>, the
<emphasis role="bold">resource-bundle</emphasis> is already declared
and is the same for all languages : {code:xml}
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
<resource-bundle>locale.portlet.gadget.GadgetPortlet</resource-bundle>
{code}
+ </para>
+ <para>
+ Find <ulink type="http"
url="http://developers.sun.com-portalserver-reference-techart-i18n-portlets.html"
/> for more details about portlet internationalization.
+ </para>
+ <para>
+ 1.1 Standard Portlet Resource Keys There are three standard keys defined : Title,
Short Title and Keywords. Keywords contain a comma-separated list of keywords.
+ </para>
+
+<programlisting> javax.portlet.title=Breadcrumbs Portlet
+ javax.portlet.short-title=Breadcrumbs
+ javax.portlet.keywords=Breadcrumbs, Breadcrumb
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Overview-Access">
+ <title>Access</title>
+ <para>
+ Whenever you want to display a property in the user language you use its
<emphasis>key</emphasis>. Using the below access method the translation is
returned in the preferred language of the current http session:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Groovy Template{code}{code}
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Java
+ </para>
+ </listitem>
+ </itemizedlist>
+
+<programlisting>WebuiRequestContext context =
WebuiRequestContext.getCurrentInstance() ;
+ResourceBundle res = context.getApplicationResourceBundle() ;
+String translatedString = res.getString(key);
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Overview-Debugging_resource_bundle_usage">
+ <title>Debugging resource bundle usage</title>
+ <para>
+ When an application needs to be translated, it is never obvious to find out the right
key for a given translated property. When the portal is executed in <emphasis
role="bold">debug mode</emphasis> it is possible to select among the
available languages a special language called <emphasis role="bold">Magic
locale</emphasis>.
+ </para>
+ <para>
+ This feature translates a key to the same key value. For instance, the translated
value for the key "organization.title" is simply the value
"organization.title". Selecting that language allows to use the portal and its
applications with <emphasis role="bold">all the keys
visible</emphasis> and it is easy to find out the correct key for a given label in
the portal page.
+ </para>
+ </section>
+
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml
===================================================================
---
portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/JavaScript_Inter_Application_Communication.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,157 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>JavaScript Inter Application Communication</title>
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Overview">
+ <title>Overview</title>
+ <para>
+ This kind of communication is made to allow applications within a page to exchange
data. This library is made for broadcasting messages on topic. This is basically based on
3 functions : subscribe, publish and unsubscribe.
+ </para>
+ <para>
+ When you subscribe to a topic, you receive all the subtopic message. for example, if I
subscribe to "/GateIn/application", and an application send a message on
"/GateIn/application/map", i will receive it, but if another application send a
message on "/GateIn", i will not receive it.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Common_topics">
+ <title>Common topics</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateIn">
+ <title>/GateIn</title>
+ <para>
+ It contains all the events generated by the platform.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalnotification">
+ <title>/GateIn/portal/notification</title>
+ <para>
+ When a message is sent on this topic, a popup message appears on the top right of the
screen.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalchangeTitle_not_implemented_yet">
+ <title>/GateIn/portal/changeTitle (not implemented yet)</title>
+ <para>
+ Send a message on this channel to change (and to be notified) the title of the
portal.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageLoaded_not_implemented_yet">
+ <title>/GateIn/portal/pageLoaded (not implemented yet)</title>
+ <para>
+ Receive a message when a page is loaded.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInportalpageUnloaded_not_implemented_yet">
+ <title>/GateIn/portal/pageUnloaded (not implemented yet)</title>
+ <para>
+ Receive a message when a page is unloaded.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationLoaded_not_implemented_yet">
+ <title>/GateIn/application/applicationLoaded (not implemented yet)</title>
+ <para>
+ Receive a message when an application is loaded in the page.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-GateInapplicationapplicationUnloaded_not_implemented_yet">
+ <title>/GateIn/application/applicationUnloaded (not implemented
yet)</title>
+ <para>
+ Receive a message when an application is unloaded in the page.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Library">
+ <title>Library</title>
+ <para>
+ The inter application communication
http://fisheye.exoplatform.org/projects/browse/projects/portal/trunk/web/...
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Syntax">
+ <title>Syntax</title>
+
+<programlisting>subscribe is used to subscribe a callback to a topic
+*Parameters:*
+* topic is the topic that will be listened
+* obj is the context object
+* funcName is the name of the function of obj to call when a message is received on the
topic
+funcName have to be a function that take an Object in parameter. the event received have
this format:
+{code:javascript}
+{
+ senderId:senderId,
+ message:message,
+ topic: topic
+}
+</programlisting>
+
+<programlisting>publish is used to publish an event to the other subscribers to the
given channels
+*Parameters:*
+* senderId is a string that identify the sender
+* topic is the topic that the message will be published
+* message is the message that's going to be delivered to the subscribers to the
topic
+</programlisting>
+ <para>
+ unsubscribe is used to unsubscribe a callback to a topic
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Parameters:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ topic is the topic that will be unsubscribe
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ obj is the context object
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ funcName function name givent at the previous subscribe
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-JavaScript_Inter_Application_Communication-Example">
+ <title>Example</title>
+ <para>
+ <ulink
url="http://fisheye.exoplatform.org/projects/browse/projects/portal/...
Demo</ulink>
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,957 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Portal_Lifecycle">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Portal Lifecycle</title>
+ <section id="sect-Reference_Guide-Portal_Lifecycle-Overview">
+ <title>Overview</title>
+ <para>
+ This chapter describes the portal lifecycle from the application server start to its
stop as well as how requests are handled.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portal_Lifecycle-Application_Server_start_and_stop">
+ <title>Application Server start and stop</title>
+ <para>
+ An GateIn Portal instance is simply a web application deployed as a WAR in an
application server. Each portlet is also part of an enhanced WAR that we call a portlet
application. Hence, the portal web.xml file is the main entry point to grab information
about how does the portal start.
+ </para>
+ <para>
+ The web.xml file contains several information such as a listener, a servlet as well as
some security information.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Portal_Lifecycle-The_Listener">
+ <title>The Listener</title>
+ <para>
+ In the web.xml we can find servlet listener:
+ </para>
+
+<programlisting> <!-
================================================================== ->
+ <!- LISTENER
->
+ <!- ==================================================================
->
+ <listener>
+
<listener-class>org.exoplatform.portal.application.PortalSessionListener</listener-class>
+ </listener>
+</programlisting>
+ <para>
+ That listener implements the HttpSessionListener which means it is called each time a
session is created or destroyed; in other words, a session is created each time a user
send a first request to the portal. That session is destroyed when he has not sent request
to the portal for a long time or when he closes his browser.
+ </para>
+
+<programlisting>public class PortalSessionListener implements HttpSessionListener
+</programlisting>
+ <para>
+ Only the destroy method of the Listener object is implemented and it is used to flush
resources when a user portal session expires. Here is the code:
+ </para>
+
+<programlisting> /**
+ * This method is called when a HTTP session of a Portal instance is destroyed.
+ * By default the session time is 30 minutes.
+ *
+ * In this method, we:
+ * 1) first get the portal instance name from where the session is removed.
+ * 2) Get the correct instance object from the Root container
+ * 3) Put the portal instance in the Portal ThreadLocal
+ * 4) Get the main entry point (WebAppController) from the current portal container
+ * 5) Extract from the WebAppController the PortalApplication object which is the entry
point to
+ * the StateManager object
+ * 6) Expire the portal session stored in the StateManager
+ * 7) Finally, removes the WindowInfos object from the WindowInfosContainer container
+ * 8) Flush the threadlocal for the PortalContainer
+ *
+ */
+ public void sessionDestroyed(HttpSessionEvent event) {
+ try {
+ String portalContainerName =
event.getSession().getServletContext().getServletContextName() ;
+ log.warn("Destroy session from " + portalContainerName + "
portal");
+ RootContainer rootContainer = RootContainer.getInstance() ;
+ PortalContainer portalContainer =
rootContainer.getPortalContainer(portalContainerName) ;
+ PortalContainer.setInstance(portalContainer);
+ WebAppController controller =
+
(WebAppController)portalContainer.getComponentInstanceOfType(WebAppController.class) ;
+ PortalApplication portalApp =
controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID) ;
+ portalApp.getStateManager().expire(event.getSession().getId(), portalApp) ;
+
+ WindowInfosContainer.removeInstance(portalContainer, event.getSession().getId());
+ } catch(Exception ex) {
+ log.error("Error while destroying a portal session",ex);
+ } finally {
+ PortalContainer.setInstance(null) ;
+ }
+ }
+</programlisting>
+ <para>
+ 1.1 The Servlet
+ </para>
+ <para>
+ The servlet is the main entry point for incoming requests, it also includes some
interesting init code when the portal is launched.
+ </para>
+ <para>
+ Here is its definition in the web.xml file:
+ </para>
+
+<programlisting> <!--
================================================================== -->
+ <!-- SERVLET
-->
+ <!-- ==================================================================
-->
+ <servlet>
+ <servlet-name>portal</servlet-name>
+
<servlet-class>org.exoplatform.portal.application.PortalController</servlet-class>
+ <init-param>
+ <param-name>webui.configuration</param-name>
+
<param-value>app:/WEB-INF/webui-configuration.xml</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+</programlisting>
+ <para>
+ The load-on-startup tag tells that the init method of the servlet is called when the
application server starts. We also define some configuration for the portal at the path
WEB-INF/webui-configuration.xml inside the portal WAR.
+ </para>
+
+<programlisting>/**
+ * The PortalContainer servlet is the main entry point for the GateIn Portal product.
+ *
+ * Both the init() and service() methods are implemented. The first one is used to
configure all the
+ * portal resources to prepare the platform to receive requests. The second one is used
to handle them.
+ *
+ * Basically, this class is just dispatcher as the real business logic is implemented
inside
+ * the WebAppController class.
+ */
+@SuppressWarnings("serial")
+public class PortalController extends HttpServlet {
+
+ protected static Log log = ExoLogger.getLogger("portal:PortalController");
+
+ /**
+ * The init() method is used to prepare the portal to receive requests.
+ *
+ * 1) Create the PortalContainer and store it inside the ThreadLocal object. The
PortalContainer is
+ * a child of the RootContainer
+ * 2) Get the WebAppController component from the container
+ * 3) Create a new PortalApplication, init it with the ServletConfig object (which
contains init params)
+ * 4) Register that PortalApplication inside WebAppController
+ * 5) Create a new PortalRequestHandler object and register it in the
WebAppController
+ * 6) Release the PortalContainer ThreadLocal
+ */
+ @SuppressWarnings("unchecked")
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config) ;
+ try {
+ RootContainer rootContainer = RootContainer.getInstance() ;
+ PortalContainer portalContainer =
+
rootContainer.getPortalContainer(config.getServletContext().getServletContextName()) ;
+ portalContainer = rootContainer.createPortalContainer(config.getServletContext())
;
+ PortalContainer.setInstance(portalContainer) ;
+ WebAppController controller =
+
(WebAppController)portalContainer.getComponentInstanceOfType(WebAppController.class) ;
+ PortalApplication application = new PortalApplication(config);
+ application.onInit() ;
+ controller.addApplication(application) ;
+ controller.register(new PortalRequestHandler()) ;
+ } catch (Throwable t){
+ throw new ServletException(t) ;
+ } finally {
+ try {
+ PortalContainer.setInstance(null) ;
+ } catch (Exception e) {
+ log.warn("An error occured while cleaning the ThreadLocal", e);
+ }
+ }
+ log.info("Init of PortalController Servlet successful");
+ }
+...
+</programlisting>
+ <para>
+ We see that a PortalApplication class is instantiated, initialized and then referenced
inside the WebAppController. Note that the WebAppController is a component located inside
GateIn IoC service container (and hence registered in one of our service configuration XML
file).
+ </para>
+ <para>
+ The
<code><strong>PortalApplication</strong></code>
extends the
<code><strong>WebuiApplication</strong></code>
which itself extends the
<code><strong>Application</strong></code>
abstract class.
+ </para>
+
+<programlisting>public class PortalApplication extends WebuiApplication {
+
+ protected static Log log = ExoLogger.getLogger("portal:PortalApplication");
+
+ final static public String PORTAL_APPLICATION_ID = "PortalApplication" ;
+
+ private ServletConfig sconfig_ ;
+ private String[] applicationResourceBundleNames_ ;
+
+ /**
+ * The constructor references resource resolvers that allows the
ApplicationResourceResolver to
+ * extract files from different locations such as the current war or external one such
as the resource
+ * one where several static files are shared among all portal instances.
+ *
+ *
+ * @param config, the servlet config that contains init params such as the path
location of
+ * the XML configuration file for the WebUI framework
+ */
+ public PortalApplication(ServletConfig config) throws Exception {
+ sconfig_ = config ;
+ ApplicationResourceResolver resolver = new ApplicationResourceResolver() ;
+ resolver.addResourceResolver(new ServletResourceResolver(config.getServletContext(),
"war:")) ;
+ resolver.addResourceResolver(new ServletResourceResolver(config.getServletContext(),
"app:")) ;
+ resolver.addResourceResolver(new ServletResourceResolver(config.getServletContext(),
"system:")) ;
+ resolver.addResourceResolver(new
ServletResourceResolver(config.getServletContext().getContext("/GateInResources"),
"resources:")) ;
+ setResourceResolver(resolver) ;
+ }
+...
+</programlisting>
+ <para>
+ The main goal of this constructor is to fill an
<code><strong>ApplicationResourceResolver</strong></code>
with several
<code><strong>ResourceResolver</strong></code>
object that will allow the application to check for files such as groovy templates into
different locations. Here the goal of the
<code><strong>ResourceResolver</strong></code>
is to abstract the different mechanisms to extract files from different location. In the
previous code sample the
<code><strong>ServletResourceResolver</strong></code>
is used and hence methods based on the servlet context object are defined. Note that the
<code><strong>ApplicationResourceResolver</strong></code>
is also a class of type
<code><strong>ResourceResolver</strong></code>
but a special one as it can also contains several
<code><strong>ResourceResolver</strong></!
code> itself.
+ </para>
+ <para>
+ Then the
<code><strong>onInit()</strong></code>
method of the
<code><strong>PortalApplication</strong></code>
is called.
+ </para>
+
+<programlisting>/**
+ * This method first calls the super.onInit() of the WebuiApplication. That super
method parse the XML
+ * file and stores its content in the ConfigurationManager object. It also set up he
StateManager and
+ * init the application lifecycle phases.
+ *
+ * Then we get all the properties file that will be used to create ResourceBundles
+ */
+ public void onInit() throws Exception {
+ super.onInit() ;
+ applicationResourceBundleNames_ =
+ getConfigurationManager().getApplication().getInitParams().
+ getParam("application.resource.bundle").getValue().split(",");
+ for(int i = 0; i < applicationResourceBundleNames_.length; i++) {
+ applicationResourceBundleNames_[i] = applicationResourceBundleNames_[i].trim() ;
+ }
+ }
+</programlisting>
+ <para>
+ The
<code><strong>ConfigurationManager</strong></code>
object parses the XML configuration file. The idea of the framework, once again, is to
abstract the type of
<code><strong>webapplication</strong></code>
in used. Hence the
<code><strong>webui-configuration.xml</strong></code>
file is used by both the portal and portlet applications.
+ </para>
+ <para>
+ Here is the
<code><strong>webui-configuration</strong></code>:
+ </para>
+
+<programlisting><webui-configuration>
+ <application>
+ <init-params>
+ <param>
+ <name>application.resource.bundle</name>
+ <value>locale.portal.expression, locale.portal.services,
locale.portal.webui</value>
+ </param>
+ </init-params>
+
<ui-component-root>org.exoplatform.portal.webui.workspace.UIPortalApplication</ui-component-root>
+
<state-manager>org.exoplatform.portal.application.PortalStateManager</state-manager>
+
+ <application-lifecycle-listeners>
+
<listener>org.exoplatform.portal.application.PortalStatisticLifecycle</listener>
+
<listener>org.exoplatform.portal.application.PortalApplicationLifecycle</listener>
+
<listener>org.exoplatform.webui.application.MonitorApplicationLifecycle</listener>
+ </application-lifecycle-listeners>
+ <events>
+ <event>
+
<event-name>portal.application.lifecycle.event</event-name>
+
<listener>org.exoplatform.webui.event.ConsoleEventMonitorListener</listener>
+ </event>
+ <event>
+
<event-name>portal.execution.lifecycle.event</event-name>
+
<listener>org.exoplatform.webui.event.ConsoleEventMonitorListener</listener>
+ </event>
+ </events>
+ </application>
+</webui-configuration>
+</programlisting>
+ <para>
+ In the previous XML file we see that we define several tags such as:
+ </para>
+ <para>
+ 1.1.1 The ui-component-root
+ </para>
+ <para>
+ Here it is the class
<code><strong>org.exoplatform.portal.webui.workspace.UIPortalApplication</strong></code>
which is a class that extends the
<code><strong>UIApplication</strong></code>
and hence is a sibling of
<code><strong>UIPortletApplication</strong></code>
(used by any GateIn Portlets as the Parent class to build the portlet component tree).
+ </para>
+ <para>
+ The
<code><strong>UIPortalApplication</strong></code>
is responsible for building its subtrees - at request time according to some configuration
parameters. If all components are displayed it is composed of 3 UI components:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code><strong>UIControlWorkSpace</strong></code>
: the left expandable column that can contains gadget containers and the start menu
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code><strong>UIWorkingWorkSpace</strong></code>:
the right part that can display the normal or webos portal layouts.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code><strong>UIPopupWindow</strong></code>:
a popup window that display or not.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The
<code><strong>UIPortalApplication</strong><code>
constructor is shown next and is the starting point to build the UI Component tree to
which Pages and Portlets will also be mounted. We will not describe that behavior here.
+ </para>
+
+<programlisting>/**
+ * The constructor of this class is used to build the tree of UI components that will
be aggregated
+ * in the portal page.
+ *
+ * 1) The component is stored in the current PortalRequestContext ThreadLocal
+ * 2) The configuration for the portal associated with the current user request is
extracted from the
+ * PortalRequestContext
+ * 3) Then according to the context path, either a public or private portal is
initiated. Usually a public
+ * portal does not contain the left column and only the private one has it.
+ * 4) The skin to use is setup
+ * 5) Finally, the current component is associated with the current portal owner
+ *
+ * @throws Exception
+ */
+ public UIPortalApplication() throws Exception {
+ log = ExoLogger.getLogger("portal:UIPortalApplication");
+ PortalRequestContext context = PortalRequestContext.getCurrentInstance() ;
+ userPortalConfig_ = (UserPortalConfig)context.getAttribute(UserPortalConfig.class);
+ if(userPortalConfig_ == null) throw new Exception("Can't load user portal
config");
+
+ // dang.tung - set portal language by user preference -> browser ->
default
+ //----
+ String portalLanguage = null ;
+ LocaleConfigService localeConfigService =
getApplicationComponent(LocaleConfigService.class) ;
+ OrganizationService orgService = getApplicationComponent(OrganizationService.class)
;
+ LocaleConfig localeConfig =
localeConfigService.getLocaleConfig(userPortalConfig_.getPortalConfig().getLocale());
+ String user = context.getRemoteUser();
+ if(user!images/= null) {
+ UserProfile userProfile =
orgService.getUserProfileHandler().findUserProfileByName(user) ;
+ if(userProfile!images/= null) {
+ portalLanguage = userProfile.getUserInfoMap().get("user.language") ;
+ } else {
+ if (log.isWarnEnabled()) log.warn("Could not load user profile for " +
user + ". Using default portal locale.");
+ }
+ }
+ localeConfig = localeConfigService.getLocaleConfig(portalLanguage) ;
+ if(portalLanguage == null
||!images/portalLanguage.equals(localeConfig.getLanguage())) {
+ // if user language no support by portal -> get browser language if no
-> get portal
+ portalLanguage = context.getRequest().getLocale().getLanguage() ;
+ localeConfig = localeConfigService.getLocaleConfig(portalLanguage) ;
+ if(!portalLanguage.equals(localeConfig.getLanguage())) {
+ localeConfig =
localeConfigService.getLocaleConfig(userPortalConfig_.getPortalConfig().getLocale()) ;
+ }
+ }
+ setLocale(localeConfig.getLocale()) ;
+ setOrientation(localeConfig.getOrientation());
+ //----
+ context.setUIApplication(this);
+ UserACL acl = getApplicationComponent(UserACL.class);
+ if(acl.hasAccessControlWorkspacePermission(context.getRemoteUser()))
+ addChild(UIControlWorkspace.class, UIPortalApplication.UI_CONTROL_WS_ID, null) ;
+ addWorkingWorkspace() ;
+ String currentSkin = userPortalConfig_.getPortalConfig().getSkin();
+ if(currentSkin!images/= null && currentSkin.trim().length() >
0) skin_ = currentSkin;
+ setOwner(context.getPortalOwner());
+ }
+...
+</programlisting>
+ <para>
+ 1.1.1 The StateManager
+ </para>
+ <para>
+ The
<code><strong>StateManager</strong></code>
here is in the
<code><strong>org.exoplatform.portal.application</strong></code>
package which is an abstract class.
+ </para>
+
+<programlisting>abstract public class StateManager {
+ abstract public UIApplication restoreUIRootComponent(WebuiRequestContext context)
throws Exception ;
+ abstract public void storeUIRootComponent(WebuiRequestContext context) throws Exception
;
+ abstract public void expire(String sessionId, WebuiApplication app) throws Exception ;
+}
+</programlisting>
+ <para>
+ The goal of the
<code><strong>StateManager</strong></code>
is to abstract the way
<code><strong>UIApplication</strong></code>
are stored and restored for all the user session lifetime. The expire method is called
from the listener we have introduced before in this chapter.
+ </para>
+ <para>
+ 1.1.1 The application-lifecycle-listeners
+ </para>
+ <para>
+ There are 2 lifecycle listeners in the Portal, one for the real business logic
(<code><strong>PortalApplicationLifecycle</strong></code>),
the other one for some monitoring issues. They both implement the interface
<code><strong>ApplicationLifecycle<E extends
RequestContext></strong></code>.
+ </para>
+
+<programlisting>public interface ApplicationLifecycle<E extends
RequestContext> {
+
+ public void onInit(Application app) throws Exception ;
+ public void onStartRequest(Application app, E context) throws Exception ;
+ public void onEndRequest(Application app, E context) throws Exception ;
+ public void onDestroy(Application app) throws Exception ;
+
+}
+</programlisting>
+ <para>
+ Each registered lifecycle listener will then be able to get events when several states
of the portal lifecycle are reached.
+ </para>
+ <para>
+ 1.1 The Request Handler
+ </para>
+ <para>
+ Once started and fully configured, the portal application WAR can handle HTTP
requests.
+ </para>
+ <para>
+ The entry point is for sure the PortalController servlet we have already seen in the
current chapter and defined in the
<code><strong>web.xml</strong></code>
of the portal context.
+ </para>
+
+<programlisting>...
+ /**
+ * This method simply delegates the incoming call to the WebAppController stored in the
Portal Container object
+ */
+ public void service(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
+ try {
+ ServletConfig config = getServletConfig() ;
+ RootContainer rootContainer = RootContainer.getInstance() ;
+ PortalContainer portalContainer =
+
rootContainer.getPortalContainer(config.getServletContext().getServletContextName()) ;
+ PortalContainer.setInstance(portalContainer) ;
+ WebAppController controller =
+
(WebAppController)portalContainer.getComponentInstanceOfType(WebAppController.class) ;
+ controller.service(req, res) ;
+ } catch (Throwable t){
+ throw new ServletException(t) ;
+ } finally {
+ try {
+ PortalContainer.setInstance(null) ;
+ } catch (Exception e) {
+ log.warn("An error occured while cleaning the ThreadLocal", e);
+ }
+ }
+...
+</programlisting>
+ <para>
+ The
<code><strong>WebAppController</strong></code>
is also a simple class on which several handlers can be bound. We have already seen that
the
<code><strong>PortalRequestHandler</strong></code>
was already added in the init method of the servlet.
+ </para>
+
+<programlisting>...
+/**
+ * The WebAppControler along with the PortalRequestHandler defined in the init() method
of the
+ * PortalController servlet (controller.register(new PortalRequestHandler())) also add
the
+ * CommandHandler object that will listen for the incoming /command path in the URL
+ *
+ * @throws Exception
+ */
+ public WebAppController() throws Exception {
+ applications_ = new HashMap<String, Application>() ;
+ attributes_ = new HashMap<String, Object>() ;
+ handlers_ = new HashMap<String, WebRequestHandler>() ;
+ register(new CommandHandler()) ;
+ }
+...
+</programlisting>
+ <para>
+ Then the service method - modelled according to the servlet specification is called:
+ </para>
+
+<programlisting>...
+ /**
+ * This is the first method - in the GateIn web framework - reached by incoming HTTP
request, it acts like a
+ * servlet service() method
+ *
+ * According to the servlet path used the correct handler is selected and then
executed.
+ *
+ * The event "exo.application.portal.start-http-request" and
"exo.application.portal.end-http-request" are also sent
+ * through the ListenerService and several listeners may listen to it.
+ *
+ * Finally a WindowsInfosContainer object using a ThreadLocal (from the
portlet-container product) is created
+ */
+ public void service(HttpServletRequest req, HttpServletResponse res) throws Exception
{
+ WebRequestHandler handler = handlers_.get(req.getServletPath()) ;
+ if(log.isDebugEnabled()) {
+ log.debug("Servlet Path: " + req.getServletPath());
+ log.debug("Handler used for this path: " + handler);
+ }
+ if(handler!images/= null) {
+ ExoContainer portalContainer = ExoContainerContext.getCurrentContainer();
+ List<ComponentRequestLifecycle> components =
+ portalContainer.getComponentInstancesOfType(ComponentRequestLifecycle.class) ;
+ try {
+ for(ComponentRequestLifecycle component : components) {
+ component.startRequest(portalContainer);
+ }
+ WindowInfosContainer.createInstance(portalContainer, req.getSession().getId(),
req.getRemoteUser());
+
+ handler.execute(this, req, res) ;
+ } finally {
+ WindowInfosContainer.setInstance(null);
+ for(ComponentRequestLifecycle component : components) {
+ try {
+ component.endRequest(portalContainer);
+ } catch (Exception e) {
+ log.warn("An error occured while calling the endRequest method",
e);
+ }
+ }
+ }
+ }
+...
+</programlisting>
+ <para>
+ The handler in the portal case is the
<code><strong>PortalRequestHandler</strong></code>
which extends
<code><strong>WebRequestHandler</strong></code>
and that implement the abstract methods, mainly the execute() one.
+ </para>
+
+<programlisting>/**
+ * Created by The GateIn Platform SAS
+ * Mar 21, 2007
+ *
+ * Abstract class that one must implement if it want to provide a dedicated handler for a
custom servlet path
+ *
+ * In case of portal the path is /portal but you could return your own from the getPath()
method and hence the
+ * WebAppController would use your own handler
+ *
+ * The execute method is to be overideen and the buisness logic should be handled here
+ */
+abstract public class WebRequestHandler {
+
+ public void onInit(WebAppController controller) throws Exception{
+
+ }
+
+ abstract public String[] getPath() ;
+ abstract public void execute(WebAppController app, HttpServletRequest req,
HttpServletResponse res) throws Exception ;
+
+ public void onDestroy(WebAppController controler) throws Exception {
+
+ }
+}
+</programlisting>
+ <para>
+ Here is the main class and the entire algorithm is described in the javadoc:
+ </para>
+
+<programlisting>/**
+ * Created by The GateIn Platform SAS
+ * Dec 9, 2006
+ *
+ * This class handle the request that target the portal paths /public and /private
+ *
+ */
+public class PortalRequestHandler extends WebRequestHandler {
+
+ protected static Log log =
ExoLogger.getLogger("portal:PortalRequestHandler");
+ static String[] PATHS = {"/public", "/private"} ;
+ public String[] getPath() { return PATHS ; }
+ /**
+ * This method will handle incoming portal request. It gets a reference to the
WebAppController
+ *
+ * Here are the steps done in the method:
+ *
+ * 1) set the header Cache-Control to no-cache
+ * 2) Get the PortalApplication reference from the controller
+ * 3) Create a PortalRequestContext object that is a convenient wrapper on all the
request information
+ * 4) Set that context in a ThreadLocal to easily access it
+ * 5) Get the collection of ApplicationLifecycle referenced in the PortalApplication
and defined in the
+ * webui-configuration.xml of the portal application
+ * 6) Call onStartRequest() on each ApplicationLifecycle object
+ * 7) Get the StateManager object from the PortalApplication (also referenced in the
XML file)
+ * 8) Use the StateManager to get a reference on the root UI component:
UIApplication; the method used is
+ * restoreUIRootComponent(context)
+ * 9) If the UI component is not the current one in used in the PortalContextRequest,
then replace it
+ * 10) Process decode on the PortalApplication
+ * 11) Process Action on the PortalApplication
+ * 12) Process Render on the UIApplication UI component
+ * 11) call onEndRequest on all the ApplicationLifecycle
+ * 12) Release the context from the thread
+ *
+ */
+ @SuppressWarnings("unchecked")
+ public void execute(WebAppController controller, HttpServletRequest req,
HttpServletResponse res) throws Exception {
+ log.debug("Session ID = " + req.getSession().getId());
+ res.setHeader("Cache-Control", "no-cache");
+
+ PortalApplication app =
controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID) ;
+ WebuiRequestContext context = new PortalRequestContext(app, req, res) ; ;
+ WebuiRequestContext.setCurrentInstance(context) ;
+ List<ApplicationLifecycle> lifecycles = app.getApplicationLifecycle();
+ try {
+ for(ApplicationLifecycle lifecycle : lifecycles) lifecycle.onStartRequest(app,
context) ;
+ UIApplication uiApp = app.getStateManager().restoreUIRootComponent(context) ;
+ if(context.getUIApplication()!images/= uiApp) context.setUIApplication(uiApp) ;
+
+ if(uiApp!images/= null) app.processDecode(uiApp, context) ;
+
+ if(!images/context.isResponseComplete() &&!images/
context.getProcessRender()) {
+ app.processAction(uiApp, context) ;
+ }
+
+ if(!context.isResponseComplete()) uiApp.processRender(context) ;
+
+ if(uiApp!images/= null) uiApp.setLastAccessApplication(System.currentTimeMillis())
;
+ } catch(Exception ex){
+ log.error("Error while handling request",ex);
+ } finally {
+ try {
+ for(ApplicationLifecycle lifecycle : lifecycles) lifecycle.onEndRequest(app,
context) ;
+ } catch (Exception exception){
+ log.error("Error while ending request on all
ApplicationLifecycle",exception);
+ }
+ WebuiRequestContext.setCurrentInstance(null) ;
+ }
+ }
+</programlisting>
+ <para>
+ The PortalRequestContext class is an important one as it is used in many places. The
PortalRequestContext class wraps most of the request information. Accessing it from
everywhere is quite simple as the object is stored in a ThreadLocal one, which means it
bound to the current request thread. Hence a single call to
WebuiRequestContext.getCurrentContext() will return the correct PortalRequestContext.
+ </para>
+ <para>
+ As you can see, the PortalRequestContext extends the WebuiRequestContext one which
also extends the abstract class RequestContext. Once again this hierarchy is to abstract
the type of context in use , would it be a portal or portlet one.
+ </para>
+
+<programlisting>/**
+ * Created by The GateIn Platform SAS
+ * May 7, 2006
+ *
+ * This abstract class is a wrapper on top of the request information such as the Locale
in use,
+ * the application (for instance PortalApplication, PortletApplication...), an access to
the JavascriptManager
+ * as well as a reference to the URLBuilder in use.
+ *
+ * It also contains a ThreadLocal object for an easy access.
+ *
+ * Context can be nested and hence a getParentAppRequestContext() is also available
+ *
+ */
+abstract public class RequestContext {
+
+ final static public String ACTION = "op";
+ private static ThreadLocal<RequestContext> tlocal_ = new
ThreadLocal<RequestContext>() ;
+
+ private Application app_ ;
+ protected RequestContext parentAppRequestContext_ ;
+ private Map<String, Object> attributes ;
+
+ protected URLBuilder urlBuilder;
+
+ public RequestContext(Application app) {
+ app_ = app ;
+ }
+
+ public Application getApplication() { return app_ ; }
+
+ public Locale getLocale() { return parentAppRequestContext_.getLocale() ; }
+
+ public ResourceBundle getApplicationResourceBundle() { return null; }
+
+ abstract public String getRequestParameter(String name) ;
+ abstract public String[] getRequestParameterValues(String name) ;
+
+ public JavascriptManager getJavascriptManager() {
+ return getParentAppRequestContext().getJavascriptManager() ;
+ }
+
+ abstract public URLBuilder getURLBuilder() ;
+
+ public String getRemoteUser() { return parentAppRequestContext_.getRemoteUser() ; }
+ public boolean isUserInRole(String roleUser) { return
parentAppRequestContext_.isUserInRole(roleUser) ; }
+
+
+ abstract public boolean useAjax() ;
+ public boolean getFullRender() { return true; }
+
+ public ApplicationSession getApplicationSession() {
+ throw new RuntimeException("This method is not supported");
+ }
+
+ public Writer getWriter() throws Exception { return
parentAppRequestContext_.getWriter() ; }
+
+ final public Object getAttribute(String name) {
+ if(attributes == null) return null ;
+ return attributes.get(name) ;
+ }
+
+ final public void setAttribute(String name, Object value) {
+ if(attributes == null) attributes = new HashMap<String, Object>() ;
+ attributes.put(name, value) ;
+ }
+
+ final public Object getAttribute(Class type) { return getAttribute(type.getName()) ;
}
+ final public void setAttribute(Class type, Object value) {
setAttribute(type.getName(), value) ; }
+
+ public RequestContext getParentAppRequestContext() { return parentAppRequestContext_ ;
}
+ public void setParentAppRequestContext(RequestContext context) {
parentAppRequestContext_ = context ; }
+
+ @SuppressWarnings("unchecked")
+ public static <T extends RequestContext> T getCurrentInstance() { return
(T)tlocal_.get() ; }
+ public static void setCurrentInstance(RequestContext ctx) { tlocal_.set(ctx) ; }
+}
+</programlisting>
+ <para>
+ The WebuiRequestContext abstract class extends the RequestContext one and adds method
for a Web environment such as accesses to the request and response objects or a list of
components to update when using an Ajax call. More in the following header of the class:
+ </para>
+
+<programlisting>/**
+ * Created by The GateIn Platform SAS
+ * May 7, 2006
+ *
+ * The main class to manage the request context in a webui environment
+ *
+ * It adds:
+ * - some access to the root UI component (UIApplication)
+ * - access to the request and response objects
+ * - information about the current state of the request
+ * - the list of object to be updated in an AJAX way
+ * - an access to the ResourceResolver bound to an uri scheme
+ * - the reference on the StateManager object
+ */
+abstract public class WebuiRequestContext extends RequestContext {
+
+ protected UIApplication uiApplication_ ;
+ protected String sessionId_ ;
+ protected ResourceBundle appRes_ ;
+ private StateManager stateManager_ ;
+ private boolean responseComplete_ = false ;
+ private boolean processRender_ = false ;
+ private Throwable executionError_ ;
+ private ArrayList<UIComponent> uicomponentToUpdateByAjax ;
+
+ public WebuiRequestContext(Application app) {
+ super(app) ;
+ }
+
+ public String getSessionId() { return sessionId_ ; }
+ protected void setSessionId(String id) { sessionId_ = id ;}
+
+ @SuppressWarnings("unchecked")
+ public UIApplication getUIApplication() { return uiApplication_ ; }
+
+ public void setUIApplication(UIApplication uiApplication) throws Exception {
+ uiApplication_ = uiApplication ;
+ appRes_ = getApplication().getResourceBundle(uiApplication.getLocale()) ;
+ }
+
+ public Locale getLocale() { return uiApplication_.getLocale() ;}
+
+ public ResourceBundle getApplicationResourceBundle() { return appRes_ ; }
+
+ public String getActionParameterName() { return WebuiRequestContext.ACTION ; }
+
+ public String getUIComponentIdParameterName() { return UIComponent.UICOMPONENT; }
+
+ abstract public String getRequestContextPath() ;
+
+ abstract public <T> T getRequest() throws Exception ;
+
+ abstract public <T> T getResponse() throws Exception ;
+
+ public Throwable getExecutionError() { return executionError_ ; }
+
+ public List<UIComponent> getUIComponentToUpdateByAjax() { return
uicomponentToUpdateByAjax ; }
+
+ public boolean isResponseComplete() { return responseComplete_ ;}
+
+ public void setResponseComplete(boolean b) { responseComplete_ = b ; }
+
+ public boolean getProcessRender() { return processRender_ ;}
+
+ public void setProcessRender(boolean b) { processRender_ = b; }
+
+ public void addUIComponentToUpdateByAjax(UIComponent uicomponent) {
+ if(uicomponentToUpdateByAjax == null) {
+ uicomponentToUpdateByAjax = new ArrayList<UIComponent>() ;
+ }
+ uicomponentToUpdateByAjax.add(uicomponent) ;
+ }
+
+ public ResourceResolver getResourceResolver(String uri) {
+ Application app = getApplication() ;
+ while(app!images/= null) {
+ ApplicationResourceResolver appResolver = app.getResourceResolver() ;
+ ResourceResolver resolver = appResolver.getResourceResolver(uri) ;
+ if(resolver !images/= null) return resolver ;
+ RequestContext pcontext = getParentAppRequestContext() ;
+ if(pcontext!images/= null) app = pcontext.getApplication() ;
+ else app =null ;
+ }
+ return null ;
+ }
+
+ public StateManager getStateManager() { return stateManager_; }
+ public void setStateManager(StateManager manager) { stateManager_ = manager ; }
+}
+</programlisting>
+ <para>
+ The PortalRequestContext mainly implements the abstract method already shown and only
add few ones such as a reference to the portal owner or some information on the current
navigation node path and the state of the portal (PUBLIC or PRIVATE ones)
+ </para>
+ <para>
+ The PortalRequestHandler then tries to restore the UI component tree by calling the
method restoreUIRootComponent(). The first time, there is nothing to restore and in that
case the following part of code in the method is used:
+ </para>
+
+<programlisting> if(state == null) {
+ synchronized(uiApplications) {
+ ConfigurationManager cmanager = app.getConfigurationManager() ;
+ String uirootClass = cmanager.getApplication().getUIRootComponent() ;
+ Class type =
Thread.currentThread().getContextClassLoader().loadClass(uirootClass) ;
+ UserPortalConfig config = getUserPortalConfig(pcontext) ;
+ if(config == null) {
+ HttpServletResponse response = pcontext.getResponse();
+ response.sendRedirect("/portal/portal-warning.html");
+ pcontext.setResponseComplete(true);
+ return null;
+ }
+ pcontext.setAttribute(UserPortalConfig.class, config);
+ UIPortalApplication uiApplication =
+ (UIPortalApplication)app.createUIComponent(type,
config.getPortalConfig().getFactoryId(), null, context) ;
+ state = new PortalApplicationState(uiApplication, pcontext.getAccessPath()) ;
+ uiApplications.put(context.getSessionId(), state) ;
+ PortalContainer pcontainer = (PortalContainer)
app.getApplicationServiceContainer() ;
+ pcontainer.createSessionContainer(context.getSessionId(),
uiApplication.getOwner()) ;
+ }
+ }
+</programlisting>
+ <para>
+ The configuration manager object bound to the PortalApplication one is used to get the
type for the root component which is then instanciated. the UserPortalConfig object -
which is wrapper around the portal information for a given user - is also used and stored
as an attribute in the PortalRequestContext. The UIPortalApplication is then created using
the method createUIComponent() that is responsible of instanciating the component but also
to configure it.
+ </para>
+
+<programlisting> public <T extends UIComponent> T
createUIComponent(Class<T> type, String configId, String id,
WebuiRequestContext context) throws Exception{
+ Component config = configManager_.getComponentConfig(type, configId) ;
+ if(config == null) {
+ throw new Exception("Cannot find the configuration for the component " +
type.getName() + ", configId " +configId) ;
+ }
+ T uicomponent = Util.createObject(type, config.getInitParams());
+ uicomponent.setComponentConfig(id, config) ;
+ config.getUIComponentLifecycle().init(uicomponent, context) ;
+ return type.cast(uicomponent) ;
+ }
+</programlisting>
+ <para>
+ The ConfigurationManager method getComponentConfig() returns the Component object
filled, it is a wrapper that contains all the information on the parameters for the class.
Annotations are used to configure the instance as shown here:
+ </para>
+
+<programlisting>@ComponentConfigs({
+ @ComponentConfig (
+ lifecycle = UIPortalApplicationLifecycle.class,
+ template =
"system:/groovy/portal/webui/workspace/UIPortalApplication.gtmpl",
+ initParams = @ParamConfig(name = "public.showControlWorkspace", value =
"true" )
+ ),
+ @ComponentConfig (
+ id = "office" ,
+ lifecycle = UIPortalApplicationLifecycle.class,
+ template =
"system:/groovy/portal/webui/workspace/UIPortalApplication.gtmpl",
+ initParams = @ParamConfig( name = "public.showControlWorkspace", value =
"false" )
+ )
+})
+</programlisting>
+ <para>
+ The processDecode() method of the UIPortalApplication is doing 3 actions:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ if the nodePath is null (case of the first request) a call to
super.processDecode(context) is made and we end the method here
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if the nodePath exist but is equals to the current one then we also call super and
stops here
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ if the requested nodePath is not equals to the current one , then an event of type
PageNodeEvent.CHANGE<emphasis>PAGE</emphasis>NODE is sent to the asociated
EventListener; a call to super is then done
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The first case it simply does nothing. Note that the super.processDecode() goes up to
the UIComponent which also calls the processDecode() method on the Lifecycle object that
can be associated with the UIComponent
+ </para>
+ <para>
+ The processAction() method of the UIPortalApplication is then called, as there is no
method in the object itself it will call the processAction() of the
UIPortalApplicationLifecycle bound to the UI component:
+ </para>
+
+<programlisting> public void processAction(UIComponent uicomponent,
WebuiRequestContext context) throws Exception {
+ UIPortalApplication uiApp = (UIPortalApplication) uicomponent ;
+ String componentId =
context.getRequestParameter(context.getUIComponentIdParameterName()) ;
+ if(componentId == null) return;
+ UIComponent uiTarget = uiApp.findComponentById(componentId);
+ if(uiTarget == null) return ;
+ if(uiTarget == uicomponent) super.processAction(uicomponent, context) ;
+ uiTarget.processAction(context) ;
+ }
+</programlisting>
+ <para>
+ If no uicomponent object is targeted, which is the case the first time (unless a
bookmarked link is used) then nothing is done. Otherwise, the targeted component is
extracted and a call of its processAction() method is executed.
+ </para>
+ <para>
+ Then it is time to render the content and this is done inside the processRender()
method. The method of the UIPortalApplication is shown here and it is the one that handles
either full portal generation or AJAX request:
+ </para>
+
+<programlisting> /**
+ * The processrender() method handles the creation of the returned HTML either for a
full
+ * page render or in the case of an AJAX call
+ *
+ * The first request, Ajax is not enabled (means no ajaxRequest parameter in the
request) and
+ * hence the super.processRender() method is called. This will hence call the
processrender() of
+ * the Lifecycle object as this method is not overidden in
UIPortalApplicationLifecycle. There we
+ * simply render the bounded template (groovy usually). Note that bounded template are
also defined
+ * in component annotations, so for the current class it is UIPortalApplication.gtmpl
+ *
+ * On second calls, request have the "ajaxRequest" parameter set to true in
the URL. In that case
+ * the algorithm is a bit more complex:
+ *
+ * a) The list of components that should be updated is extracted using the
+ * context.getUIComponentToUpdateByAjax() method. That list was setup during the
process action
+ * phase
+ * b) Portlets and other UI components to update are split in 2 different lists
+ * c) Portlets full content are returned and set with the tag <div
class="PortalResponse">
+ * d) Block to updates (which are UI components) are set within
+ * the <div class="PortalResponseData"> tag
+ * e) Then the scripts and the skins to reload are set in the <div
class="PortalResponseScript">
+ *
+ */
+ public void processRender(WebuiRequestContext context) throws Exception {
+ Writer w = context.getWriter() ;
+ if(!context.useAjax()) {
+ super.processRender(context) ;
+ } else {
+ PortalRequestContext pcontext = (PortalRequestContext)context;
+ List<UIComponent> list = context.getUIComponentToUpdateByAjax() ;
+ List<UIPortlet> uiPortlets = new
ArrayList<UIPortlet>(3);
+ List<UIComponent> uiDataComponents = new
ArrayList<UIComponent>(5);
+ if(list!images/= null) {
+ for(UIComponent uicomponent : list) {
+ if(uicomponent instanceof UIPortlet) uiPortlets.add((UIPortlet)uicomponent) ;
+ else uiDataComponents.add(uicomponent) ;
+ }
+ }
+ w.write("<div class=\"PortalResponse\">") ;
+ if(!context.getFullRender()) {
+ for(UIPortlet uiPortlet : uiPortlets) {
+ uiPortlet.processRender(context) ;
+ }
+ }
+ w. write("<div class=\"PortalResponseData\">");
+ for(UIComponent uicomponent : uiDataComponents) {
+ renderBlockToUpdate(uicomponent, context, w) ;
+ }
+ String skin = getAddSkinScript(list);
+ w. write("</div>");
+ w. write("<div
class=\"PortalResponseScript\">");
+ w. write(pcontext.getJavascriptManager().getJavascript());
+ w. write("GateIn.core.Browser.onLoad();\n");
+ w. write(pcontext.getJavascriptManager().getCustomizedOnLoadScript()) ;
+ if(skin!images/= null){
+ w. write(skin) ;
+ }
+ w. write("</div>") ;
+ w.write("</div>") ;
+ }
+ }
+</programlisting>
+ </section>
+
+</section>
+
+
Added:
portal/trunk/docs/reference-guide/en/modules/development/Right_To_Left_Framework.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Right_To_Left_Framework.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Right_To_Left_Framework.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,168 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-RTL_Right_To_Left_Framework">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>RTL (Right To Left) Framework</title>
+ <section
id="sect-Reference_Guide-RTL_Right_To_Left_Framework-Overview">
+ <title>Overview</title>
+ <para>
+ The RTL framework (Right-To-Left framework) provides a set of tools that can be
leveraged by the user interface components to handle directionality gracefully.
+ </para>
+ <para>
+ <object width="400" height="300"><param
name="allowfullscreen" value="true" /><param
name="allowscriptaccess" value="always" /><param
name="movie"
value="http://vimeo.com/moogaloop.swf?clip<emphasis>id=2870309...
/><embed
src="http://vimeo.com/moogaloop.swf?clip<emphasis>id=2870309&a...
type="application/x-shockwave-flash" allowfullscreen="true"
allowscriptaccess="always" width="400"
height="300"></embed></object><br
/><a
href="http://vimeo.com/">GateIn Portal: RTL - Arabic
support</a> from <a
href="http://vimeo.com/user896168">Benjamin Mestrallet</a>
on <a href="http://vimeo.com">Vimeo</a>.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-RTL_Right_To_Left_Framework-Direction">
+ <title>Direction</title>
+ <para>
+ The orientation depends on the current locale and during a portal request the current
orientation is made available by various means. The orientation is a Java 5 enum that
provides a set of functionalities:
+ </para>
+
+<programlisting>
+ LT, // Western Europe
+ RT, // Middle East (Arabic, Hebrew)
+ TL, // Japanese, Chinese, Korean
+ TR; // Mongolian
+ public boolean isLT() { ... }
+ public boolean isRT() { ... }
+ public boolean isTL() { ... }
+ public boolean isTR() { ... }
+}{code}
+The object defining the current Orientation for the current request is the
UIPortalApplication. However it should be accessed at runtime using the RequestContext
that delegates to the UIPortalApplication. In the case of a PortalRequestContext it is a
direct delegate as the PortalRequestContext has a reference to the current
UIPortalApplication. In case of a different context such as the PortletRequestContext, it
delegates to the parent context given the fact that the root RequestContext is always a
PortalRequestContext.
+h1. Usage in different layers
+h2. Java
+Orientation is obtained from the RequestContext:
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-RTL_Right_To_Left_Framework-Groovy_templates">
+ <title>Groovy templates</title>
+ <para>
+ Orientation is obtained from implicit variables defined by the groovy binding
context:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ orientation : the current orientation as an Orientation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ isLT : the value of orientation.isLT()
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ isRT : the value of orientation.isRT()
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ dir : the string ltr if the orientation is LT or the string rtl if the orientation
is RT
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-RTL_Right_To_Left_Framework-Stylesheet">
+ <title>Stylesheet</title>
+ <para>
+ The skin service handles stylesheet rewriting to accommodate the orientation. It works
by appending -lt or -rt to the stylesheet name. For instance <emphasis
role="bold">/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet-rt.css</emphasis>
will return the same stylesheet as <emphasis
role="bold">/web/skin/portal/webui/component/UIFooterPortlet/DefaultStylesheet.css</emphasis>
but processed for the RT orientation. Obviously the -lt suffix is optional.
+ </para>
+ <para>
+ Stylesheet authors can annotate their stylesheet to create content that depends on the
orientation.
+ </para>
+ <para>
+ In the example we need to use the orientation to modify the float attribute that will
make the horizontal tabs either float on left or on right:
+ </para>
+
+<programlisting> float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ font-weight: bold;
+ text-align: center;
+ white-space: nowrap;
+}{code}
+The LT output will be:
+</programlisting>
+ <para>
+ float: left; /<emphasis role="bold">orientation=lt</emphasis>{/
font-weight: bold; text-align: center; white-space: nowrap; }{code}
+ </para>
+ <para>
+ The RT output will be:
+ </para>
+
+<programlisting> float: right; /* orientation=rt */
+ font-weight: bold;
+ text-align: center;
+ white-space: nowrap;
+}{code}
+In this example we need to modify the padding according to the orientation:
+</programlisting>
+ <para>
+ color: white; line-height: 24px; padding: 0px 5px 0px 0px; /<emphasis
role="bold">orientation=lt</emphasis>/ padding: 0px 0px 0px 5px;
/<emphasis role="bold">orientation=rt</emphasis>{/ }{code}
+ </para>
+ <para>
+ The LT output will be:
+ </para>
+
+<programlisting> color: white;
+ line-height: 24px;
+ padding: 0px 5px 0px 0px; /* orientation=lt */
+}{code}
+The RT output will be:
+</programlisting>
+ <para>
+ color: white; line-height: 24px; padding: 0px 0px 0px 5px; /<emphasis
role="bold">orientation=rt</emphasis>{/ }{code}
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-RTL_Right_To_Left_Framework-Images">
+ <title>Images</title>
+ <para>
+ Sometime it is necessary to create an RT version of an image that will be used from a
template or from a stylesheet. However symmetric images can be automatically generated
avoiding the necessity to create a mirrored version of an image and furthermore avoiding
maintenance cost.
+ </para>
+ <para>
+ The web resource filter uses the same naming pattern than the skin service does. When
an image ends with the -rt suffix the portal will attempt to locate the original image and
create a mirror of it. For instance requesting the image <emphasis
role="bold">/GateInResources/skin/DefaultSkin/webui/component/UITabSystem/UITabs/background/NormalTabStyle-rt.gif</emphasis>
returns a mirror of the image <emphasis
role="bold">/GateInResources/skin/DefaultSkin/webui/component/UITabSystem/UITabs/background/NormalTabStyle.gif</emphasis>
and it works perfectly because the image is symmetric.
+ </para>
+ <para>
+ Here is an example combining stylesheet and images:
+ </para>
+
+<programlisting> line-height: 24px;
+ background: url('background/NavigationTab.gif') no-repeat right top; /*
orientation=lt */
+ background: url('background/NavigationTab-rt.gif') no-repeat left top; /*
orientation=rt */
+ padding-right: 2px; /* orientation=lt */
+ padding-left: 2px; /* orientation=rt */
+}{code}
+h2. Client side JavaScript
+Just use the *GateIn.core.I18n* object that provides the following methods:
+* getOrientation() : returns either the string lt or rt
+* getDir() : returns either the string ltr or rtl
+* isLT() : returns true for LT
+* isRT() : returns true of RT
+</programlisting>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/Upload_Component.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,151 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Upload_Component">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Upload Component</title>
+ <section id="sect-Reference_Guide-Upload_Component-Overview">
+ <title>Overview</title>
+ <para>
+ In this article, you will learn how to :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ configure the Upload service
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ add a default upload size limit
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ use the Upload component in your application, with a specific upload size limit
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ clean the service when the upload finishes
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The size limit feature is available since Portal 2.5.3
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Upload_Component-Upload_Service">
+ <title>Upload Service</title>
+ <para>
+ The service is defined by the class : org.exoplatform.upload.UploadService;
+ </para>
+ <para>
+ You can configure it with the following xml code :
+ </para>
+
+<programlisting><component>
+ <type>org.exoplatform.upload.UploadService</type>
+ <init-params>
+ <value-param>
+ <name>upload.limit.size</name>
+ <description>Maximum size of the file to upload in
MB</description>
+ <value>10</value>
+ </value-param>
+ </init-params>
+ </component>
+</programlisting>
+ <para>
+ As you can see, you can configure a default upload size limit for the service. The
value unit is in MegaBytes. This limit will be used by default by all applications if no
specific limit is set. You will see in the next chapter how to set a different limit for
your application.
+ </para>
+ <para>
+ If you set the value at 0, the upload size will be unlimited.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Upload_Component-How_to_use_the_upload_component_in_your_application">
+ <title>How to use the upload component in your application</title>
+ <para>
+ To use the component, you must create an object of type
org.exoplatform.webui.form.UIFormUploadInput, using one of the two available constructors
:
+ </para>
+
+<programlisting>public UIFormUploadInput(String name, String bindingExpression)
+</programlisting>
+ <para>
+ or:
+ </para>
+
+<programlisting>public UIFormUploadInput(String name, String bindingExpression, int
limit)
+</programlisting>
+ <para>
+ Here is an example using the second form : {code} PortletRequestContext pcontext =
(PortletRequestContext)WebuiRequestContext.getCurrentInstance(); PortletPreferences
portletPref = pcontext.getRequest().getPreferences(); int limitMB =
Integer.parseInt(portletPref.getValue("uploadFileSizeLimitMB",
"").trim()); UIFormUploadInput uiInput = new
UIFormUploadInput("upload", "upload", limitMB) ;
+ </para>
+
+<programlisting>
+To get the limit from the xml configuration, you can add this piece of code in the files
portlet.xml or portlet-preferences.xml :
+{code:xml}
+<preference>
+ <name>uploadFileSizeLimitMB</name>
+ <value>30</value>
+ <read-only>false</read-only>
+</preference>
+</programlisting>
+ <para>
+ Again, a 0 value means unlimited upload size, and the value unit is set in MegaBytes.
+ </para>
+ <para>
+ To get the uploaded data use the ~~getUploadDataAsStream()~~ method: {code}
UIFormUploadInput input = (UIFormUploadInput)uiForm.getUIInput("upload");
InputStream inputStream = input.getUploadDataAsStream(); ... jcrData.setValue(inputStream)
; {code}
+ </para>
+ <para>
+ 1 Clean the uploaded file
+ </para>
+ <para>
+ The upload service stores a temporary file on the filesystem during the process. When
the upload is finished, you must clean the service in order to :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ delete the temporary file
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ delete the classes used for the upload
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ To do that, use the ~~removeUpload()~~ method defined in the upload service, like this
:
+ </para>
+
+<programlisting>UploadService uploadService =
uiForm.getApplicationComponent(UploadService.class) ;
+UIFormUploadInput uiChild = uiForm.getChild(UIFormUploadInput.class) ;
+uploadService.removeUpload(uiChild.getUploadId()) ;
+</programlisting>
+ <para>
+ Be sure to get and save the file in a JCR node <emphasis
role="bold">before</emphasis> you clean the service
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/development/XML_Resource_Bundles.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/XML_Resource_Bundles.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/development/XML_Resource_Bundles.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,103 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-XML_Resources_Bundles">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>XML Resources Bundles</title>
+ <section id="sect-Reference_Guide-XML_Resources_Bundles-Motivation">
+ <title>Motivation</title>
+ <para>
+ Usually resource bundles are stored in property files however as property files are
plain files it raise issues with the encoding of the file. The XML resource bundle format
has been developped to provide an alternative to property files.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The XML format declares the encoding of the file in the XML declaration which avoids
to use the native2ascii program and mess with encoding
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Property files use the ISO 8859-1 which does not cover the full unicode charset and
language such as arab would not be supported natively and require the use of escaping,
leading the files to be barely maintainable
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Tooling support for XML files is better than the tooling for Java property files and
usually the XML editor cope very well with the file encoding.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-XML_Resources_Bundles-Portal_support">
+ <title>Portal support</title>
+ <para>
+ In order to be loaded by the portal at runtime (actually the resource bundle service),
the name of the file must be the same as a property file but instead of ending with the
<emphasis role="bold">.properties</emphasis> suffix, it ends with
the <emphasis role="bold">.xml</emphasis> suffix. For instance
<emphasis role="bold"> AccountPortlet <emphasis
role="bold">ar.xml</emphasis> instead of
<emphasis>AccountPortlet</emphasis> ar.properties </emphasis> .
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-XML_Resources_Bundles-XML_format">
+ <title>XML format</title>
+ <para>
+ The XML format is very simple and has been developed based on the DRY (Don't
Repeat Yourself) principle. Usually resource bundle keys are hierarchically defined and we
can leverage the hierarchic nature of the XML for that purpose. Here is an example of
turning a property file into an XML resource bundle file:
+ </para>
+ <para>
+ <STYLE type="text/css"> .code {width: 97%}
</STYLE>
+ </para>
+
+<programlisting>UIAccountForm.tab.label.AccountInputSet = ...
+UIAccountForm.tab.label.UIUserProfileInputSet = ...
+UIAccountForm.label.Profile = ...
+UIAccountForm.label.HomeInfo= ...
+UIAccountForm.label.BusinessInfo= ...
+UIAccountForm.label.password= ...
+UIAccountForm.label.Confirmpassword= ...
+UIAccountForm.label.email= ...
+UIAccountForm.action.Reset= ...
+</programlisting>
+
+<programlisting><?xml version="1.0"
encoding="UTF-8"?>
+<bundle>
+ <UIAccountForm>
+ <tab>
+ <label>
+ <AccountInputSet>...</AccountInputSet>
+ <UIUserProfileInputSet>...</UIUserProfileInputSet>
+ </label>
+ </tab>
+ <label>
+ <Profile>...</Profile>
+ <HomeInfo>...</HomeInfo>
+ <BusinessInfo>...</BusinessInfo>
+ <password>...</password>
+ <Confirmpassword>...</Confirmpassword>
+ <email>...</email>
+ </label>
+ <action>
+ <Reset>...</Reset>
+ </action>
+ </UIAccountForm>
+</bundle>
+</programlisting>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/gadgets/Gadgets.xml 2009-11-30 21:03:01
UTC (rev 874)
@@ -0,0 +1,139 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Gadgets">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Gadgets</title>
+ <section id="sect-Reference_Guide-Gadgets-Overview">
+ <title>Overview</title>
+ <para>
+ An gadget is a mini web application running on a platform and you can put it in a web
page. This is a small application that helps users to do some private actions.
+ </para>
+ <para>
+ GateIn Portal supports some gadgets such as: Todo gadget, Calendar gadget, Calculator
gadget, Weather Forecasts, RSS Reader gadget.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Todo: This mini - application helps you to organize your day and work group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Calendar: A cool calendar to keep track of date in style.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Calculator: This is the coolest calculator for your page.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ RSS Reader: This gadget lets you het a sneak preview of your favourite feeds around
web
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Weather Forecasts: This gadget notifies you of current weather condition and gives
tomorrow's forecast.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Existing_Gadgets">
+ <title>Existing Gadgets</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Liste.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Create_a_new_Gadget">
+ <title>Create a new Gadget</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/New.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Remote_Gadget">
+ <title>Remote Gadget</title>
+ <para>
+ This is the reference to a remote gadget (stock one).
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Import.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Gadget_Importing">
+ <title>Gadget Importing</title>
+ <para>
+ After referencing the gadget successfully, then import it into the local repository.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Imported.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Gadget_Web_Editing">
+ <title>Gadget Web Editing</title>
+ <para>
+ Edit it from the Web the imported Gadget to modify it:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditImportedOnline.png" format="PNG"
/>
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Gadget_IDE_Editing">
+ <title>Gadget IDE Editing</title>
+ <para>
+ Edit it from your IDE thanks to the WebDAV protocol:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditImportedWebDAV.png" format="PNG"
/>
+ </imageobject>
+ </mediaobject>
+ </section>
+
+ <section id="sect-Reference_Guide-Gadgets-Dashboard_Viewing">
+ <title>Dashboard Viewing</title>
+ <para>
+ View it from the Dashboard when you drag and drop the Gadget from listing to the
dashboard.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Dashboard.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </section>
+</section>
Added: portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/gadgets/Setup_a_Gadget_Server.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,67 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Setup_a_Gadget_Server">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Setup a Gadget Server</title>
+ <section
id="sect-Reference_Guide-Setup_a_Gadget_Server-Setup_virtual_servers_for_the_gadget_rendering">
+ <title>Setup virtual servers for the gadget rendering</title>
+ <para>
+ GateIn recommend you to setup 2 different virtual hosts because it's the basis of
the security model of gadgets. Having the gadget running on a different domain than the
container (the website that 'contains' the app), the gadget can't read /
modify / do anything nasty to GateIn Portal (like adding spam messages, stealing your
cookies, whatever).
+ </para>
+ <para>
+ For example you can server the portal from <emphasis
role="bold">http://www.sample.com</emphasis> and the gadgets from
<emphasis role="bold">http://www.samplemodules.com</emphasis>
+ </para>
+ <para>
+ To do this, we need to configure a parameter with the name is
<emphasis>gadgets.hostName</emphasis>, the value is the
<emphasis>path/to/gadgetServer</emphasis> in GadgetRegisteryService service
like following:
+<programlisting> {code:xml} <component>
<key>org.exoplatform.application.gadget.GadgetRegistryService</key>
<type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
<init-params> <value-param>
<name>gadgets.hostName</name>
<description>Gadget server url</description>
<value>http://localhost:8080/GateInGadgetServer/gadgets/</value>
</value-param> </init-params> </component>
{code}</programlisting>
+ </para>
+ <warning>
+ <title>Warning</title>
+ <para>
+ This has only been possible since Portal 2.6
+ </para>
+ </warning>
+ <para>
+ It's possible to have multiple rendering servers. That would help to balance the
load across multiple servers.
+ </para>
+ <para>
+ If you still want to deploy it on the same server, make sure that it starts before
anything that use the gadgets (for example the webapp GateInGadgets that use
org.exoplatform.application.gadget.GadgetRegister)
+ </para>
+ <para>
+ 1 Config 1.1 Security key A file <emphasis
role="bold">key.txt</emphasis> has to be generated <emphasis
role="bold">for every installation of GateIn to be secure</emphasis>.
This file contains a secret key used to crypt the security token used for authenticating
the user. in Tomcat this file is in nix command line will create an excellent key:
+ </para>
+
+<programlisting>dd if=/dev/random bs=32 count=1 | openssl base64 >
/tmp/key.txt
+</programlisting>
+ <para>
+ 1.1 Gadget proxy and concat configuration These servers have to be on the same domain
as the gadget server. You can configure it in:
+<programlisting>{code}
+{, "expires": "86400", "proxy-url":
"http://localhost:8080/GateInGadgetServer/gadgets/proxy?url=",
"concat-url":
"http://localhost:8080/GateInGadgetServer/gadgets/concat?"
+}{code}</programlisting>
+ </para>
+ <para>
+ 1.1 Proxy if your server is behind a proxy and you want to allow external gadgets, you
should configure the proxy of your JVM adding this code at the begining.
{code}-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber
-Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword {code}
+ </para>
+ </section>
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/portlets/AJAX_in_GateIn_Framework.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,395 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-AJAX_in_GateIn_Framework">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>AJAX in GateIn Framework</title>
+ <section id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Overview">
+ <title>Overview</title>
+ <para>
+ It is very easy to create and manage Ajax calls in our framework. Just a few lines to
write in your template file and your java class. For simple Ajax update of a component,
you don't even have to write any line of JavaScript.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portlet_Preparation">
+ <title>Portlet Preparation</title>
+ <para>
+ Our portlets can use specific <code>ActionListener</code>s
to receive and process Ajax calls. To do that, you must create an inner static class named
following this convention : action name followed by ActionListener
+ </para>
+ <para>
+ Example : <code>ParentClass</code> is the class in which
you are writing.
+ </para>
+
+<programlisting>static public class SaveActionListener extends
EventListener<ParentClass>
+</programlisting>
+ <para>
+ Don't forget to declare this listener in the configuration of your portlet, with
this :
+ </para>
+
+<programlisting>listeners = ParentClass.SaveActionListener.class{code}
+</programlisting>
+ <para>
+ in the correct annotation <code>ComponentConfig</code>,
<code>EventConfig</code>, etc.,
+ </para>
+ <para>
+ For example, the configuration of
<code><strong>UIAccountForm</strong></code>:
+ </para>
+
+<programlisting>...
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIFormTabPane.gtmpl",
+ initParams = {
+ @ParamConfig(
+ name = "AccountTemplateConfigOption",
+ value =
"app:/WEB-INF/conf/uiconf/account/webui/component/model/AccountTemplateConfigOption.groovy"
+ ),
+ @ParamConfig(
+ name = "help.UIAccountFormQuickHelp",
+ value =
"app:/WEB-INF/conf/uiconf/account/webui/component/model/UIAccountFormQuickHelp.xhtml"
+ )
+ },
+ events = {
+ @EventConfig(listeners = UIAccountForm.SaveActionListener.class ),
+ @EventConfig(listeners = UIAccountForm.ResetActionListener.class, phase =
Phase.DECODE),
+ @EventConfig(listeners = UIAccountForm.SearchUserActionListener.class, phase =
Phase.DECODE)
+ }
+ )
+...
+</programlisting>
+ <para>
+ Inside this class, you will have to create an
<code>execute</code> method like this :
+ </para>
+
+<programlisting>public void execute(Event<ParentClass> event) throws
Exception
+</programlisting>
+ <para>
+ This method is called every time the listener gets an event from the client, hence you
can process this event in it, using the {style:type=span|font-family=courier
new,courier}event {style}attibute. Use it to get parameters from a form in your client, to
modify the status of your portlet, etc.,
+ </para>
+ <para>
+ Possible ways to use the event attribute : {code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ String value = event.getRequestContext().getRequestParameter("name"); //
to get a value from a form
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ParentClass parent = event.getSource(); // to get the parent object (the portlet
that threw and caugth the event)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ UIMyComponent portal = parent.getAncestorOfType(UIMyComponent.class); // to get any
node in the hierarchy of UIComponents {code}
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ If your action has to update an element on your client's interface, you must call
<emphasis role="bold">addUIComponentToUpdateByAjax()</emphasis> at
the end of the <code>execute</code> method:
+ </para>
+
+<programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent)
;
+</programlisting>
+ <para>
+ The target component must be provided as parameter (the component that will be
updated). We will come back on this later.
+ </para>
+ <para>
+ You must create one inner action listener class for each Ajax call you want to handle
on this portlet. All these classes must be declared in the configuration annotations of
the main class, otherwise you will get an error.
+ </para>
+ <para>
+ It's done, your portlet is ready to accept Ajax calls from your client.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AJAX_in_the_Groovy_template">
+ <title>AJAX in the Groovy template</title>
+ <para>
+ Your server being configured to receive Ajax calls, you must configure the client
interface to make these calls.
+ </para>
+ <para>
+ In the groovy template file associated with your portlet class
(<code>ParentClass</code> here), you just have to add :
+ </para>
+
+<programlisting>uicomponent.event("YourOperation"); // YourOperation is
the same as in the ActionListener class (Save in our example above)
+</programlisting>
+ <para>
+ in a groovy code block. The event function will create an url starting with
{style:type=span|font-family=courier new,courier}javascript:{style} so you have to make
sure this code can be executed in your environment.
+ </para>
+ <para>
+ If your operation must update the content of a component, you have to make sure that
the target component is well rendered. Basically, just type this :
+ </para>
+
+<programlisting>uicomponent.renderChild(UITargetComponent.class) ;
+</programlisting>
+ <para>
+ in a groovy code block. <code>UITargetComponent</code> is
the class of the component that will be updated when
+ </para>
+
+<programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uicomponent)
;
+</programlisting>
+ <para>
+ is called. Hence, <code>uicomponent</code> must be of type
<code>UITargetComponent</code>. If this component is not
rendered by default, when the portlet loads, don't forget to set its
<code>rendered</code> attribute to false :
+ </para>
+
+<programlisting>mycomponent.setRendered(false);
+</programlisting>
+ <para>
+ in the constructor of your portlet.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-How_JavaScript_works">
+ <title>How JavaScript works</title>
+ <para>
+ All the javascript is managed by the file GateIn.portal.PortalHttpRequest.js in the
portal project.
+ </para>
+ <para>
+ In this class, you will find 4 functions/classes (detailed below):
+ </para>
+
+<programlisting>* PortletResponse
+* PortalResponse
+* AjaxRequest
+* HttpResponseHandler
+</programlisting>
+ <para>
+ and 6 functions : {code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ ajaxGet // Calls doRequest with an url in GET mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxPost // Calls doRequest with an url in POST mode
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ doRequest // Creates the AjaxRequest and HttpResponseHandler objects, and lauches
the request process
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxAbort // Cancels the current request
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxAsyncGetRequest // Allows to create and execute a sync or async GET request
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxRedirect // A simple javascript redirection with window.location.href {code}
that are the entry points of these classes. You shouldn't have to call explicitly
these functions, since the template file and the portlet class manage everything.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortletResponse">
+ <title>PortletResponse</title>
+ <para>
+ This class doesn't contain any method. On creation, it just gets the response
elements from the xml returned by Ajax, and store them in the corresponding attributes :
{code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ portletId
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ portletTitle
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ portletMode // View, Edit, Help or Config
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ portletState // Decode, Render
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ portletData // The updated data to put in the component
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ script //The javascript code to update the component
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ blocksToUpdate // An array containing the containers to update with this script
{code}
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ You can access these attributes just by calling them from your
<code>PortletResponse</code> instance.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-PortalResponse">
+ <title>PortalResponse</title>
+ <para>
+ Contains an array of <code>PortletResponse</code>s
(<code>portletResponses</code>) and two other attributes :
{code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ data // Data to update
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ script // Javascript code to update {code}
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-AjaxRequest">
+ <title>AjaxRequest</title>
+ <para>
+ By far the most important class of this file. Wraps the XMLHttpRequest object with
some functions and attributes, to make it easier to use. You can find the complete
documentation here :
http://www.ajaxtoolbox.com/request/documentation.php
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-HttpResponseHandler">
+ <title>HttpResponseHandler</title>
+ <para>
+ This class provides methods to handle the Ajax response. {code}
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ executeScript // execute some javascript
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ updateBlocks // update some html components
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxTimeout // a function called when the timeout of the ajax call exceeds. Just
cancel the request
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxResponse // creates a PortalResponse object from the data from the Ajax request
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ajaxLoading // shows the loading popup and mask layer {code}
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Portal_Ajax_Response_Data_Structure">
+ <title>Portal Ajax Response Data Structure</title>
+
+<programlisting>{PortalResponse}
+ |
+ |--->{PortletResponse}
+ |
+ |--->{PortletResponse}
+ | |-->{portletId}
+ | |-->{portletTitle}
+ | |-->{portletMode}
+ | |-->{portletState}
+ | |
+ | |-->{Data}
+ | | |
+ | | |--->{BlockToUpdate}
+ | | | |-->{blockId}
+ | | | |-->{data}
+ | | |
+ | | |--->{BlockToUpdate}
+ | |--->{Script}
+ |
+ |--->{Data}
+ | |
+ | |--->{BlockToUpdate}
+ | | |-->{blockId}
+ | | |-->{data}
+ | |
+ | |--->{BlockToUpdate}
+ |--->{Script}
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-AJAX_in_GateIn_Framework-Manage_Several_Popups">
+ <title>Manage Several Popups</title>
+ <para>
+ If you have several actions that need to appear in a popup, you can use this technique
to manage the different popup windows easily:
+ </para>
+ <para>
+ Create a <code>UIPopupAction</code> in your main portlet
class:
+ </para>
+
+<programlisting>addChild(UIPopupAction.class, null, null);
+</programlisting>
+ <para>
+ and render it in your template file:
+ </para>
+
+<programlisting>uicomponent.renderChild(UIPopupAction.class) ;
+</programlisting>
+ <para>
+ By default, this just create an empty container (popup) that will receive the new
content by Ajax.
+ </para>
+ <para>
+ Get this component in your action listener class, and update its content:
+ </para>
+
+<programlisting>UIPopupAction uiPopupAction =
uiMainPortlet.getChild(UIPopupAction.class) ;
+uiPopupAction.activate(UIReferencesList.class, 600) ;
+</programlisting>
+ <para>
+ UIReferenceList is the component that will appear in the popup. You don't have to
declare it in the main portlet class. The activate method takes care of the creation of
the component, and its rendering in the popup window. See the javadoc for more information
on this class.
+ </para>
+ <para>
+ Make this component updatable by Ajax:
+ </para>
+
+<programlisting>event.getRequestContext().addUIComponentToUpdateByAjax(uiPopupAction)
;
+</programlisting>
+ <para>
+ For each component that you want that component to appear in a popup window, add a
action listener class and repeat the steps above with the appropriate component type.
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/portlets/Create_a_WebUI_Portlet.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,334 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Create_a_WebUI_Portlet">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Create a WebUI Portlet</title>
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Overview">
+ <title>Overview</title>
+ <para>
+ This example is based on the testPortlet in portal/trunk/portlet/test.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Create_a_WebUI_Portlet-Configure_the_portlet">
+ <title>Configure the portlet</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Folder_tree">
+ <title>Folder tree</title>
+ <para>
+ On Eclipse, create a new Java Project, and create this folder tree :
+ </para>
+ <para>
+ <pre> src | main | |- java | |- resources | |- webapp
</pre>
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-pom.xml">
+ <title>pom.xml</title>
+ <para>
+ Create the pom.xml, at root level of the project, like this :
+ </para>
+
+<programlisting><project>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>config</artifactId>
+ <version>trunk</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.portlet.testRomain</artifactId>
+ <packaging>war</packaging>
+ <version>${org.exoplatform.portal.version}</version>
+ <name>exo-portal.portlets.test Romain</name>
+ <url>http://www.exoplatform.org</url>
+ <description>Romain Test Portlet</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.portal</artifactId>
+ <version>${org.exoplatform.portal.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.GateIn</artifactId>
+ <version>${org.exoplatform.portal.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>testRomain</finalName>
+ </build>
+</project>
+</programlisting>
+ <para>
+ 1.1 UITestRomainPortlet.java
+ </para>
+ <para>
+ In java/testRomain/portlet/component/, we will create the UITestRomainPortlet.java
file of the portlet :
+ </para>
+
+<programlisting>package testRomain.portlet.component;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.core.UIPortletApplication;
+//this part is configuration of the portlet, we set the path to the template groovy.
+ @ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/testRomain/portlet/UITestRomainPortlet.gtmpl"
+ )
+public class UITestRomainPortlet extends UIPortletApplication {
+
+ public UITestRomainPortlet() throws Exception {
+ }
+}
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Create_a_WebUI_Portlet-testRomain.xml">
+ <title>testRomain.xml</title>
+ <para>
+ In src/main/resources/tomcat/, create a testRomain.xml file : {code} <Context
path="/test"
docBase="../../../GateInProjects/portal/trunk/portlet/testPortletRomain/src/main/webapp"
debug="0" reloadable="true" /> {code}
+ </para>
+ <para>
+ docBase must be set to webapp path of the portlet when you are in the tomcat bin
directory.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Create_a_WebUI_Portlet-Portlet_Groovy_Template">
+ <title>Portlet Groovy Template</title>
+ <para>
+ In src/main/webapp, create the groovy template for the portlet. The path to this file
must match the path you set in the java file, in our case :
groovy/testRomain/portlet/UITestRomainPortlet.gtmpl
+ </para>
+
+<programlisting><div
id="<%=uicomponent.getId();%>">
+ HelloWorld!images/!!
+</div>
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-Skin_Folder">
+ <title>Skin Folder</title>
+ <para>
+ Create the folder skin in src/main/webapp. We don't fill it now, but in this
folder, you can put css stylesheet and images.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Create_a_WebUI_Portlet-Locale_Folder">
+ <title>Locale Folder</title>
+ <para>
+ Create the folder WEB-INF/classes/locale in src/main/webapp. We don't fill it now,
but in this folder, you can put language properties files. See <xref
linkend="sect-Reference_Guide-Internationalization_Configuration" />.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Create_a_WebUI_Portlet-configuration.xml">
+ <title>configuration.xml</title>
+ <para>
+ Create the file configuration.xml in WEB-INF/conf/portlet/testPortletRomain/. Content
of tag <ui-component-root> must match your package organization.
+ </para>
+
+<programlisting><webui-configuration>
+ <application>
+
<ui-component-root>testRomain.portlet.component.UITestRomainPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
+</programlisting>
+ <para>
+ 1.1 portlet.xml
+ </para>
+ <para>
+ In WEB-INF, create file portlet.xml :
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="UTF-8"?>
+<portlet-app version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+ <portlet>
+ <description xml:lang="EN">Test Portlet
Romain</description>
+ <portlet-name>TestRomain</portlet-name>
+ <display-name xml:lang="EN">Test Portlet
Romain</display-name>
+
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <init-param>
+ <name>webui.configuration</name>
+ <!-- must match the path to configuration file -->
+
<value>/WEB-INF/conf/portlet/testPortletRomain/configuration.xml</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+
<resource-bundle>locale.testRomainPortlet</resource-bundle>
+ <portlet-info>
+ <title>TestPortletRomain</title>
+ <short-title>TestPortlet</short-title>
+ <keywords>test</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Create_a_WebUI_Portlet-web.xml">
+ <title>web.xml</title>
+ <para>
+ In WEB-INF, create file web.xml :
+ </para>
+
+<programlisting><?xml version="1.0"
encoding="ISO-8859-1"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <!-If define the Portlet Application name MUST end with .par->
+ <display-name>test</display-name>
+ <description> This application is a portlet. It can not be used outside a
portal.
+ This web.xml file is mandatory in each .par archive file. </description>
+ <listener>
+
<listener-class>org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>PortletWrapper</servlet-name>
+ <servlet-class>org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>PortletWrapper</servlet-name>
+ <url-pattern>/PortletWrapper</url-pattern>
+ </servlet-mapping>
+</web-app>
+</programlisting>
+ <para>
+ 1 Use the Portlet
+ </para>
+ <para>
+ Compile your portlet, deploy it, and add it to the portal.
+ </para>
+ <para>
+ Now, we will add a button in the portlet. This button will open a popup with a message
inside.
+ </para>
+ <para>
+ 1.1 Add a button In the groovy template, add this code :
+ </para>
+
+<programlisting><div class="UIAction">
+ <div class="ActionContainer">
+ <div class="ActionButton">
+ <div class="LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="<%=uicomponent.event("OpenPopup",
"")%>">Open Popup</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+</programlisting>
+ <para>
+ 1.1 Add a listener In the java file, in @ComponentConfig, add this code :
+ </para>
+
+<programlisting>events = {
+ @EventConfig(listeners = UITestRomainPortlet.OpenPopupActionListener.class)
+}
+</programlisting>
+ <para>
+ Remark : XXXActionLister.class XXX must match the name you set for the event in the
groovy.
+ </para>
+
+<programlisting>static public class OpenPopupActionListener extends
EventListener<UITestRomainPortlet> {
+ public void execute(Event<UITestRomainPortlet> event) throws Exception
{
+ System.out.println("HelloWorld");
+ }
+}
+</programlisting>
+ <para>
+ 1.1 Redeploy
+ </para>
+ <para>
+ Redeploy the portlet and click on the button. You will see "HelloWorld" in
your console. If you don't change in the portlet, try to redeploy and reboot the
tomcat server.
+ </para>
+ <para>
+ 1 Add a "HelloWorld" popup
+ </para>
+ <para>
+ Now, we will add a popup which say "HelloWorld" when you click on the
button.
+ </para>
+ <para>
+ First, create the groovy template of the popup : in webapp/groovy/testRomain/portlet,
create UIHelloWorldPopupContent.gtmpl :
+ </para>
+
+<programlisting><div
id="<%=uicomponent.getId();%>">
+ HelloWorld in a popup!images/!!
+</div>
+</programlisting>
+ <para>
+ In java/testRomain/portlet/component, create the java file for the popup look like :
{code} package testRomain.portlet.component;
+ </para>
+ <para>
+ import org.exoplatform.webui.config.annotation.ComponentConfig; import
org.exoplatform.webui.core.UIComponent; import
org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+ </para>
+ <para>
+ @ComponentConfig( lifecycle = UIApplicationLifecycle.class, template =
"app:/groovy/testRomain/portlet/UIHelloWorldPopupContent.gtmpl" )
+ </para>
+ <para>
+ public class UIHelloWorldPopupContent extends UIComponent
+ </para>
+ <para>
+ public UIHelloWorldPopupContent() throws Exception { }{ } {code}
+ </para>
+ <para>
+ In UITestRomainPortlet.java, we will create the popup at the portlet creation (in the
constructor) : {code} public UITestRomainPortlet() throws Exception UIPopupWindow popup =
addChild(UIPopupWindow.class, null, null); popup.setWindowSize(400, 300);
+ </para>
+ <para>
+ {UIHelloWorldPopupContent popupContent =
createUIComponent(UIHelloWorldPopupContent.class, null, null);
popup.setUIComponent(popupContent); popup.setRendered(false); } {code}
+ </para>
+ <para>
+ At the beginning, we set the popup not visible. As you see, we add a children to the
Portlet. So, if we want to see the content of it, we must add this in
UITestPortletRomain.gtmpl :
+ </para>
+
+<programlisting><% uicomponent.renderChildren(); %>
+</programlisting>
+ <para>
+ This makes the portlet generate the content of all child components.
+ </para>
+ <para>
+ Change the treatment of the event, replace the println by : {code} public static class
OpenPopupActionListener extends EventListener<UITestRomainPortlet> public
void execute(Event<UITestRomainPortlet> event) throws Exception {
UITestRomainPortlet portlet = event.getSource(); UIPopupWindow popup =
portlet.getChild(UIPopupWindow.class); popup.setRendered(true); popup.setShow(true); }{ }
{code}
+ </para>
+ <para>
+ When user clicks on the button, the popup is shown.
+ </para>
+ <para>
+ Redeploy the portlet and click on the button. You will see "HelloWorld in a
popup" in a popup. If you don't change in the portlet, try to redeploy and reboot
the tomcat server.
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Groovy_Templates.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,146 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Groovy_Templates">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Groovy Templates</title>
+ <section id="sect-Reference_Guide-Groovy_Templates-Overview">
+ <title>Overview</title>
+ <para>
+ This article gives a glance at the Groovy language, and explains how to configure the
portlet and and the groovy template.
+ </para>
+ <para>
+ It's recommended to read also <xref
linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" /> in order to
understand better the communication between the Groovy Template and the portlet.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Groovy_Templates-Basic_structure">
+ <title>Basic structure</title>
+ <para>
+ The structure of a template is very easy :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The HTML code
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ zero or more groovy language code blocks, enclosed by <% ... %>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The HTML code in the template doesn't have to contain the
<code>html</code>, or
<code>body</code> tags. Hence, you can use a groovy template
for a component that will be rendered in another component.
+ </para>
+ <para>
+ Example : <emphasis
role="bold">UIPortalApplication.gtmpl</emphasis> template (<emphasis
role="bold">/GateInProjects/portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/</emphasis>)
+ </para>
+
+<programlisting><!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<%
+ import org.exoplatform.webui.core.UIComponent;
+ def currentPage = uicomponent.getCurrentPage();
+ ...
+%>
+ ...
+ <div class="$uicomponent.skin"
id="UIPortalApplication">
+ <%uicomponent.renderChildren();%>
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Groovy_Templates-Groovy_language">
+ <title>Groovy language</title>
+ <para>
+ Groovy is a scripting language for Java. Here are a few examples on how to use it, but
you can find more information in <ulink
url="http://groovy.codehaus.org/Documentation">the full
documentation</ulink>.
+ </para>
+ <para>
+ This language looks like Java a lot, so it's very easy to use. Examples :
+ </para>
+ <para>
+ Variables definition : {code} int min = 1; def totalPage =
uicomponent.getAvailablePage(); String name = "uiPortlet"; categories =
uicomponent.getItemCategories(); String columns = uicomponent.getColumns(); {code} Other
expressions : {code} for(category in categories) { ... } // easy to use for loop for(i in
min..max) { ... } // min and max are int variables println
"</div>" ; println """ <div
class="Item"> <div class="OverflowContainer">
"""; <%=uicomponent.getToolbarStyle();%> // <%= to
avoid a call of println method import org.exoplatform.portal.config.model.PageNode;
{code}
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Groovy_Templates-Linking_a_portlet_with_a_template">
+ <title>Linking a portlet with a template</title>
+ <para>
+ Stuff Goes Here?
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Groovy_Templates-Portlet_configuration">
+ <title>Portlet configuration</title>
+ <para>
+ The configuration of a portlet is partly made with
{style:type=span|font-family=courier new,courier}ComponentConfig {style}annotations
(others are ComponentConfigs, EventConfig, etc). One of the parameters of this annotation
is called {style:type=span|font-family=courier new,courier}template{style}, where you can
define the path to the template file associated with this portlet.
+ </para>
+ <para>
+ To specify this parameter to your portlet, just add this statement to your
configuration annotation, for example in <emphasis
role="bold">/GateInProjects/portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/</emphasis>
you find <emphasis role="bold">UIApplicationForm.java</emphasis>:
+ </para>
+
+<programlisting>@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl",
+ events = {
+ @EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
+ @EventConfig(phase = Phase.DECODE, listeners =
UIApplicationForm.CancelActionListener.class)
+ }
+)
+</programlisting>
+ <para>
+ You see that the path is in the namespace called "system",
"system" is a reference to the portal webapp. In this webapp you find some
reusable groovy templates, just open the folder <emphasis
role="bold">/GateInProjects/portal/trunk/web/portal/src/main/webapp/groovy/webui/form/</emphasis>
to see them.
+ </para>
+ <para>
+ As you want to create your own template, create a groovy file in your webbapp and
refer to it. Please use the namespace "app" for refering to the same webapp as
your component. GateIn always puts the component templates in a folder like
"/webapp/groovy/your<emphasis>portlet</emphasis>name/webui/component".
+ </para>
+
+<programlisting>template =
"app:/groovy/your_portlet_name/webui/component/your_component.gtmpl"
+</programlisting>
+ <para>
+ You can now edit your template file.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Groovy_Templates-The_template_file">
+ <title>The template file</title>
+ <para>
+ As we said before, the template file is composed of HTML code and groovy code blocks.
There are a few things more that you need to know to fully link your portlet with your
template.
+ </para>
+ <para>
+ If your template defines the UI of a component, you have an access to this component
instance (the java object) using the variable {style:type=span|font-family=courier
new,courier}uicomponent{style}. This should be the case almost all the time, but we
recommend that you check that your java class inherits from UIComponent before you use
this variable. With this {style:type=span|font-family=courier new,courier}uicomponent
{style}variable, you can access all the attributes and functions of your component, to use
them in your template. Example : UIPageIterator.gtmpl {code} <% def currentPage =
uicomponent.getCurrentPage(); %> ... <a
href="<%=uicomponent.event("ShowPage","$currentPage")%>"
class="Icon
LastTopPageIcon"><span></span></a>
{code}
+ </para>
+ <para>
+ This example shows that {style:type=span|font-family=courier new,courier}uicomponent
{style}can be used to make Ajax calls, thanks to the {style:type=span|font-family=courier
new,courier}event {style}method. See <xref
linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" /> for more details.
+ </para>
+ <para>
+ Another variable that you can use is {style:type=span|font-family=courier
new,courier}{style}<emphasis>ctx. It gives access to the context in which the
template is processed. Hence, you can get some elements like the request, the Javscript
manager, or the resource resolver (</emphasis>ctx.appRes). Examples : {code}
<% def rcontext = <emphasis>ctx.getRequestContext() ;
rcontext.getJavascriptManager().importJavascript('GateIn.webui.UIPopupWindow');</emphasis>ctx.appRes(popupId
+ ".title."+ title); %> {code}
+ </para>
+ <para>
+ If you use your template to define the user interface of a component that includes a
form, you can access the instance of UIForm in a variable named
{style:type=span|font-family=courier new,courier}uiform{style}. The UIForm class provides
the methods, {style:type=span|font-family=courier new,courier}begin(){style} and
{style:type=span|font-family=courier new,courier}end(){style}, that write the HTML tags of
the form. Your form class must inherit from <literal>UIForm</literal>, in this
class you add the input elements (fields, checkboxes, lists) which you wish to use in your
form. In your groovy template you can render your input elements using
{style:type=span|font-family=courier new,courier}{style}{code}{ uiform.renderField(field)
}{code}
+ </para>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/Portlet_Lifecycle.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,326 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Portlet_Lifecycle">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Portlet Lifecycle</title>
+ <section id="sect-Reference_Guide-Portlet_Lifecycle-Overview">
+ <title>Overview</title>
+ <para>
+ The goal of this chapter is not to talk about the Portlet API specification lifecycle
but more about GateIn UI framework to easily develop portlets.
+ </para>
+ <para>
+ The web framework used here has been completely developed by GateIn and perfectly
suits the portal environment, it even allows to send events from the portlet UIComponents
to the Portal ones.
+ </para>
+ <para>
+ Of course using the GateIn web framework to build portlets is not necessary and any
other web framework that supports portlet environment can be used. But all GateIn portlets
that are part of GateIn products are developed using that framework and we provide several
UI components that can be used in different abstracted contexts such as the portal itself
or some portlets.
+ </para>
+ <para>
+ This chapter is not a tutorial on how to write portlets, it will go in the details of
the code implementation and logic; hence it is intended for advanced developers. It is
also advised to read the <xref
linkend="sect-Reference_Guide-Portal_Lifecycle" /> article before as the that
article explains concepts that are similar and top hierarchy classes that are shared.
+ </para>
+ </section>
+
+ <section id="sect-Reference_Guide-Portlet_Lifecycle-Portlet_init">
+ <title>Portlet init</title>
+ <para>
+ The main entry point for configuring a portlet is in the <emphasis
role="bold">portlet.xml</emphasis> file located in the portlet
application WAR. Every portlet that shall be built using the GateIn web framework must
reference the <emphasis
role="bold">PortletApplicationController</emphasis> . The portlet
configuration such as the root component is defined in a <emphasis
role="bold">configuration.xml</emphasis> file. The path to this
configuration.xml file is defined in the init-param "<emphasis
role="bold">webui.configuration</emphasis>" of porlet.xml.
+ </para>
+
+<programlisting> <portlet>
+ <description xml:lang="EN">Content
Portlet</description>
+ <portlet-name>ContentPortlet</portlet-name>
+ <display-name xml:lang="EN">Content
Portlet</display-name>
+
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+
+ <init-param>
+ <name>webui.configuration</name>
+
<value>/WEB-INF/conf/portlet/content/ContentPortlet/webui/configuration.xml</value>
+ </init-param>
+</programlisting>
+ <para>
+ The structure of the <emphasis
role="bold">configuration.xml</emphasis> file is exactly the same as
the <emphasis>webui-configuration.xml</emphasis>which we have already
introduced in the <xref linkend="sect-Reference_Guide-Portal_Lifecycle" />
article. In the case of the content portlet it looks like:
+ </para>
+
+<programlisting><webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.content.webui.component.UIContentPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ </application>
+</webui-configuration>
+</programlisting>
+ <para>
+ The <emphasis
role="bold">PortletApplicationController</emphasis> class extends the
<emphasis role="bold">GenericPortlet</emphasis> class defined in the
Portlet API specification.
+ </para>
+ <para>
+ All methods like <emphasis>processAction()</emphasis> or
<emphasis>render()</emphasis> are delegated to the <emphasis
role="bold">PortletApplication</emphasis>. The creation and caching
inside the <emphasis role="bold">WebController</emphasis> object is
described in the following method:
+ </para>
+
+<programlisting> /**
+ * try to obtain the PortletApplication from the WebAppController.
+ *
+ * If it does not exist a new PortletApplication object is created, init and cached in
the
+ * controller
+ */
+ private PortletApplication getPortletApplication() throws Exception {
+ PortalContainer container = PortalContainer.getInstance() ;
+ WebAppController controller =
+ (WebAppController)container.getComponentInstanceOfType(WebAppController.class) ;
+ PortletApplication application = controller.getApplication(applicationId_) ;
+ if(application == null) {
+ application = new PortletApplication(getPortletConfig()) ;
+ application.onInit() ;
+ controller.addApplication(application) ;
+ }
+ return application ;
+ }
+</programlisting>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portlet_Lifecycle-Portlet_request_handler">
+ <title>Portlet request handler</title>
+ <para>
+ When a portlet, that is deployed in GateIn Portal, is using the GateIn web framework
then all methods calls go through the <emphasis
role="bold">PortletApplication</emphasis> object which extends the
<emphasis role="bold">WebuiApplication</emphasis>.
+ </para>
+ </section>
+
+ <section
id="sect-Reference_Guide-Portlet_Lifecycle-ProcessAction_phase">
+ <title>ProcessAction phase</title>
+ <para>
+ The code of the method in PortletApplication is described here. The business logic is
shown in the javadoc:
+ </para>
+
+<programlisting> /**
+ * The processAction() method is the one modelled according to the Portlet API
specification
+ *
+ * The process is quite simple and here are te different steps done in the method:
+ *
+ * 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the
class) is referenced
+ * 2) A new request context of type PortletRequestContext (which extends the class
WebuiRequestContext) is
+ * created as a child of the current context instance
+ * 3) The new context is place inside the ThreadLocal and hence overides its parent one
there,
+ * only for the portlet request lifeciclye
+ * 4) The method onStartRequest() is called in all the ApplicationLifecycle objects
referenced in the webui
+ * configuration XML file
+ * 5) The StateManager object (in case of portlet it is an object of type
ParentAppStateManager) is used to get the RootComponent
+ * also referenced in the XML configuration file
+ * 6) The methods processDecode(UIApplication, WebuiRequestContext) and
processAction(UIApplication, WebuiRequestContext)
+ * are then called
+ * 7) Finally, a flag, to tell that the processAction phase was done, in the context is
set to true and the parent
+ * context is restored in the Threadlocal
+ */
+ public void processAction(ActionRequest req, ActionResponse res) throws Exception {
+ WebuiRequestContext parentAppRequestContext =
WebuiRequestContext.getCurrentInstance() ;
+ PortletRequestContext context = createRequestContext(req, res,
parentAppRequestContext) ;
+ WebuiRequestContext.setCurrentInstance(context) ;
+ try {
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onStartRequest(this, context) ;
+ }
+ UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
+ context.setUIApplication(uiApp) ;
+ processDecode(uiApp, context) ;
+ if(!images/context.isResponseComplete() &&!images/
context.getProcessRender()) {
+ processAction(uiApp, context) ;
+ }
+ } finally {
+ context.setProcessAction(true) ;
+ WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
+ }
+ }
+</programlisting>
+ <para>
+ The <emphasis role="bold">PortletRequestContext</emphasis>
extends <emphasis role="bold">WebuiRequestContext</emphasis> class
and acts as a wrapper on top of all the portlet request information:
+ </para>
+
+<programlisting> /**
+ * In this method we try to get the PortletRequestContext object from the attribute map
of the parent
+ * WebuiRequestContext.
+ *
+ * If it is not cached then we create a new instance, if it is cached then we init it
with the correct
+ * writer, request and response objects
+ *
+ * We finally cache it in the parent attribute map
+ *
+ */
+ private PortletRequestContext createRequestContext(PortletRequest req, PortletResponse
res,
+ WebuiRequestContext
parentAppRequestContext) throws IOException {
+ String attributeName = getApplicationId() + "$PortletRequest" ;
+ PortletRequestContext context =
+ (PortletRequestContext) parentAppRequestContext.getAttribute(attributeName) ;
+ Writer w = null ;
+ if(res instanceof RenderResponse){
+ RenderResponse renderRes = (RenderResponse)res;
+ renderRes.setContentType("text/html; charset=UTF-8");
+ w = renderRes.getWriter() ;
+ }
+ if(context!images/= null) {
+ context.init(w, req, res) ;
+ } else {
+ context = new PortletRequestContext(this, w, req, res) ;
+ parentAppRequestContext.setAttribute(attributeName, context) ;
+ }
+ context.setParentAppRequestContext(parentAppRequestContext) ;
+ return context;
+ }
+</programlisting>
+ <para>
+ In the PortletApplication, the line
+ </para>
+ <para>
+ <emphasis>UIApplication uiApp =
getStateManager().restoreUIRootComponent(context);</emphasis> asks the StateManager
defined for the portlet to get the UI root component. In the case of a portlet the root
component must extend UIPortletApplication.
+ </para>
+
+<programlisting>public class ParentAppStateManager extends StateManager {
+
+ /**
+ * This method simply delegate the call to the same method of the parent
WebuiRequestContext
+ */
+ @SuppressWarnings("unchecked")
+ public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws
Exception {
+ WebuiRequestContext pcontext = (WebuiRequestContext)
context.getParentAppRequestContext() ;
+ return pcontext.getStateManager().restoreUIRootComponent(context) ;
+ }
+</programlisting>
+ <para>
+ Hence this is the PortalStateManager that will also handle the extraction of the root
component.
+ </para>
+
+<programlisting> public UIApplication restoreUIRootComponent(WebuiRequestContext
context) throws Exception {
+ context.setStateManager(this) ;
+ WebuiApplication app = (WebuiApplication)context.getApplication() ;
+
+ /*
+ * If the request context is of type PortletRequestContext, we extract the parent
context which will
+ * allow to get access to the PortalApplicationState object thanks to the session id
used as the key for the
+ * syncronised Map uiApplications
+ */
+ if(context instanceof PortletRequestContext) {
+ WebuiRequestContext preqContext = (WebuiRequestContext)
context.getParentAppRequestContext() ;
+ PortalApplicationState state = uiApplications.get(preqContext.getSessionId()) ;
+ PortletRequestContext pcontext = (PortletRequestContext) context ;
+ String key = pcontext.getApplication().getApplicationId() ;
+ UIApplication uiApplication = state.get(key) ;
+ if(uiApplication!images/= null) return uiApplication;
+ synchronized(uiApplications) {
+ ConfigurationManager cmanager = app.getConfigurationManager() ;
+ String uirootClass = cmanager.getApplication().getUIRootComponent() ;
+ Class type =
Thread.currentThread().getContextClassLoader().loadClass(uirootClass) ;
+ uiApplication = (UIApplication)app.createUIComponent(type, null, null, context) ;
+ state.put(key, uiApplication) ;
+ }
+ return uiApplication ;
+ }
+</programlisting>
+ </section>
+
+ <section id="sect-Reference_Guide-Portlet_Lifecycle-Render_phase">
+ <title>Render phase</title>
+ <para>
+ The render method business logic is quite similar to processAction().
+ </para>
+
+<programlisting> /**
+ * The render method business logic is quite similar to the processAction() one.
+ *
+ * 1) A PortletRequestContext object is created (or extracted from the cache if it
already exists)
+ * and initialized
+ * 2) The PortletRequestContext replaces the parent one in the WebuiRequestContext
ThreadLocal object
+ * 3) If the portal has already called the portlet processAction() then the call to all
onStartRequest of
+ * the ApplicationLifecycle has already been made, otherwise we call them
+ * 4) The ParentStateManager is also used to get the UIApplication, as we have seen it
delegates the call
+ * to the PortalStateManager which caches the UI component root associated with the
current application
+ * 5) the processRender() method of the UIPortletApplucaton is called
+ * 6) Finally, the method onEndRequest() is called on every ApplicationLifecycle
referenced in the portlet
+ * configuration XML file and the parent WebuiRequestContext is restored
+ *
+ */
+ public void render(RenderRequest req, RenderResponse res) throws Exception {
+ WebuiRequestContext parentAppRequestContext =
WebuiRequestContext.getCurrentInstance() ;
+ PortletRequestContext context = createRequestContext(req, res,
parentAppRequestContext) ;
+ WebuiRequestContext.setCurrentInstance(context) ;
+ try {
+ if(!context.hasProcessAction()) {
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onStartRequest(this, context) ;
+ }
+ }
+ UIApplication uiApp = getStateManager().restoreUIRootComponent(context) ;
+ context.setUIApplication(uiApp) ;
+ if(!context.isResponseComplete()) {
+ UIPortletApplication uiPortletApp = (UIPortletApplication)uiApp;
+ uiPortletApp.processRender(this, context) ;
+ }
+ uiApp.setLastAccessApplication(System.currentTimeMillis()) ;
+ } finally {
+ try {
+ for(ApplicationLifecycle lifecycle : getApplicationLifecycle()) {
+ lifecycle.onEndRequest(this, context) ;
+ }
+ } catch (Exception exception){
+ log.error("Error while trying to call onEndRequest of the portlet
ApplicationLifecycle",
+ exception);
+ }
+ WebuiRequestContext.setCurrentInstance(parentAppRequestContext) ;
+ }
+ }
+</programlisting>
+ <para>
+ The processRender() call made on the UIPortletApplication is shown now:
+ </para>
+
+<programlisting> /**
+ * The default processRender for an UIPortletApplication handles two cases:
+ *
+ * A. Ajax is used
+ * ~UWC_TOKEN_START~1255420331108~UWC_TOKEN_END~
+ * If Ajax is used and that the entire portal should not be re rendered, then an
AJAX fragment is
+ * generated with information such as the portlet id, the portlet title, the
portlet modes, the window
+ * states as well as the HTML for the block to render
+ *
+ * B. A full render is made
+ * ----
+ * a simple call to the method super.processRender(context) which will delegate
the call to all the
+ * Lifecycle components
+ *
+ */
+ public void processRender(WebuiApplication app, WebuiRequestContext context) throws
Exception {
+ WebuiRequestContext pContext =
(WebuiRequestContext)context.getParentAppRequestContext();
+ if(context.useAjax() &&!images/pContext.getFullRender()) {
+ Writer w = context.getWriter() ;
+
+ Set<UIComponent> list = context.getUIComponentToUpdateByAjax() ;
+// if(list == null) list = app.getDefaultUIComponentToUpdateByAjax(context) ;
+ if(list!images/= null) {
+ if(getUIPopupMessages().hasMessage())
context.addUIComponentToUpdateByAjax(getUIPopupMessages()) ;
+ for(UIComponent uicomponent : list) {
+ renderBlockToUpdate(uicomponent, context, w) ;
+ }
+ return ;
+ }
+ }
+ super.processRender(context) ;
+ }
+</programlisting>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml
(rev 0)
+++
portal/trunk/docs/reference-guide/en/modules/portlets/Sample_Basic_Portlet.xml 2009-11-30
21:03:01 UTC (rev 874)
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Sample_Basic_Portlet">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Sample Basic Portlet</title>
+ <para>
+ This sample shows a basic 1.0 portlet.
+ </para>
+ <para>
+ Download the redirectportlet.war file in the attachment section.
+ </para>
+</section>
+
+
Added: portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml
(rev 0)
+++ portal/trunk/docs/reference-guide/en/modules/portlets/WebUI.xml 2009-11-30 21:03:01
UTC (rev 874)
@@ -0,0 +1,78 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section id="sect-Reference_Guide-Web_User_Interface_WebUI">
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+
+ --><title>Web User Interface - WebUI</title>
+ <para>
+ WebUI is the name of GateIn's own webframework. GateIn Portal is built with it and
also many applications available in the GateIn platform suites. In its concepts, the WebUI
framework is similar to JSF as it is a component tree based framework. The key aspects of
WebUI are :
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Events based flow
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Components configuration by annotation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Groovy_Templates" /> for
rendering
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-AJAX_in_GateIn_Framework" />
support
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Portlet API friendly
+ </para>
+ </listitem>
+ </itemizedlist>
+ <section id="sect-Reference_Guide-Web_User_Interface_WebUI-Resources">
+ <title>Resources</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" /> : GateIn
portlets are built with WebUI
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <xref linkend="sect-Reference_Guide-Portlet_Lifecycle" />: GateIn
portal itmself is a WebUI application
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ How-to <xref linkend="sect-Reference_Guide-Create_a_WebUI_Portlet"
/>: Learn how to write your own app with WebUI
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+</section>
+
+
Added: portal/trunk/docs/reference-guide/pom.xml
===================================================================
--- portal/trunk/docs/reference-guide/pom.xml (rev 0)
+++ portal/trunk/docs/reference-guide/pom.xml 2009-11-30 21:03:01 UTC (rev 874)
@@ -0,0 +1,89 @@
+<!--
+
+ 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.
+
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- FIXME parent not in sync with current hierarchy -->
+ <parent>
+ <groupId>org.gatein.doc</groupId>
+ <artifactId>doc-parent</artifactId>
+ <version>1.0.0-CR1</version>
+ </parent>
+
+ <groupId>org.gatein.doc</groupId>
+ <artifactId>gatein-user-guide-en</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>GateIn User Guide en</name>
+
+ <!-- TODO Remove when repositories are configured once for all -->
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+</project>