gatein SVN: r8059 - epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2011-11-14 18:05:34 -0500 (Mon, 14 Nov 2011)
New Revision: 8059
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java
Log:
JBEPP-1119 Unsucessful login page is not displayed when using Apache with mod_jk
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java 2011-11-14 22:32:16 UTC (rev 8058)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/ErrorLoginServlet.java 2011-11-14 23:05:34 UTC (rev 8059)
@@ -67,6 +67,11 @@
unregisterTokenCookie(req);
// Clear the token cookie
clearTokenCookie(req, resp);
+
+ //nguyenanhkien2a(a)gmail.com: We set content-type here for using RequestDispatcher.include() method below
+ //We can't use RequestDispatcher.forward() if we want to use some response information for output such as clearing cookies, etc
+ resp.setContentType("text/html; charset=UTF-8");
+
// This allows the customer to define another login page without changing the portal
wciController.showErrorLoginForm(req, resp);
}
14 years, 5 months
gatein SVN: r8058 - in epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules: Advanced/eXoJCR/jcr/searching and 1 other directory.
by do-not-reply@jboss.org
Author: smumford
Date: 2011-11-14 17:32:16 -0500 (Mon, 14 Nov 2011)
New Revision: 8058
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/and-constraint.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/child-node-constraint.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-nodes.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-nodes-case-insensitive.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-similar-nodes.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/multivalue-property-comparison.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/node-scope-index.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-path-or-name.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-property.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/property-comparison.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/regexp-indexing-rule.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/searching-repository-content.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/synonim-provider.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/tip-nodename-with-number.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/WSRP.xml
Log:
Edits to eXo JCR content
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/and-constraint.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/and-constraint.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/and-constraint.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,12 +5,13 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-AND_Constraint">
<title>AND Constraint</title>
- <para>
- Find all fairytales with a page count more than 90 pages.
- </para>
- <para>
- How does it sound in jcr terms - Find all nodes with mixin type 'mix:title' where the property 'jcr:description' equals "fairytale" and whose "prop_pagecount" property value is less than 90.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ To find all <emphasis>fairytales</emphasis> with a page count more than <literal>90</literal> pages. Or, in JCR terms; find all nodes with mixin type <literal>mix:title</literal> where the property <parameter>jcr:description</parameter> equals <emphasis>fairytale</emphasis> and whose <parameter>prop_pagecount</parameter> property value is less than <literal>90</literal>.
+ </para>
+ </formalpara>
+
<note>
<para>
See also <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Multivalue_Property_Comparison" />.
@@ -20,47 +21,21 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-AND_Constraint-Repository_Structure">
<title>Repository Structure:</title>
<para>
- The repository contains mix:title nodes, where prop_pagecount has different values.
+ The repository contains <literal>mix:title</literal> nodes, where <parameter>prop_pagecount</parameter> has different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="War and peace" jcr:description="novel" prop_pagecount=1000
- </para>
+<programlisting>root
+ ├── document1 (mix:title) jcr:title="War and peace" jcr:description="novel" prop_pagecount=1000
+ ├── document2 (mix:title) jcr:title="Cinderella" jcr:description="fairytale" prop_pagecount=100
+ └── document3 (mix:title) jcr:title="Puss in Boots" jcr:description="fairytale" prop_pagecount=60
+</programlisting>
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:title="Cinderella" jcr:description="fairytale" prop_pagecount=100
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:title="Puss in Boots" jcr:description="fairytale" prop_pagecount=60
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-AND_Constraint-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -68,10 +43,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -79,13 +56,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-AND_Constraint-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -95,10 +74,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "document2".
+ <literal>NodeIterator</literal> will return <emphasis>document2</emphasis>.
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/child-node-constraint.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/child-node-constraint.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/child-node-constraint.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,9 +5,14 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Child_Node_Constraint">
<title>Child Node Constraint</title>
- <para>
- Find all nodes with the primary type '<literal>nt:folder</literal>' that are children of node by path "<filename>/root1/root2</filename>". Only find children, do not find further descendants.
- </para>
+
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ To find all nodes with the primary type '<literal>nt:folder</literal>' that are children of node by path "<filename>/root1/root2</filename>". Only find children, do not find further descendants.
+ </para>
+ </formalpara>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Child_Node_Constraint-Repository_Structure">
<title>Repository Structure</title>
<para>
@@ -55,7 +60,7 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Child_Node_Constraint-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -68,7 +73,7 @@
The NodeIterator will return "folder3" and "folder5".
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-nodes.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-nodes.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-nodes.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,71 +5,38 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Nodes">
<title>Finding All Nodes</title>
- <para>
- Find all nodes in the repository. Only those nodes are found to which the session has READ permission. See also <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Access_Control" />.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all nodes in the repository.
+ </para>
+ </formalpara>
+ <note>
+ <title>Note</title>
+ <para>
+ This search will only nodes that the current session has READ access to. See also <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Access_Control" />.
+ </para>
+ </note>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Nodes-Repository_structure">
<title>Repository structure:</title>
<para>
Repository contains many different nodes.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- folder1 (nt:folder)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (nt:file)
- </para>
+<programlisting>root
+└── folder1 (nt:folder)
+ ├── document1 (nt:file)
+ └── folder2 (nt:folder)
+ ├── document2 (nt:unstructured)
+ └── document3 (nt:folder)
+</programlisting>
- </listitem>
- <listitem>
- <para>
- folder2 (nt:folder)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document2 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (nt:folder)
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Nodes-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -77,10 +44,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -88,13 +56,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Nodes-Fetching_result">
<title>Fetching result</title>
<para>
- Let's get nodes:
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -104,10 +74,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "folder1", "folder2","document1","document2","document3", and each other nodes in workspace if they are here.
+ The <literal>NodeIterator</literal> will return <emphasis>folder1</emphasis>, <emphasis>folder2</emphasis>, <emphasis>document1</emphasis>, <emphasis>document2</emphasis>, <emphasis>document3</emphasis>, and each other node in the workspace.
</para>
<para>
- We can also get a table:
+ The results can also be output as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-nodes-case-insensitive.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-nodes-case-insensitive.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-nodes-case-insensitive.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,62 +5,32 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Nodes_in_a_Case_Insensitive_Way">
<title>Finding Nodes in a Case-Insensitive Way</title>
- <para>
- Find all nodes with a mixin type 'mix:title' and where the property 'jcr:title' equals 'casesensitive' in lower or upper case.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all nodes with a mixin type <literal>mix:title</literal> and where the property <parameter>jcr:title</parameter> equals <literal>casesensitive</literal> in lower or upper case.
+ </para>
+ </formalpara>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Nodes_in_a_Case_Insensitive_Way-Repository_Structure">
<title>Repository Structure</title>
<para>
- The repository contains mix:title nodes, whose jcr:title properties have different values.
+ The repository contains <literal>mix:title</literal> nodes, whose <literal>jcr:title</literal> properties have different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="CaseSensitive"
- </para>
+<programlisting>root
+ ├── document1 (mix:title) jcr:title="CaseSensitive"
+ ├── document2 (mix:title) jcr:title="casesensitive"
+ └── document3 (mix:title) jcr:title="caseSENSITIVE"
+</programlisting>
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:title="casesensitive"
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:title="caseSENSITIVE"
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Nodes_in_a_Case_Insensitive_Way-Query_Execution">
<title>Query Execution</title>
- <itemizedlist>
- <listitem>
- <para>
- UPPER case
- </para>
-
- </listitem>
-
- </itemizedlist>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+
+ <formalpara>
+ <title>SQL- Uppercase</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -68,10 +38,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath - Upper Case</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -79,19 +50,11 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <itemizedlist>
- <listitem>
- <para>
- LOWER case
- </para>
-
- </listitem>
-
- </itemizedlist>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>SQL - Lower Case</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -99,10 +62,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath - Lower Case</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -110,13 +74,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Nodes_in_a_Case_Insensitive_Way-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -126,10 +92,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "document1", "document2" and "document3" (in all examples).
+ The <literal>NodeIterator</literal> will return <emphasis>document1</emphasis>, <emphasis>document2</emphasis> and <emphasis>document3</emphasis> (in all examples).
</para>
<para>
- We can also get a table:
+ The results can also be output as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-similar-nodes.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-similar-nodes.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-similar-nodes.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,10 +5,13 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Similar_Nodes">
<title>Finding Similar Nodes</title>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ To find nodes similar to a nominated node at: <literal>/baseFile/jcr:content</literal>.
+ </para>
+ </formalpara>
<para>
- Find similar nodes to a nominated node with the path: '<literal>/baseFile/jcr:content</literal>'.
- </para>
- <para>
In this example, <literal>baseFile</literal> contains text where a keyword (<literal>terms</literal>) is repeated often. This word will be used as a criteria of node similarity (for node baseFile).
</para>
<note>
@@ -42,10 +45,10 @@
<area coords="5" id="area-Reference_Guide_eXo_JCR_1.14-Finding_Similar_Nodes-Repository_structure-target3" />
</areaspec>
<programlisting>root
-├── baseFile (nt:file)
-├── target1 (nt:file)
-├── target2 (nt:file)
-└── target3 (nt:file)
+ ├── baseFile (nt:file)
+ ├── target1 (nt:file)
+ ├── target2 (nt:file)
+ └── target3 (nt:file)
</programlisting>
<calloutlist>
<callout arearefs="area-Reference_Guide_eXo_JCR_1.14-Finding_Similar_Nodes-Repository_structure-baseFile">
@@ -75,10 +78,10 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Similar_Nodes-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -86,10 +89,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -97,13 +102,16 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
+
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Finding_Similar_Nodes-Fetching_result">
- <title>Fetching result</title>
+ <title>Fetching results</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -113,13 +121,13 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "/baseFile/jcr:content","/target1/jcr:content" and "/target3/jcr:content".
+ <literal>NodeIterator</literal> will return <emphasis>/baseFile/jcr:content</emphasis>,<emphasis>/target1/jcr:content</emphasis> and <emphasis>/target3/jcr:content</emphasis>.
</para>
<para>
- As you see the base node are also in result set.
+ As you see the base node are also in the result set.
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
@@ -131,7 +139,7 @@
Value[] values = row.getValues();
}</programlisting>
<para>
- The table content is
+ The table content is:
</para>
<table>
<title>Table content</title>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/multivalue-property-comparison.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/multivalue-property-comparison.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/multivalue-property-comparison.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,53 +5,31 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Multivalue_Property_Comparison">
<title>Multivalue Property Comparison</title>
- <para>
- Find all nodes with the primary type 'nt:unstructured' whose property 'multiprop' contains both values "one" and "two".
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ To find all nodes with the primary type <literal>nt:unstructured</literal> whose property <parameter>multiprop</parameter> contains both values <emphasis>one</emphasis> and <emphasis>two</emphasis>.
+ </para>
+ </formalpara>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Multivalue_Property_Comparison-Repository_Structure">
<title>Repository Structure</title>
<para>
The repository contains nt:unstructured nodes with different 'multiprop' properties.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- node1 (nt:unstructured) multiprop = [ "one","two" ]
- </para>
-
- </listitem>
- <listitem>
- <para>
- node1 (nt:unstructured) multiprop = [ "one","two","three" ]
- </para>
-
- </listitem>
- <listitem>
- <para>
- node1 (nt:unstructured) multiprop = [ "one","five" ]
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
+<programlisting>root
+ ├── node1 (nt:unstructured) multiprop = [ "one","two" ]
+ ├── node1 (nt:unstructured) multiprop = [ "one","two","three" ]
+ └── node1 (nt:unstructured) multiprop = [ "one","five" ]
+</programlisting>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Multivalue_Property_Comparison-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -59,10 +37,13 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -70,13 +51,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Multivalue_Property_Comparison-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -86,10 +69,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- The NodeIterator will return "node1" and "node2".
+ The <literal>NodeIterator</literal> will return <emphasis>node1</emphasis> and <emphasis>node2</emphasis>.
</para>
<para>
- We can also get a table:
+ The results can be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
@@ -101,7 +84,7 @@
Value[] values = row.getValues();
}</programlisting>
<para>
- Table content is:
+ The table content is:
<table>
<title>Table content</title>
<tgroup cols="3">
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/node-scope-index.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/node-scope-index.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/node-scope-index.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -6,10 +6,10 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Removing_Nodes_Property_From_Indexing_Scope">
<title>Removing Nodes Property From Indexing Scope</title>
<para>
- In this example, we will exclude some 'text' property of nt:unstructured node from indexing. And, therefore, node will not be found by the content of this property, even if it accepts all constraints.
+ In this example, we will exclude a <emphasis>text</emphasis> property of <literal>nt:unstructured</literal> nodes from being indexed. This means the node will not be found by a search for the content of this property, even if it accepts all constraints.
</para>
<para>
- First of all, add rules to indexing-configuration.xml:
+ Add appropriate rules to the <filename>indexing-configuration.xml</filename> file:
</para>
<programlisting language="XML" role="XML"><index-rule nodeType="nt:unstructured" condition="@rule='nsiTrue'">
@@ -21,56 +21,30 @@
<!-- do not include text in node scope index -->
<property nodeScopeIndex="false">text</property>
</index-rule></programlisting>
- <note>
+
<para>
- See <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" />
+ Refer to <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> for more details.
</para>
- </note>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Removing_Nodes_Property_From_Indexing_Scope-Repository_structure">
- <title>Repository structure:</title>
+ <title>Repository structure</title>
<para>
- Repository contains nt:unstructured nodes, with same 'text'property and different 'rule' properties (even null)
+ The repository contains <literal>nt:unstructured</literal> nodes, with same <emphasis>text</emphasis> property and different <emphasis>rule</emphasis> properties.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- node1 (nt:unstructured) rule="nsiTrue" text="The quick brown fox ..."
- </para>
+<programlisting>root
+ ├── node1 (nt:unstructured) rule="nsiTrue" text="The quick brown fox ..."
+ ├── node2 (nt:unstructured) rule="nsiFalse" text="The quick brown fox ..."
+ └── node3 (nt:unstructured) text="The quick brown fox ..." // as you see this node not mentioned in indexing-configuration
+</programlisting>
- </listitem>
- <listitem>
- <para>
- node2 (nt:unstructured) rule="nsiFalse" text="The quick brown fox ..."
- </para>
-
- </listitem>
- <listitem>
- <para>
- node3 (nt:unstructured) text="The quick brown fox ..." // as you see this node not mentioned in indexing-configuration
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Removing_Nodes_Property_From_Indexing_Scope-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -78,10 +52,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -89,13 +65,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Removing_Nodes_Property_From_Indexing_Scope-Fetching_result">
<title>Fetching result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -105,10 +83,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "node1" and "node3". Node2, as you see, is not in result set.
+ The <literal>NodeIterator</literal> will return <emphasis>node1</emphasis> and <emphasis>node3</emphasis>. <emphasis>Node2</emphasis> is not in the result set.
</para>
<para>
- Also, we can get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
@@ -120,7 +98,7 @@
Value[] values = row.getValues();
}</programlisting>
<para>
- Table content is
+ Table content is:
</para>
<table>
<title>Table content</title>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-path-or-name.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-path-or-name.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-path-or-name.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -4,38 +4,38 @@
%BOOK_ENTITIES;
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Ordering_by_Path_or_Name">
- <title>Ordering by Path or Name</title>
- <warning>
- <para>
- Ordering by jcr:path or jcr:name does not supported.
- </para>
+ <title>Ordering by Path or Name</title>
+ <warning>
+ <para>
+ Ordering by <literal>jcr:path</literal> or <literal>jcr:name</literal> is not supported.
+ </para>
- </warning>
- <para>
- There is two ways to order results, when path may be used as criteria:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Order by property with value type NAME or PATH (jcr supports it)
- </para>
+ </warning>
+ <para>
+ There are two ways to order results, when path may be used as criteria:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Order by property with value type <parameter>NAME</parameter> or <parameter>PATH</parameter> (as the JCR supports it).
+ </para>
- </listitem>
- <listitem>
- <para>
- Order by jcr:path or jcr:name - sort by exact path or name of node (jcr do not supports it)
- </para>
+ </listitem>
+ <listitem>
+ <para>
+ Order by <literal>jcr:path</literal> or <literal>jcr:name</literal> which will sort results by exact path or name of node (the JCR does not supports this).
+ </para>
- </listitem>
+ </listitem>
- </itemizedlist>
- <para>
- If no order specification is supplied in the query statement, implementations may support document order on the result nodes (see jsr-170 / 6.6.4.2 Document Order). And it's sorted by order number.
- </para>
- <para>
- By default, (if query do not contains any ordering statements) result nodes is sorted by document order.
- </para>
-
+ </orderedlist>
+ <para>
+ If no order specification is supplied in the query statement, implementations may support document order on the result nodes (as per the <literal>JSR-170</literal> specification). This will sort by order number.
+ </para>
+ <para>
+ By default, (if the query does not contains any ordering statements) result nodes is sorted by document order.
+ </para>
+
<programlisting>SELECT * FROM nt:unstructured WHERE jcr:path LIKE 'testRoot/%'</programlisting>
</section>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-property.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-property.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-property.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,53 +5,32 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Sorting_Nodes_by_Property">
<title>Sorting Nodes by Property</title>
- <para>
- Select all nodes with the mixin type ''mix:title' and order them by the 'prop_pagecount' property.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Select all nodes with the mixin type <literal>mix:title</literal> and order them by the <parameter>prop_pagecount</parameter> property.
+ </para>
+ </formalpara>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Sorting_Nodes_by_Property-Repository_Structure">
<title>Repository Structure</title>
<para>
- The repository contains several mix:title nodes, where prop_pagecount has different values.
+ The repository contains several <literal>mix:title</literal> nodes, where <parameter>prop_pagecount</parameter> has different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="War and peace" jcr:description="roman" prop_pagecount=4
- </para>
+<programlisting>root
+ ├── document1 (mix:title) jcr:title="War and peace" jcr:description="roman" prop_pagecount=4
+ ├── document2 (mix:title) jcr:title="Cinderella" jcr:description="fairytale" prop_pagecount=7
+ └── document3 (mix:title) jcr:title="Puss in Boots" jcr:description="fairytale" prop_pagecount=1
+</programlisting>
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:title="Cinderella" jcr:description="fairytale" prop_pagecount=7
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:title="Puss in Boots" jcr:description="fairytale" prop_pagecount=1
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Sorting_Nodes_by_Property-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -59,10 +38,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -70,13 +51,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Sorting_Nodes_by_Property-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -86,10 +69,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- The NodeIterator will return nodes in the following order "document3", "document1", "document2".
+ The <literal>NodeIterator</literal> will return nodes in the following order: <emphasis>document3</emphasis>, <emphasis>document1</emphasis>, <emphasis>document2</emphasis>".
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/property-comparison.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/property-comparison.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/property-comparison.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,53 +5,32 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Property_Comparison">
<title>Property Comparison</title>
- <para>
- Find all nodes with mixin type 'mix:title' where the prop_pagecount property contains a value less than 90. Only select the title of each node.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ To find all nodes with mixin type <literal>mix:title</literal> where the <parameter>prop_pagecount</parameter> property contains a value less than <literal>90</literal>. Only select the title of each node.
+ </para>
+ </formalpara>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Property_Comparison-Repository_structure">
<title>Repository structure:</title>
<para>
- Repository contains several mix:title nodes, where each prop_pagecount contains a different value.
+ Repository contains several <literal>mix:title</literal> nodes, where each <parameter>prop_pagecount</parameter> contains a different value.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="War and peace" prop_pagecount=1000
- </para>
+<programlisting>root
+ ├── document1 (mix:title) jcr:title="War and peace" prop_pagecount=1000
+ ├── document2 (mix:title) jcr:title="Cinderella" prop_pagecount=100
+ └── document3 (mix:title) jcr:title="Puss in Boots" prop_pagecount=60
+</programlisting>
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:title="Cinderella" prop_pagecount=100
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:title="Puss in Boots" prop_pagecount=60
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Property_Comparison-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -59,10 +38,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -70,13 +51,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Property_Comparison-Fetching_result">
<title>Fetching result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -86,10 +69,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- The NodeIterator will return "document3".
+ The <literal>NodeIterator</literal> will return <literal>document3</literal>.
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
@@ -101,7 +84,7 @@
Value[] values = row.getValues();
}</programlisting>
<para>
- The table content is
+ The table content is:
<table>
<title>Table Content</title>
<tgroup cols="3">
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/regexp-indexing-rule.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/regexp-indexing-rule.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/regexp-indexing-rule.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,66 +5,45 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Regular_Expression_as_Property_Name_in_Indexing_Rules">
<title>Regular Expression as Property Name in Indexing Rules</title>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Tto configure indexing so that all properties of <literal>nt:unstructured</literal> nodes must be excluded from searches, except properties with names ending with a particular <emphasis>Text</emphasis> string.
+ </para>
+ </formalpara>
+
<para>
- In this example, we want to configure indexing in the next way. All properties of nt:unstructured nodes must be excluded from search, except properties whoes names ends with 'Text' string. First of all, add rules to indexing-configuration.xml:
- </para>
+ To begin, add the appropriate rules to the <filename>indexing-configuration.xml</filename> file:
+ </para>
<programlisting language="XML" role="XML"><index-rule nodeType="nt:unstructured"">
<property isRegexp="true">.*Text</property>
</index-rule></programlisting>
- <note>
+
<para>
- See <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" />
+ See <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> for more information.
</para>
-
- </note>
- <para>
- Now, let's check this rule with simple query - select all nodes with primary type 'nt:unstructured' and containing 'quick' string (fulltext search by full node).
- </para>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Regular_Expression_as_Property_Name_in_Indexing_Rules-Repository_structure">
<title>Repository structure:</title>
<para>
- Repository contains nt:unstructured nodes, with different 'text'-like named properties
+ The repository contains <literal>nt:unstructured</literal> nodes, with different <parameter>text</parameter>-based properties:
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- node1 (nt:unstructured) Text="The quick brown fox ..."
- </para>
- </listitem>
- <listitem>
- <para>
- node2 (nt:unstructured) OtherText="The quick brown fox ..."
- </para>
+<programlisting>root
+ ├── node1 (nt:unstructured) Text="The quick brown fox ..."
+ ├── node2 (nt:unstructured) OtherText="The quick brown fox ..."
+ └── node3 (nt:unstructured) Textle="The quick brown fox ..."
+</programlisting>
- </listitem>
- <listitem>
- <para>
- node3 (nt:unstructured) Textle="The quick brown fox ..."
- </para>
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Regular_Expression_as_Property_Name_in_Indexing_Rules-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -72,10 +51,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -83,13 +63,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Regular_Expression_as_Property_Name_in_Indexing_Rules-Fetching_result">
<title>Fetching result</title>
<para>
- Let's get nodes:
+ TO fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -99,10 +81,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "node1" and "node2". "node3", as you see, is not in result set.
+ The <literal>NodeIterator</literal> will return <emphasis>node1</emphasis> and <emphasis>node2</emphasis>. <emphasis>Node3</emphasis> is not in result set.
</para>
<para>
- Also, we can get a table:
+ The results can also be output as a table:
</para>
<programlisting language="Java" role="Java">String[] columnNames = result.getColumnNames();
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/searching-repository-content.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/searching-repository-content.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/searching-repository-content.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -8,7 +8,10 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-Introduction">
<title>Introduction</title>
<para>
- You can find the JCR configuration file here: .../portal/WEB-INF/conf/jcr/repository-configuration.xml. Please read also <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> for more information about index configuration.
+ You can find the JCR configuration file here: <filename><replaceable><JBOSS_HOME></replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/portal/WEB-INF/conf/jcr/repository-configuration.xml</filename>.
+ </para>
+ <para>
+ Please refer to <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> for more information about index configuration.
</para>
</section>
@@ -16,13 +19,13 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-Bi_directional_RangeIterator">
<title>Bi-directional RangeIterator</title>
<para>
- QueryResult.getNodes() will return bi-directional NodeIterator implementation.
+ <literal>QueryResult.getNodes()</literal> will return bi-directional <literal>NodeIterator</literal> implementation.
</para>
<note>
<para>
Bi-directional NodeIterator is <emphasis role="bold">not supported</emphasis> in two cases:
</para>
- <itemizedlist>
+ <orderedlist>
<listitem>
<para>
SQL query: select * from nt:base
@@ -36,11 +39,11 @@
</listitem>
- </itemizedlist>
+ </orderedlist>
</note>
<para>
- TwoWayRangeIterator interface:
+ <literal>TwoWayRangeIterator</literal> interface:
</para>
<programlisting language="Java" role="Java">/**
@@ -71,11 +74,8 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-Fuzzy_Searches">
<title>Fuzzy Searches</title>
<para>
- JCR supports such features as Lucene Fuzzy Searches <ulink url="http://lucene.apache.org/java/2_3_2/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</ulink>.
+ The JBoss Enterprise Portal Platform JCR supports features such as Lucene Fuzzy Searches. To perform a fuzzy search, form your query like the one below:
</para>
- <para>
- To use it, you have to form a query like the one described below:
- </para>
<programlisting language="Java" role="Java">QueryManager qman = session.getWorkspace().getQueryManager();
Query q = qman.createQuery("select * from nt:base where contains(field, 'ccccc~')", Query.SQL);
@@ -86,14 +86,14 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-SynonymSearch">
<title>SynonymSearch</title>
<para>
- Searching with synonyms is integrated in the jcr:contains() function and uses the same syntax as synonym searches in Google. If a search term is prefixed by a tilde symbol ( ~ ), also synonyms of the search term are taken into consideration. For example:
+ Searching with synonyms is integrated in the <literal>jcr:contains()</literal> function and uses the same syntax as synonym searches in web search engines (Google, for example). If a search term is prefixed by a tilde symbol ( ~ ), synonyms of the search term are taken into consideration. For example:
</para>
<programlisting>SQL: select * from nt:resource where contains(., '~parameter')
XPath: //element(*, nt:resource)[jcr:contains(., '~parameter')</programlisting>
<para>
- This feature is disabled by default and you need to add a configuration parameter to the query-handler element in your jcr configuration file to enable it.
+ This feature is disabled by default and you need to add a configuration parameter to the query-handler element in your JCR configuration file to enable it.
</para>
<programlisting language="XML" role="XML"><param name="synonymprovider-config-path" value="..you path to configuration file....."/>
@@ -134,11 +134,14 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-Highlighting">
<title>Highlighting</title>
<para>
- An ExcerptProvider retrieves text excerpts for a node in the query result and marks up the words in the text that match the query terms.
+ An <literal>ExcerptProvider</literal> retrieves text excerpts for a node in the query result and marks up the words in the text that match the query terms.
</para>
<para>
- By default highlighting words matched the query is disabled because this feature requires that additional information is written to the search index. To enable this feature, you need to add a configuration parameter to the query-handler element in your jcr configuration file to enable it.
+ By default, match highlighting is disabled because as it requires that additional information is written to the search index.
</para>
+ <para>
+ To enable this feature, you need to add a configuration parameter to the query-handler element in your JCR configuration file:
+ </para>
<programlisting language="XML" role="XML"><param name="support-highlighting" value="true"/></programlisting>
<para>
@@ -146,6 +149,7 @@
</para>
<programlisting language="XML" role="XML"><param name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultXMLExcerpt"/></programlisting>
+
<section id="sect-Reference_Guide_eXo_JCR_1.14-Highlighting-DefaultXMLExcerpt">
<title>DefaultXMLExcerpt</title>
<para>
@@ -185,9 +189,9 @@
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Highlighting-How_to_use_it">
- <title>How to use it</title>
+ <title>Usage</title>
<para>
- If you are using XPath, you must use the rep:excerpt() function in the last location step, just like you would select properties:
+ If you are using XPath, you must use the <code>rep:excerpt()</code> function in the last location step, just like you would select properties:
</para>
<programlisting language="Java" role="Java">QueryManager qm = session.getWorkspace().getQueryManager();
@@ -199,16 +203,16 @@
Value excerpt = r.getValue("rep:excerpt(.)");
}</programlisting>
<para>
- The above code searches for nodes that contain the word exoplatform and then gets the value of the Title property and an excerpt for each result node.
+ The above code searches for nodes that contain the word <emphasis>exoplatform</emphasis> and then gets the value of the <parameter>Title</parameter> property and an excerpt for each resultant node.
</para>
<para>
- It is also possible to use a relative path in the call Row.getValue() while the query statement still remains the same. Also, you may use a relative path to a string property. The returned value will then be an excerpt based on string value of the property.
+ It is also possible to use a relative path in the call <code>Row.getValue()</code> while the query statement still remains the same. Also, you may use a relative path to a string property. The returned value will then be an excerpt based on string value of the property.
</para>
<para>
- Both available excerpt provider will create fragments of about 150 characters and up to 3 fragments.
+ Both available excerpt providers will create fragments of about 150 characters and up to three fragments.
</para>
<para>
- In SQL, the function is called excerpt() without the rep prefix, but the column in the RowIterator will nonetheless be labelled rep:excerpt(.)!
+ In SQL, the function is called <code>excerpt()</code> without the rep prefix, but the column in the <literal>RowIterator</literal> will nonetheless be labelled <code>rep:excerpt(.)</code>.
</para>
<programlisting language="Java" role="Java">QueryManager qm = session.getWorkspace().getQueryManager();
@@ -227,61 +231,73 @@
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content-SpellChecker">
<title>SpellChecker</title>
<para>
- The lucene based query handler implementation supports a pluggable spell checker mechanism. By default, spell checking is not available and you have to configure it first. See parameter spellCheckerClass on page <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> JCR currently provides an implementation class , which uses the <ulink url="http://wiki.apache.org/jakarta-lucene/SpellChecker">lucene-spellchecker</ulink> to contribute . The dictionary is derived from the fulltext indexed content of the workspace and updated periodically. You can configure the refresh interval by picking one of the available inner classes of org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker:
+ The lucene based query handler implementation supports a pluggable spell-checker mechanism. By default, spell checking is not available, it must be configured first.
+ </para>
+ <para>
+ Information about the <parameter>spellCheckerClass</parameter> parameter is available in <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" />.
</para>
+ <para>
+ The JCR currently provides an implementation class which uses the <ulink url="http://wiki.apache.org/jakarta-lucene/SpellChecker">lucene-spellchecker</ulink>.
+ </para>
+ <para>
+ The dictionary is derived from the fulltext, indexed content of the workspace and updated periodically. You can configure the refresh interval by picking one of the available inner classes of <literal>org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker</literal>:
+ </para>
<itemizedlist>
<listitem>
<para>
- OneMinuteRefreshInterval
+ <literal>OneMinuteRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- FiveMinutesRefreshInterval
+ <literal>FiveMinutesRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- ThirtyMinutesRefreshInterval
+ <literal>ThirtyMinutesRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- OneHourRefreshInterval
+ <literal>OneHourRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- SixHoursRefreshInterval
+ <literal>SixHoursRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- TwelveHoursRefreshInterval
+ <literal>TwelveHoursRefreshInterval</literal>
</para>
</listitem>
<listitem>
<para>
- OneDayRefreshInterval
+ <literal>OneDayRefreshInterval</literal>
</para>
</listitem>
</itemizedlist>
<para>
- For example, if you want a refresh interval of six hours, the class name is: org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$SixHoursRefreshInterval. If you use org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker, the refresh interval will be one hour.
+ For example, if you want a refresh interval of six hours, the class name would be; <literal>org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$SixHoursRefreshInterval</literal>.
+ </para>
+ <para>
+ If you use <literal>org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker</literal>, the refresh interval will be one hour.
</para>
<para>
- The spell checker dictionary is stored as a lucene index under <emphasis role="bold">"index-dir"/spellchecker</emphasis>. If it does not exist, a background thread will create it on startup. Similarly, the dictionary refresh is also done in a background thread to not block regular queries.
+ The spell checker dictionary is stored as a lucene index under <filename><index-dir>/spellchecker</filename>. If this index does not exist, a background thread will create it on start up. Similarly, the dictionary refresh is also done in a background thread so as not to block regular queries.
</para>
<section id="sect-Reference_Guide_eXo_JCR_1.14-SpellChecker-How_do_I_use_it">
- <title>How do I use it?</title>
+ <title>Usage</title>
<para>
You can spell check a fulltext statement either with an XPath or a SQL query:
</para>
@@ -330,52 +346,74 @@
<para>
Similarity is determined by looking up terms that are common to nodes. There are some conditions that must be met for a term to be considered. This is required to limit the number possibly relevant terms.
</para>
+ <para>
+ To be considered, terms must:
+ </para>
<itemizedlist>
<listitem>
<para>
- Only terms with at least 4 characters are considered.
+ Be at least four characters long.
</para>
</listitem>
<listitem>
<para>
- Only terms that occur at least 2 times in the source node are considered.
+ Occur at least twice in the source node.
</para>
</listitem>
<listitem>
<para>
- Only terms that occur in at least 5 nodes are considered.
+ Occur in at least five other nodes.
</para>
</listitem>
</itemizedlist>
- <para>
- Note: The similarity functionality requires that the support Hightlighting is enabled. Please make sure that you have the following parameter set for the query handler in your workspace.xml.
- </para>
+ <note>
+ <title>Note</title>
+ <para>
+ The similarity function requires that the support Hightlighting is enabled. Please make sure that you have the following parameter set for the query handler in your <filename>workspace.xml</filename>.
+ </para>
+<programlisting language="XML" role="XML"><param name="support-highlighting" value="true"/></programlisting>
+ </note>
-<programlisting language="XML" role="XML"><param name="support-highlighting" value="true"/></programlisting>
<para>
- The functions are called rep:similar() (in XPath) and similar() (in SQL) and have two arguments:
+ The functions (<code>rep:similar()</code> in XPath and <code>similar()</code> in SQL) have two arguments:
</para>
- <para>
- relativePath: a relative path to a descendant node or . for the current node. absoluteStringPath: a string literal that contains the path to the node for which to find similar nodes.
- </para>
+ <variablelist>
+ <title></title>
+ <varlistentry>
+ <term>relativePath</term>
+ <listitem>
+ <para>
+ A relative path to a descendant node or a period (<literal>.</literal>) for the current node.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>absoluteStringPath</term>
+ <listitem>
+ <para>
+ A string literal that contains the path to the node for which to find similar nodes.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
<warning>
+ <title>Warning</title>
<para>
Relative path is not supported yet.
</para>
</warning>
- <para>
- Examples:
- </para>
-
+ <example>
+ <title>Example</title>
<programlisting>//element(*, nt:resource)[rep:similar(., '/parentnode/node.txt/jcr:content')]</programlisting>
- <para>
- Finds nt:resource nodes, which are similar to node by path /parentnode/node.txt/jcr:content.
- </para>
+ <para>
+ Finds <literal>nt:resource</literal> nodes, which are similar to node by path <filename>/parentnode/node.txt/jcr:content</filename>.
+ </para>
+ </example>
</section>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/synonim-provider.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/synonim-provider.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/synonim-provider.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -5,9 +5,13 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_By_Synonym">
<title>Searching By Synonym</title>
- <para>
- Find all mix:title nodes where title contains synonyms to 'fast' word.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all <literal>mix:title</literal> nodes whose title contains a synonym for the term <emphasis>fast</emphasis>.
+ </para>
+ </formalpara>
+
<note>
<para>
Refer to <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Searching_Repository_Content" /> for information about synonym provider configuration
@@ -15,7 +19,7 @@
</note>
<para>
- Synonym provider must be configured in indexing-configuration.xml :
+ The synonym provider must be configured in the <filename>indexing-configuration.xml</filename> configuration file:
</para>
<programlisting language="XML" role="XML"><query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -27,44 +31,31 @@
</properties>
</query-handler></programlisting>
<para>
- File synonym.properties contains next synonyms list:
+ The <filename>synonym.properties</filename> file contains the synonyms list:
</para>
+<example>
+ <title>Example Synonym List</title>
<programlisting>ASF=Apache Software Foundation
quick=fast
sluggish=lazy</programlisting>
+</example>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_By_Synonym-Repository_structure">
<title>Repository structure:</title>
<para>
- Repository contains mix:title nodes, where jcr:title has different values.
+ the repository contains <literal>mix:title</literal> nodes, where <literal>jcr:title</literal> has different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="The quick brown fox jumps over the lazy dog."
- </para>
+<programlisting>root
+ └── document1 (mix:title) jcr:title="The quick brown fox jumps over the lazy dog."
+</programlisting>
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_By_Synonym-Query_execution">
<title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -72,10 +63,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -83,13 +75,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Searching_By_Synonym-Fetching_result">
<title>Fetching result</title>
<para>
- Let's get nodes:
+ To fetch nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it = result.getNodes();
@@ -99,11 +93,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return expected document1. This is a purpose of synonym providers. Find by specified word, but return by all synonyms to.
+ The <literal>NodeIterator</literal> will return <emphasis>document1</emphasis> as expected. This is a purpose of synonym providers; to search using specified keyword(s), but return results that contain synonyms to it.
</para>
- </section>
-
+ </section>
</section>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/tip-nodename-with-number.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/tip-nodename-with-number.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/tip-nodename-with-number.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -4,50 +4,43 @@
%BOOK_ENTITIES;
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-XPath_queries_containing_node_names_starting_with_a_number">
- <title>XPath queries containing node names starting with a number</title>
- <para>
- If you execute an XPath request like this:
- </para>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ <title>XPath queries containing node names starting with a number</title>
+ <para>
+ If you execute an XPath request like this:
+ </para>
+
<programlisting language="Java" role="Java">// get QueryManager
QueryManager queryManager = workspace.getQueryManager();
// make XPath query
Query query = queryManager.createQuery("/jcr:root/Documents/Publie/2010//element(*, exo:article)", Query.XPATH);</programlisting>
- <para>
- You will have an error : "Invalid request". This happens because XML does not allow names starting with a number - and XPath is part of XML: <ulink url="http://www.w3.org/TR/REC-xml/#NT-Name">http://www.w3.org/TR/REC-xml/#NT-Name</ulink>
- </para>
- <para>
- Therefore, you cannot do XPath requests using a node name that starts with a number.
- </para>
- <para>
- Easy workarounds:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Use an SQL request.
- </para>
+ <para>
+ You will receive an <code>Invalid request</code> error. This is because XML (and thus XPath) does not allow names starting with a number.
+ </para>
+ <para>
+ Therefore, XPath requests using a node name that starts with a number are invalid.
+ </para>
+ <para>
+ Some possible alternatives are:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Use an SQL request.
+ </para>
- </listitem>
- <listitem>
- <para>
- Use escaping :
- </para>
-
- </listitem>
-
- </itemizedlist>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </listitem>
+ <listitem>
+ <para>
+ Use escaping :
+ </para>
<programlisting language="Java" role="Java">// get QueryManager
QueryManager queryManager = workspace.getQueryManager();
// make XPath query
Query query = queryManager.createQuery("/jcr:root/Documents/Publie/_x0032_010//element(*, exo:article)", Query.XPATH);</programlisting>
+ </listitem>
+
+ </itemizedlist>
+
</section>
Modified: epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/WSRP.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/WSRP.xml 2011-11-14 22:10:59 UTC (rev 8057)
+++ epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/WSRP.xml 2011-11-14 22:32:16 UTC (rev 8058)
@@ -314,7 +314,7 @@
</para>
<para>
- For instructions on how to specify this URL in JBoss Enterprise Portal Platform, refer to <xref linkend="sect-Reference_Guide-Web_Services_for_Remote_Portlets_WSRP-Consuming_Remote_WSRP_Portlets" />.
+ For instructions on how to specify this URL in JBoss Enterprise Portal Platform, refer to <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Web_Services_for_Remote_Portlets_WSRP-Consuming_Remote_WSRP_Portlets" />.
</para>
<para>
@@ -1391,7 +1391,7 @@
</mediaobject></step>
<step><para>
- The fully-qualified name for the <classname>RegistrationPolicy</classname> and <classname>RegistrationPropertyValidator</classname> can be specified here. The default values are acceptable. Refer to <xref linkend="sect-Reference_Guide-Registration_Configuration-Customization_of_Registration_Handling_Behavior" /> for more information.
+ The fully-qualified name for the <classname>RegistrationPolicy</classname> and <classname>RegistrationPropertyValidator</classname> can be specified here. The default values are acceptable. Refer to <xref linkend="sect-Reference_Guide_eXo_JCR_1.14-Registration_Configuration-Customization_of_Registration_Handling_Behavior" /> for more information.
</para></step>
<step><para>
14 years, 5 months
gatein SVN: r8057 - epp/docs/branches/5.2/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2011-11-14 17:10:59 -0500 (Mon, 14 Nov 2011)
New Revision: 8057
Modified:
epp/docs/branches/5.2/Installation_Guide/en-US/ClusteringConfiguration.xml
epp/docs/branches/5.2/Installation_Guide/en-US/DatabaseConfiguration.xml
epp/docs/branches/5.2/Installation_Guide/en-US/Post_Installation.xml
Log:
JBEPP-1360: Actioned feedback from mvanco
Modified: epp/docs/branches/5.2/Installation_Guide/en-US/ClusteringConfiguration.xml
===================================================================
--- epp/docs/branches/5.2/Installation_Guide/en-US/ClusteringConfiguration.xml 2011-11-14 19:39:35 UTC (rev 8056)
+++ epp/docs/branches/5.2/Installation_Guide/en-US/ClusteringConfiguration.xml 2011-11-14 22:10:59 UTC (rev 8057)
@@ -110,9 +110,14 @@
gatein.jcr.data.dir=${gatein.data.dir}/jcr
gatein.jcr.storage.data.dir=${gatein.jcr.data.dir}/values
+gatein.jcr.cache.config=war:/conf/jcr/jbosscache/${gatein.jcr.config.type}/config.xml
+gatein.jcr.lock.cache.config=war:/conf/jcr/jbosscache/${gatein.jcr.config.type}/lock-config.xml
gatein.jcr.index.data.dir=${gatein.jcr.data.dir}/lucene
gatein.jcr.index.changefilterclass=org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter
-
+gatein.jcr.index.cache.config=war:/conf/jcr/jbosscache/cluster/indexer-config.xml
+gatein.jcr.jgroups.config=classpath:/jgroups/gatein-${gatein.default.jgroups.stack:udp}.xml
+gatein.jcr.workspace.default=collaboration
+gatein.jcr.workspace.system=system
[...]</programlisting>
</para>
</section>
Modified: epp/docs/branches/5.2/Installation_Guide/en-US/DatabaseConfiguration.xml
===================================================================
--- epp/docs/branches/5.2/Installation_Guide/en-US/DatabaseConfiguration.xml 2011-11-14 19:39:35 UTC (rev 8056)
+++ epp/docs/branches/5.2/Installation_Guide/en-US/DatabaseConfiguration.xml 2011-11-14 22:10:59 UTC (rev 8057)
@@ -16,9 +16,9 @@
<section id="sect-Reference_Guide-Database_Configuration-Overview">
<title>Overview</title>
- <para>
- A Java Database Connectivity (JDBC) connector/driver is required for JBoss Enterprise Portal Platform to communicate with a relational database management system (RDBMS). JBoss Enterprise Portal Platform comes bundled with the Hypersonic SQL (HSQL) database in order for users to get up and running quickly without having to initially set up a database and the server. However, HSQL should not be used in a production environment and Red Hat does not offer ANY support for it. Therefore we recommend to setup a RDBMS and JBoss Enterprise Portal Platform connect to it as follows:
- </para>
+ <para>
+ A Java Database Connectivity (JDBC) connector/driver is required for JBoss Enterprise Portal Platform to communicate with a relational database management system (RDBMS). JBoss Enterprise Portal Platform comes bundled with the Hypersonic SQL (HSQL) database in order for users to get up and running quickly without having to initially set up a database and the server. However, HSQL should not be used in a production environment and Red Hat does not offer ANY support for it. Therefore we recommend to setup a RDBMS and JBoss Enterprise Portal Platform connect to it as follows:
+ </para>
<para>JBoss Enterprise Portal Platform has two different database dependencies. One is the
identity service configuration, which depends on Hibernate. The other
@@ -41,7 +41,7 @@
datasource descriptor located at
<filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>:
<programlisting language="XML" role="XML">
-<no-tx-datasource>
+<local-tx-datasource>
<jndi-name>gatein-jcr</jndi-name>
<connection-url>
jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-jcr-localDB
@@ -54,7 +54,7 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
-</no-tx-datasource>
+</local-tx-datasource>
</programlisting>
</para>
@@ -82,7 +82,7 @@
datasource descriptor located at <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>:
<programlisting language="XML" role="XML">
-<no-tx-datasource>
+<local-tx-datasource>
<jndi-name>gatein-idm</jndi-name>
<connection-url>
jdbc:hsqldb:${jboss.server.data.dir}${/}gatein${/}hypersonic${/}gatein-idm-localDB
@@ -95,7 +95,7 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
-</no-tx-datasource>
+</local-tx-datasource>
</programlisting>
</para>
@@ -139,53 +139,53 @@
<formalpara id="form-Portal_EAP-Using_a_MySQL_Database-Installing_the_MySQL_RDBMS_JDBC_connector">
<title>Installing the MySQL JDBC connector</title>
<para>The MySQL JDBC connector is required for EPP to use a <application>MySQL</application> database:</para>
- </formalpara>
- <para>
- The <literal>mysql-java-connector</literal> package is available through <ulink type="http" url="https://www.redhat.com/wapps/sso/rhn/login.html?redirect=http%3A%2F%2Frhn...">Red Hat Network</ulink>. This is the recommended installation method.
- </para>
- <para>
- For users who are not able to access the Red Hat Network, <application>MySQL</application> is available directly from <ulink type="http" url="http://www.mysql.com/downloads/connector/j/">http://www.mysql.com</ulink>. You should download a version listed in the Certified Configurations table available on the <ulink url="http://www.jboss.com/products/platforms/portals/testedconfigurations/">JBoss Enterprise Portal Platform</ulink> JBoss website.
- </para>
-
- <formalpara id="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database">
- <title>Creating a MySQL Database</title>
- <para>
- If you have just installed MySQL, make sure the MySQL server is running, and then run the following command to set the root user password:
- </para>
- </formalpara>
- <para>
+ </formalpara>
+ <para>
+ The <literal>mysql-java-connector</literal> package is available through <ulink type="http" url="https://www.redhat.com/wapps/sso/rhn/login.html?redirect=http%3A%2F%2Frhn...">Red Hat Network</ulink>. This is the recommended installation method.
+ </para>
+ <para>
+ For users who are not able to access the Red Hat Network, <application>MySQL</application> is available directly from <ulink type="http" url="http://www.mysql.com/downloads/connector/j/">http://www.mysql.com</ulink>. You should download a version listed in the Certified Configurations table available on the <ulink url="http://www.jboss.com/products/platforms/portals/testedconfigurations/">JBoss Enterprise Portal Platform</ulink> JBoss website.
+ </para>
+
+ <formalpara id="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database">
+ <title>Creating a MySQL Database</title>
+ <para>
+ If you have just installed MySQL, make sure the MySQL server is running, and then run the following command to set the root user password:
+ </para>
+ </formalpara>
+ <para>
<screen>
mysqladmin -u root password '<replaceable>new-root-user-password</replaceable>'
</screen>
- </para>
- <orderedlist>
- <listitem>
- <para>
- Run the following command to log in to MySQL. Enter the root user password when prompted:
- </para>
- <para>
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ Run the following command to log in to MySQL. Enter the root user password when prompted:
+ </para>
+ <para>
<screen>
mysql -u root -p
</screen>
- </para>
- </listitem>
- <listitem>
- <para>
- Use the <command>CREATE DATABASE</command> command to create a new gateinjcr database.
- </para>
- <note><title>Note: Database names</title>
- <para>
- The remainder of this guide, and the configuration examples that follow assume the database names to be gateinjcr and gateinidm. If you change the database names, please update gatein-ds.xml accordingly (for each server configuration used).
- </para>
- </note>
- <para>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use the <command>CREATE DATABASE</command> command to create a new gateinjcr database.
+ </para>
+ <note><title>Note: Database names</title>
+ <para>
+ The remainder of this guide, and the configuration examples that follow assume the database names to be gateinjcr and gateinidm. If you change the database names, please update gatein-ds.xml accordingly (for each server configuration used).
+ </para>
+ </note>
+ <para>
<screen>
mysql> CREATE DATABASE gateinjcr;
</screen>
- </para>
- <para>
- The output should be similar to the following:
- </para>
+ </para>
+ <para>
+ The output should be similar to the following:
+ </para>
<screen>
Query OK, 1 row affected (0.00 sec)
</screen>
@@ -194,10 +194,10 @@
</para>
<screen>mysql> CREATE DATABASE gateinidm;
</screen>
- <para>
- At this point, the <command>SHOW DATABASES;</command> command should display the <command>gatein</command> databases:
- </para>
- <para>
+ <para>
+ At this point, the <command>SHOW DATABASES;</command> command should display the <command>gatein</command> databases:
+ </para>
+ <para>
<screen>
mysql> SHOW DATABASES;
+--------------------+
@@ -210,22 +210,22 @@
+--------------------+
4 rows in set (0.00 sec)
</screen>
- </para>
- <para>
- It is safe to ignore the other databases.
- </para>
- </listitem>
- <listitem>
- <para>
- Add a new user and give that user access to the gatein databases. The following example adds a new user named <computeroutput>gateinuser</computeroutput>, with the password <computeroutput>gateinpassword</computeroutput>. It is recommended that you choose a different password to the one supplied here by changing <replaceable>gateinpassword</replaceable> to some other password:
- </para>
- <screen>CREATE USER 'gateinuser'@'localhost' IDENTIFIED BY 'gateinpassword';</screen>
- </listitem>
- <listitem>
- <para>
- Grant the necessary privileges to the user:
- </para>
- <para>
+ </para>
+ <para>
+ It is safe to ignore the other databases.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add a new user and give that user access to the gatein databases. The following example adds a new user named <computeroutput>gateinuser</computeroutput>, with the password <computeroutput>gateinpassword</computeroutput>. It is recommended that you choose a different password to the one supplied here by changing <replaceable>gateinpassword</replaceable> to some other password:
+ </para>
+ <screen>CREATE USER 'gateinuser'@'localhost' IDENTIFIED BY 'gateinpassword';</screen>
+ </listitem>
+ <listitem>
+ <para>
+ Grant the necessary privileges to the user:
+ </para>
+ <para>
<screen>
mysql> GRANT ALL PRIVILEGES ON gateinjcr.* TO '<replaceable>gateinuser</replaceable>'@'localhost'
IDENTIFIED BY '<replaceable>gateinpassword</replaceable>' WITH GRANT OPTION;
@@ -234,82 +234,82 @@
mysql> GRANT ALL PRIVILEGES ON gateinidm.* TO '<replaceable>gateinuser</replaceable>'@'localhost'
IDENTIFIED BY '<replaceable>gateinpassword</replaceable>' WITH GRANT OPTION;
</screen>
- </para>
+ </para>
<!--
- <note><title>Note: Changed password?</title>
- <para>
- If you changed the portal user's password, remember to also change the password in the MySQL Datasource descriptor.
- </para>
- </note>
+ <note><title>Note: Changed password?</title>
+ <para>
+ If you changed the portal user's password, remember to also change the password in the MySQL Datasource descriptor.
+ </para>
+ </note>
-->
- </listitem>
- </orderedlist>
-
- <formalpara id="form-Portal_EAP-Using_a_MySQL_Database-MySQL_Datasource_Descriptor">
- <title>MySQL Datasource Descriptor</title>
- <para>
- We now need to change the portal database descriptor
- </para>
- </formalpara>
- <orderedlist>
- <listitem>
- <para>
- Edit the file located at <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- Update the following lines in the Datasource descriptor to reflect the correct database, username and password respectively:
- <itemizedlist>
- <listitem>
- <para>
- <computeroutput><connection-url>jdbc:mysql://mysql-hostname:3306/<replaceable>DATABASE</replaceable></connection-url></computeroutput>;
- <itemizedlist>
- <listitem>
- <para>
- In this example the database name is <literal>gateinjcr</literal> for the first datasource listed in <filename>gatein-ds.xml</filename>.
- </para>
- </listitem>
- <listitem>
- <para>
- The database name for the second datasource is <literal>gateinidm</literal>. See the example <filename>gatein-ds.xml</filename> file provided.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput><user-name><replaceable>USER-NAME</replaceable></user-name></computeroutput>;
- <itemizedlist>
- <listitem>
- <para>
- The user-name for this example is <literal>gateinuser</literal>.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- <listitem>
- <para>
- <computeroutput><password><replaceable>PASSWORD</replaceable></password></computeroutput>;
- <itemizedlist>
- <listitem>
- <para>
- This example uses the <literal>gateinpassword</literal> password. Enter this or the password chosen at <xref linkend="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database"></xref>.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
- </orderedlist>
-
+ </listitem>
+ </orderedlist>
+
+ <formalpara id="form-Portal_EAP-Using_a_MySQL_Database-MySQL_Datasource_Descriptor">
+ <title>MySQL Datasource Descriptor</title>
+ <para>
+ We now need to change the portal database descriptor
+ </para>
+ </formalpara>
+ <orderedlist>
+ <listitem>
+ <para>
+ Edit the file located at <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Update the following lines in the Datasource descriptor to reflect the correct database, username and password respectively:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <computeroutput><connection-url>jdbc:mysql://mysql-hostname:3306/<replaceable>DATABASE</replaceable></connection-url></computeroutput>;
+ <itemizedlist>
+ <listitem>
+ <para>
+ In this example the database name is <literal>gateinjcr</literal> for the first datasource listed in <filename>gatein-ds.xml</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The database name for the second datasource is <literal>gateinidm</literal>. See the example <filename>gatein-ds.xml</filename> file provided.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput><user-name><replaceable>USER-NAME</replaceable></user-name></computeroutput>;
+ <itemizedlist>
+ <listitem>
+ <para>
+ The user-name for this example is <literal>gateinuser</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <computeroutput><password><replaceable>PASSWORD</replaceable></password></computeroutput>;
+ <itemizedlist>
+ <listitem>
+ <para>
+ This example uses the <literal>gateinpassword</literal> password. Enter this or the password chosen at <xref linkend="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database"></xref>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </orderedlist>
+
<para><filename>gatein-ds.xml</filename> will then look like:</para>
<programlisting language="XML" role="XML"><![CDATA[<datasources>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-idm</jndi-name>
<connection-url>jdbc:mysql://mysql-hostname:3306/gateinidm</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
@@ -320,9 +320,9 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
- <no-tx-datasource>
+ <local-tx-datasource>
<jndi-name>gatein-jcr</jndi-name>
<connection-url>jdbc:mysql://mysql-hostname:3306/gateinjcr</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
@@ -333,16 +333,16 @@
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
- </no-tx-datasource>
+ </local-tx-datasource>
</datasources>]]>
</programlisting>
- <important>
- <title>Important</title>
- <para>
- Some underlying JBoss Enterprise Application Platform services might still be using Hypersonic which is an in-VM database server loaded in the same memory space. To connect these services to another RDBMS or disable them please refer to the EAP documentation or simply contact JBoss Support for assistance.
- </para>
- </important>
+ <important>
+ <title>Important</title>
+ <para>
+ Some underlying JBoss Enterprise Application Platform services might still be using Hypersonic which is an in-VM database server loaded in the same memory space. To connect these services to another RDBMS or disable them please refer to the EAP documentation or simply contact JBoss Support for assistance.
+ </para>
+ </important>
</section>
Modified: epp/docs/branches/5.2/Installation_Guide/en-US/Post_Installation.xml
===================================================================
--- epp/docs/branches/5.2/Installation_Guide/en-US/Post_Installation.xml 2011-11-14 19:39:35 UTC (rev 8056)
+++ epp/docs/branches/5.2/Installation_Guide/en-US/Post_Installation.xml 2011-11-14 22:10:59 UTC (rev 8057)
@@ -204,7 +204,7 @@
<formalpara>
<title>Disabling Authentication for HTTP Invoker:</title>
<para>
- To disable authentication for the http invoker, <literal>JNDIFactory</literal>, <literal>EJBInvokerServlet</literal>, and <literal>JMXInvokerServlet</literal> need to be removed from the security realm in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml/deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml</filename> file:
+ To disable authentication for the http invoker, <literal>JNDIFactory</literal>, <literal>EJBInvokerServlet</literal>, and <literal>JMXInvokerServlet</literal> need to be removed from the security realm in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml</filename> file:
<programlisting language="XML" role="XML">
<security-constraint>
<web-resource-collection>
@@ -226,7 +226,7 @@
<formalpara>
<title>Disabling Authentication for JMX Invoker:</title>
<para>
- To disable authentication for the JMX invoker, edit the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml/deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml/deploy/jmx-invoker-service.xml</filename> file to comment out the security interceptor passthrough:
+ To disable authentication for the JMX invoker, edit the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/jmx-invoker-service.xml</filename> file to comment out the security interceptor passthrough:
</para>
</formalpara>
<para>
14 years, 5 months
gatein SVN: r8056 - epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-11-14 14:39:35 -0500 (Mon, 14 Nov 2011)
New Revision: 8056
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java
Log:
JBEPP-1100: only allow initial URI login redirects to locations on the same server.
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java 2011-11-14 19:19:40 UTC (rev 8055)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java 2011-11-14 19:39:35 UTC (rev 8056)
@@ -27,6 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -42,11 +44,27 @@
{
String initialURI = req.getParameter("initialURI");
log.debug("Performing the do login send redirect with initialURI=" + initialURI + " and remoteUser=" + req.getRemoteUser());
+
if (initialURI == null || initialURI.length() == 0)
{
initialURI = req.getContextPath();
}
+ try
+ {
+ URI uri = new URI(initialURI);
+ if (uri.isAbsolute() && !(uri.getHost().equals(req.getServerName())))
+ {
+ log.warn("Cannot redirect to an URI outside of the current host when using a login redirect. Redirecting to the portal context path instead.");
+ initialURI = req.getContextPath();
+ }
+ }
+ catch (URISyntaxException e)
+ {
+ log.warn("Initial URI in login link is malformed. Redirecting to the portal context path instead.");
+ initialURI = req.getContextPath();
+ }
+
//
resp.sendRedirect(resp.encodeRedirectURL(initialURI));
}
14 years, 5 months
gatein SVN: r8055 - portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: mwringe
Date: 2011-11-14 14:19:40 -0500 (Mon, 14 Nov 2011)
New Revision: 8055
Modified:
portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java
Log:
GTNPORTAL-2269: only allow initial URI login redirects to locations on the same server.
Modified: portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java
===================================================================
--- portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java 2011-11-14 11:04:23 UTC (rev 8054)
+++ portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/DoLoginServlet.java 2011-11-14 19:19:40 UTC (rev 8055)
@@ -27,6 +27,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -42,11 +44,27 @@
{
String initialURI = req.getParameter("initialURI");
log.debug("Performing the do login send redirect with initialURI=" + initialURI + " and remoteUser=" + req.getRemoteUser());
+
if (initialURI == null || initialURI.length() == 0)
{
initialURI = req.getContextPath();
}
+ try
+ {
+ URI uri = new URI(initialURI);
+ if (uri.isAbsolute() && !(uri.getHost().equals(req.getServerName())))
+ {
+ log.warn("Cannot redirect to an URI outside of the current host when using a login redirect. Redirecting to the portal context path instead.");
+ initialURI = req.getContextPath();
+ }
+ }
+ catch (URISyntaxException e)
+ {
+ log.warn("Initial URI in login link is malformed. Redirecting to the portal context path instead.");
+ initialURI = req.getContextPath();
+ }
+
//
resp.sendRedirect(resp.encodeRedirectURL(initialURI));
}
14 years, 5 months
gatein SVN: r8054 - portal/trunk.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2011-11-14 06:04:23 -0500 (Mon, 14 Nov 2011)
New Revision: 8054
Modified:
portal/trunk/pom.xml
Log:
GTNPORTAL-2270 Upgrade Chromattic 1.1.1
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-11-14 07:05:07 UTC (rev 8053)
+++ portal/trunk/pom.xml 2011-11-14 11:04:23 UTC (rev 8054)
@@ -55,8 +55,8 @@
<rhino.version>1.6R5</rhino.version>
<org.codehaus.groovy.version>1.7.6</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
- <version.chromattic>1.1.0</version.chromattic>
- <version.reflext>1.1.0-beta12</version.reflext>
+ <version.chromattic>1.1.1</version.chromattic>
+ <version.reflext>1.1.0</version.reflext>
<org.staxnav.version>0.9.6</org.staxnav.version>
<jcip.version>1.0</jcip.version>
<commons-dbcp.version>1.2.2</commons-dbcp.version>
14 years, 5 months
gatein SVN: r8053 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/webui/workspace and 1 other directory.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2011-11-14 02:05:07 -0500 (Mon, 14 Nov 2011)
New Revision: 8053
Modified:
portal/trunk/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
Log:
GTNPORTAL-1213 A small bug fix and fix up the order configuration for core JS modules to ensure they will be loaded first
Modified: portal/trunk/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml 2011-11-14 04:41:36 UTC (rev 8052)
+++ portal/trunk/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml 2011-11-14 07:05:07 UTC (rev 8053)
@@ -111,216 +111,253 @@
<theme-name>VistaTheme</theme-name>
</style-theme>
</window-style>
-
- <javascript>
- <param>
- <js-module>eXo</js-module>
- <js-path>/javascript/eXo.js</js-path>
- <js-priority>0</js-priority>
- </param>
- </javascript>
- <!-- CORE Javascripts -->
- <javascript>
- <param>
- <js-module>eXo.core.Utils</js-module>
- <js-path>/javascript/eXo/core/Util.js</js-path>
- <js-priority>1</js-priority>
- </param>
- <param>
- <js-module>eXo.core.DOMUtil</js-module>
- <js-path>/javascript/eXo/core/DOMUtil.js</js-path>
- <js-priority>1</js-priority>
- </param>
- <param>
- <js-module>eXo.core.HTMLUtil</js-module>
- <js-path>/javascript/eXo/core/HTMLUtil.js</js-path>
- <js-priority>2</js-priority>
- </param>
- <param>
- <js-module>eXo.core.html.HTMLEntities</js-module>
- <js-path>/javascript/eXo/core/html/HTMLEntities.js</js-path>
- <js-priority>1</js-priority>
- </param>
- <param>
- <js-module>eXo.core.Browser</js-module>
- <js-path>/javascript/eXo/core/Browser.js</js-path>
- <js-priority>2</js-priority>
- </param>
- <param>
- <js-module>eXo.core.MouseEventManager</js-module>
- <js-path>/javascript/eXo/core/MouseEventManager.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.UIMaskLayer</js-module>
- <js-path>/javascript/eXo/core/UIMaskLayer.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Skin</js-module>
- <js-path>/javascript/eXo/core/Skin.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.DragDrop</js-module>
- <js-path>/javascript/eXo/core/DragDrop.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.DragDrop2</js-module>
- <js-path>/javascript/eXo/core/DragDrop2.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Topic</js-module>
- <js-path>/javascript/eXo/core/Topic.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.JSON</js-module>
- <js-path>/javascript/eXo/core/JSON.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Cometd</js-module>
- <js-path>/javascript/eXo/core/Cometd.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Spliter</js-module>
- <js-path>/javascript/eXo/core/Spliter.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Notification</js-module>
- <js-path>/javascript/eXo/core/Notification.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.Loader</js-module>
- <js-path>/javascript/eXo/core/Loader.js</js-path>
- </param>
- <param>
- <js-module>eXo.core.I18n</js-module>
- <js-path>/javascript/eXo/core/I18n.js</js-path>
- </param>
- </javascript>
+ <javascript>
+ <param>
+ <js-module>eXo</js-module>
+ <js-path>/javascript/eXo.js</js-path>
+ <js-priority>0</js-priority>
+ </param>
+ </javascript>
- <!-- Gadget Javascripts -->
- <javascript>
- <param>
- <js-module>eXo.gadget.UIGadget</js-module>
- <js-path>/javascript/eXo/gadget/UIGadget.js</js-path>
- </param>
- </javascript>
+ <!-- CORE Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.core.Utils</js-module>
+ <js-path>/javascript/eXo/core/Util.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.DOMUtil</js-module>
+ <js-path>/javascript/eXo/core/DOMUtil.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.html.HTMLEntities</js-module>
+ <js-path>/javascript/eXo/core/html/HTMLEntities.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.HTMLUtil</js-module>
+ <js-path>/javascript/eXo/core/HTMLUtil.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Browser</js-module>
+ <js-path>/javascript/eXo/core/Browser.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Loader</js-module>
+ <js-path>/javascript/eXo/core/Loader.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.MouseEventManager</js-module>
+ <js-path>/javascript/eXo/core/MouseEventManager.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.UIMaskLayer</js-module>
+ <js-path>/javascript/eXo/core/UIMaskLayer.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Skin</js-module>
+ <js-path>/javascript/eXo/core/Skin.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.DragDrop</js-module>
+ <js-path>/javascript/eXo/core/DragDrop.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.DragDrop2</js-module>
+ <js-path>/javascript/eXo/core/DragDrop2.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Topic</js-module>
+ <js-path>/javascript/eXo/core/Topic.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.JSON</js-module>
+ <js-path>/javascript/eXo/core/JSON.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Cometd</js-module>
+ <js-path>/javascript/eXo/core/Cometd.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Spliter</js-module>
+ <js-path>/javascript/eXo/core/Spliter.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.Notification</js-module>
+ <js-path>/javascript/eXo/core/Notification.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.core.I18n</js-module>
+ <js-path>/javascript/eXo/core/I18n.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ </javascript>
- <!-- WebUI Javascripts -->
- <javascript>
- <param>
- <js-module>eXo.webui.UIItemSelector</js-module>
- <js-path>/javascript/eXo/webui/UIItemSelector.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIForm</js-module>
- <js-path>/javascript/eXo/webui/UIForm.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIPopup</js-module>
- <js-path>/javascript/eXo/webui/UIPopup.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIPopupSelectCategory</js-module>
- <js-path>/javascript/eXo/webui/UIPopupSelectCategory.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIPopupWindow</js-module>
- <js-path>/javascript/eXo/webui/UIPopupWindow.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIHorizontalTabs</js-module>
- <js-path>/javascript/eXo/webui/UIHorizontalTabs.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIPopupMenu</js-module>
- <js-path>/javascript/eXo/webui/UIPopupMenu.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIDropDownControl</js-module>
- <js-path>/javascript/eXo/webui/UIDropDownControl.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIRightClickPopupMenu</js-module>
- <js-path>/javascript/eXo/webui/UIRightClickPopupMenu.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIVerticalSlideTabs</js-module>
- <js-path>/javascript/eXo/webui/UIVerticalSlideTabs.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIPermissionSelectorTab</js-module>
- <js-path>/javascript/eXo/webui/UIPermissionSelectorTab.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIDashboard</js-module>
- <js-path>/javascript/eXo/webui/UIDashboard.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIDashboardUtil</js-module>
- <js-path>/javascript/eXo/webui/UIDashboardUtil.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UINotification</js-module>
- <js-path>/javascript/eXo/webui/UINotification.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIUserSelector</js-module>
- <js-path>/javascript/eXo/webui/UIUserSelector.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UICombobox</js-module>
- <js-path>/javascript/eXo/webui/UICombobox.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UICombobox</js-module>
- <js-path>/javascript/eXo/webui/UIVirtualList.js</js-path>
- </param>
- <param>
- <js-module>eXo.webui.UIColorPicker</js-module>
- <js-path>/javascript/eXo/webui/UIColorPicker.js</js-path>
- </param>
- </javascript>
+ <!-- Gadget Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.gadget.UIGadget</js-module>
+ <js-path>/javascript/eXo/gadget/UIGadget.js</js-path>
+ <js-priority>2</js-priority>
+ </param>
+ </javascript>
- <!-- Portal Javascripts -->
- <javascript>
- <param>
- <js-module>eXo.portal.PortalHttpRequest</js-module>
- <js-path>/javascript/eXo/portal/PortalHttpRequest.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIPortal</js-module>
- <js-path>/javascript/eXo/portal/UIPortal.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIWorkspace</js-module>
- <js-path>/javascript/eXo/portal/UIWorkspace.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIPortalControl</js-module>
- <js-path>/javascript/eXo/portal/UIPortalControl.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.PortalDragDrop</js-module>
- <js-path>/javascript/eXo/portal/PortalDragDrop.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIPortalNavigation</js-module>
- <js-path>/javascript/eXo/portal/UIPortalNavigation.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIMaskWorkspace</js-module>
- <js-path>/javascript/eXo/portal/UIMaskWorkspace.js</js-path>
- </param>
- <param>
- <js-module>eXo.portal.UIBrowseContent</js-module>
- <js-path>/javascript/eXo/portal/UIBrowseContent.js</js-path>
- </param>
- </javascript>
+ <!-- Portal Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.portal.PortalHttpRequest</js-module>
+ <js-path>/javascript/eXo/portal/PortalHttpRequest.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortal</js-module>
+ <js-path>/javascript/eXo/portal/UIPortal.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIWorkspace</js-module>
+ <js-path>/javascript/eXo/portal/UIWorkspace.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortalControl</js-module>
+ <js-path>/javascript/eXo/portal/UIPortalControl.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.PortalDragDrop</js-module>
+ <js-path>/javascript/eXo/portal/PortalDragDrop.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIPortalNavigation</js-module>
+ <js-path>/javascript/eXo/portal/UIPortalNavigation.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIMaskWorkspace</js-module>
+ <js-path>/javascript/eXo/portal/UIMaskWorkspace.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.portal.UIBrowseContent</js-module>
+ <js-path>/javascript/eXo/portal/UIBrowseContent.js</js-path>
+ <js-priority>3</js-priority>
+ </param>
+ </javascript>
- <javascript>
- <param>
- <js-module>eXo.webui.UIPortlet</js-module>
- <js-path>/javascript/eXo/webui/UIPortlet.js</js-path>
- </param>
- </javascript>
+ <!-- WebUI Javascripts -->
+ <javascript>
+ <param>
+ <js-module>eXo.webui.UIItemSelector</js-module>
+ <js-path>/javascript/eXo/webui/UIItemSelector.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIForm</js-module>
+ <js-path>/javascript/eXo/webui/UIForm.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopup</js-module>
+ <js-path>/javascript/eXo/webui/UIPopup.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupSelectCategory</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupSelectCategory.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupWindow</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupWindow.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIHorizontalTabs</js-module>
+ <js-path>/javascript/eXo/webui/UIHorizontalTabs.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPopupMenu</js-module>
+ <js-path>/javascript/eXo/webui/UIPopupMenu.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDropDownControl</js-module>
+ <js-path>/javascript/eXo/webui/UIDropDownControl.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIRightClickPopupMenu</js-module>
+ <js-path>/javascript/eXo/webui/UIRightClickPopupMenu.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIVerticalSlideTabs</js-module>
+ <js-path>/javascript/eXo/webui/UIVerticalSlideTabs.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPermissionSelectorTab</js-module>
+ <js-path>/javascript/eXo/webui/UIPermissionSelectorTab.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDashboard</js-module>
+ <js-path>/javascript/eXo/webui/UIDashboard.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIDashboardUtil</js-module>
+ <js-path>/javascript/eXo/webui/UIDashboardUtil.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UINotification</js-module>
+ <js-path>/javascript/eXo/webui/UINotification.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIUserSelector</js-module>
+ <js-path>/javascript/eXo/webui/UIUserSelector.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UICombobox</js-module>
+ <js-path>/javascript/eXo/webui/UICombobox.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UICombobox</js-module>
+ <js-path>/javascript/eXo/webui/UIVirtualList.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIColorPicker</js-module>
+ <js-path>/javascript/eXo/webui/UIColorPicker.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ <param>
+ <js-module>eXo.webui.UIPortlet</js-module>
+ <js-path>/javascript/eXo/webui/UIPortlet.js</js-path>
+ <js-priority>4</js-priority>
+ </param>
+ </javascript>
</gatein-resources>
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2011-11-14 04:41:36 UTC (rev 8052)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2011-11-14 07:05:07 UTC (rev 8053)
@@ -328,7 +328,8 @@
public Collection<PortalJScript> getPortalJScripts()
{
JavascriptConfigService service = getApplicationComponent(JavascriptConfigService.class);
- return service.getPortalJScripts(Util.getUIPortal().getName());
+ String portalOwner = Util.getPortalRequestContext().getPortalOwner();
+ return service.getPortalJScripts(portalOwner);
}
public Collection<Skin> getPortalSkins()
14 years, 5 months
gatein SVN: r8052 - epp/docs/branches/5.2/Release_Notes/en-US.
by do-not-reply@jboss.org
Author: jaredmorgs
Date: 2011-11-13 23:41:36 -0500 (Sun, 13 Nov 2011)
New Revision: 8052
Modified:
epp/docs/branches/5.2/Release_Notes/en-US/5.2.0_Release_Notes.xml
epp/docs/branches/5.2/Release_Notes/en-US/Book_Info.xml
epp/docs/branches/5.2/Release_Notes/en-US/Revision_History.xml
epp/docs/branches/5.2/Release_Notes/en-US/known_issues.xml
epp/docs/branches/5.2/Release_Notes/en-US/need_info.xml
epp/docs/branches/5.2/Release_Notes/en-US/not_documented.xml
epp/docs/branches/5.2/Release_Notes/en-US/resolved_issues.xml
Log:
first push of release notes doc based on jira triage.
Modified: epp/docs/branches/5.2/Release_Notes/en-US/5.2.0_Release_Notes.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/5.2.0_Release_Notes.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/5.2.0_Release_Notes.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -26,7 +26,7 @@
<para><remark>Updated table from https://docspace.corp.redhat.com/docs/DOC-68705 (version 10)</remark></para>
<table frame="all" pgwide="1">
<title>Component Versions</title>
- <tgroup colsep="1" cols="2">
+ <tgroup cols="2" colsep="1">
<colspec colnum="1"/>
<colspec colnum="2"/>
<thead>
@@ -173,23 +173,19 @@
<title>
<remark>Known Issues</remark>
</title>
- <para>
- Awaiting triage efforts.
- </para>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="known_issues.xml" encoding="XML"/>
</chapter>
- <chapter>
- <title>
- <remark>NEEDINFO</remark>
- </title>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="need_info.xml"/>
- </chapter>
- <chapter>
- <title>
- <remark>Not Yet Documented</remark>
- </title>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="not_documented.xml"/>
- </chapter>
-<!--<chapter id="5.1.1_Release_Notes-Migration">
+<!--<chapter>
+ <title>
+ <remark>NEEDINFO</remark>
+ </title>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="need_info.xml"/>
+</chapter>--><!--<chapter>
+ <title>
+ <remark>Not Yet Documented</remark>
+ </title>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="not_documented.xml"/>
+</chapter>--><!--<chapter id="5.1.1_Release_Notes-Migration">
<title><remark>Migration</remark></title>
<para>
Stuff about migration from 5.1.0 to 5.1.1.
Modified: epp/docs/branches/5.2/Release_Notes/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/Book_Info.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/Book_Info.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -9,7 +9,7 @@
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5.2</productnumber>
<edition>5.2.0</edition>
- <pubsnumber>3</pubsnumber>
+ <pubsnumber>4</pubsnumber>
<abstract>
<para>
These release notes contain important information related to JBoss Enterprise Portal Platform &VZ; that may not be currently available in the Product Manuals. You should read these Release Notes in their entirety before installing the product.
Modified: epp/docs/branches/5.2/Release_Notes/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/Revision_History.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/Revision_History.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -8,8 +8,8 @@
<simpara>
<revhistory>
<revision>
- <revnumber>5.2.0-3</revnumber>
- <date>Fri Nov 11 2011</date>
+ <revnumber>5.2.0-4</revnumber>
+ <date>Mon Nov 14 2011</date>
<author>
<firstname>Jared</firstname>
<surname>Morgan</surname>
@@ -17,7 +17,7 @@
</author>
<revdescription>
<simplelist>
- <member>Converted from Article to Book, to enable better TOC and structure.</member>
+ <member>Release Notes content based on 5.2.0.GA, and 5.2.0.CR1 and 5.2.0.CR01 filter results.</member>
</simplelist>
</revdescription>
</revision>
Modified: epp/docs/branches/5.2/Release_Notes/en-US/known_issues.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/known_issues.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/known_issues.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -1,4 +1,161 @@
+<?xml version='1.0'?>
+<!DOCTYPE variablelist PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
-<para>
-There are no known issues in this release.
-</para>
+
+<variablelist>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1224 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1224" /></term>
+ <listitem>
+
+ <remark>This issue is unassigned!</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ The Services Management Gadget currently has a display issue with the tabs displaying to the left of the table containing the data. This problem presented on Microsoft Internet Explorer 7 on Windows Vista. A fix is being investigated.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1236 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1236" /></term>
+ <listitem>
+
+ <remark>Assignee is: mwringe</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1258 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1258" /></term>
+ <listitem>
+
+ <remark>Assignee is: mwringe</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ Some CSS issues have been identified with the way the Portal home page is rendered. A fix is being investigated.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1271 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1271" /></term>
+ <listitem>
+
+ <remark>This issue is unassigned!</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ When adding a portlet into a 2-column layout container, the container collapses while dragging the portlet into the container. The container sometimes remains collapsed after moving the portlet into the container. This problem presented on Microsoft Windows 7, using Internet Explorer 8. A fix is being investigated.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1345 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1345" /></term>
+ <listitem>
+
+ <remark>This issue is unassigned!</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ An interface abnormality was discovered in the Account Portlet. If more than one instance of the Account Portlet is present on a page, tabs switching will work in the first portlet as designed. If tab switching is attempted in the other instances, the tab and the content in the portlet flashes temporarily, and the original tab is shown again. A fix is being investigated.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1351 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1351" /></term>
+ <listitem>
+
+ <remark>Assignee is: hfnukal</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ The org.gatein.sso.agent.login.SSOLoginModule contains the common options "portal" and "realmName" as offered in other LoginModule classes. In the packaged gatein-jboss-beans.xml, this login module does not have these options. This causes problems when a customer wants to implement SSO on a different portal container (for example in ecmdemo). No workaround exists for this issue.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1352 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1352" /></term>
+ <listitem>
+
+ <remark>Assignee is: hfnukal</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <warning>
+ <title>Not Public Yet - RHT only</title>
+ <para>
+ It was found that JBoss Web Services Native did not properly protect
+against recursive entity resolution when processing Document Type
+Definitions (DTD). A remote attacker could exploit this flaw by sending a
+specially-crafted HTTP POST request to a deployed web service, causing
+excessive CPU and memory consumption on the system hosting that service. If
+the attack is repeated to consume all available network sockets, the server
+will become unavailable. (CVE-2011-1483)
+ </para>
+ </warning>
+
+ </listitem>
+ </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1359 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1359" /></term>
+ <listitem>
+
+ <remark>This issue is unassigned!</remark>
+
+
+ <remark>JIRA is OPEN</remark>
+
+
+ <para>
+ Sybase 15.5 imposes a limitation on the case used in portal names. Only lowercase portal names are supported. The problem does not present in Sybase 15.0.3. A fix is being investigated.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
+</variablelist>
Modified: epp/docs/branches/5.2/Release_Notes/en-US/need_info.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/need_info.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/need_info.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -2,10 +2,46 @@
<!DOCTYPE variablelist PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<variablelist>
- <varlistentry>
- <term>Awaiting</term>
+<!-- https://issues.jboss.org/browse/JBEPP-729 --> <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/browse/JBEPP-729"/>
+ </term>
<listitem>
- <para>Further Triage</para>
+ <remark>Assignee is: mposolda</remark>
+ <remark>JIRA is OPEN</remark>
+ <warning>
+ <title>Not Public Yet - RHT+eXo</title>
+ <para>
+
+ </para>
+ </warning>
</listitem>
</varlistentry>
+<!-- https://issues.jboss.org/browse/JBEPP-1125 --> <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/browse/JBEPP-1125"/>
+ </term>
+ <listitem>
+ <remark>Assignee is: prabhat.jha</remark>
+ <remark>JIRA is OPEN</remark>
+ <para>
+
+ </para>
+ </listitem>
+ </varlistentry>
+<!-- https://issues.jboss.org/browse/JBEPP-1324 --> <varlistentry>
+ <term>
+ <ulink url="https://issues.jboss.org/browse/JBEPP-1324"/>
+ </term>
+ <listitem>
+ <remark>Assignee is: hfnukal</remark>
+ <remark>JIRA is OPEN</remark>
+ <warning>
+ <title>Not Public Yet - RHT+eXo</title>
+ <para>
+
+ </para>
+ </warning>
+ </listitem>
+ </varlistentry>
</variablelist>
Modified: epp/docs/branches/5.2/Release_Notes/en-US/not_documented.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/not_documented.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/not_documented.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -1,11 +1,3 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE variablelist PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
-<variablelist>
-<!-- https://issues.jboss.org/browse/JBEPP-612 --> <varlistentry>
- <term>Awaiting Triage</term>
- <listitem>
- <para>In Jira</para>
- </listitem>
- </varlistentry>
-</variablelist>
+<para>
+All Issues are documented.
+</para>
Modified: epp/docs/branches/5.2/Release_Notes/en-US/resolved_issues.xml
===================================================================
--- epp/docs/branches/5.2/Release_Notes/en-US/resolved_issues.xml 2011-11-12 23:15:56 UTC (rev 8051)
+++ epp/docs/branches/5.2/Release_Notes/en-US/resolved_issues.xml 2011-11-14 04:41:36 UTC (rev 8052)
@@ -1,11 +1,26 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version='1.0'?>
<!DOCTYPE variablelist PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
+
+
<variablelist>
-<!-- https://issues.jboss.org/browse/JBEPP-645 --> <varlistentry>
- <term>Triage</term>
- <listitem>
- <para>is ongoing</para>
- </listitem>
- </varlistentry>
+
+ <!-- https://issues.jboss.org/browse/JBEPP-1357 -->
+ <varlistentry>
+ <term><ulink url="https://issues.jboss.org/browse/JBEPP-1357" /></term>
+ <listitem>
+
+ <remark>Assignee is: claprun</remark>
+
+
+ <remark>JIRA is Closed</remark>
+
+
+ <para>
+ The Web Servlet for Remote Portlet (WSRP) configuration files for consumers and producers could not be stored in the conf/gatein directory. This resulted in extra configuration complexity for customers when creating the configuration directives for WSRP consumers and producers. The fix implements changes to WSRPServiceIntegration.java that declares the default consumer and producer directive file store as /conf.
+ </para>
+
+ </listitem>
+ </varlistentry>
+
</variablelist>
14 years, 5 months
gatein SVN: r8051 - in epp/portal/branches/EPP_5_2_Branch: component and 11 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-12 18:15:56 -0500 (Sat, 12 Nov 2011)
New Revision: 8051
Added:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceService.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/CachedJavascript.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigDeployer.java
Removed:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceHandler.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptKey.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
Modified:
epp/portal/branches/EPP_5_2_Branch/
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/component/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/MainResourceResolver.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SimpleResourceContext.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/Javascript.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptTask.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/AbstractSkinServiceTest.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/MockResourceResolver.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestJavascriptConfigService.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/resources/mockwebapp/gatein-resources.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1029: Need to provide a way to add customer javascript for each site
Property changes on: epp/portal/branches/EPP_5_2_Branch
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7741,7748,7780,7877
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7741,7748,7780,7877,8045
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906,8045
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal
___________________________________________________________________
Modified: svn:mergeinfo
- /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7412,7451,7500,7570-7571,7573,7577,7614-7615,7695-7696,7701-7704,7748,7780,7877
+ /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7412,7451,7500,7570-7571,7573,7577,7614-7615,7695-7696,7701-7704,7748,7780,7877,8045
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906
/portal/trunk/src/main/java/org:7451
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906,8045
/portal/trunk/src/main/java/org:7451
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd 2011-11-12 23:15:56 UTC (rev 8051)
@@ -102,6 +102,9 @@
<xs:complexType name="param">
<xs:sequence>
+ <!-- The portal name loading particular JavaScript module -->
+ <xs:element name="portal-name" type="xs:string" minOccurs="0" maxOccurs="1"/>
+
<!-- The javascript module -->
<xs:element name="js-module" type="xs:string" minOccurs="1" maxOccurs="1"/>
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceHandler.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceHandler.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceHandler.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.resource;
-
-import org.gatein.wci.WebAppEvent;
-import org.gatein.wci.WebAppListener;
-
-/**
- *
- * Created by eXoPlatform SAS
- *
- * Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
- */
-public abstract class AbstractResourceHandler implements WebAppListener
-{
-
- abstract public void onEvent(WebAppEvent event);
-
-}
\ No newline at end of file
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceService.java (from rev 8045, portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceService.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceService.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/AbstractResourceService.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -0,0 +1,76 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.resource;
+
+import org.exoplatform.portal.resource.compressor.ResourceCompressor;
+import org.exoplatform.web.application.javascript.JavascriptConfigService;
+
+import javax.servlet.ServletContext;
+
+/**
+ * An abstract class for resource services in Portal like {@link SkinService}
+ * and {@link JavascriptConfigService}
+ *
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public abstract class AbstractResourceService
+{
+ protected final MainResourceResolver mainResolver;
+
+ protected final ResourceCompressor compressor;
+
+ public AbstractResourceService(ResourceCompressor compressor)
+ {
+ this.compressor = compressor;
+ this.mainResolver = new MainResourceResolver();
+ }
+
+ /**
+ * Add a resource resolver to plug external resolvers.
+ *
+ * @param resolver
+ * a resolver to add
+ */
+ public void addResourceResolver(ResourceResolver resolver)
+ {
+ mainResolver.resolvers.addIfAbsent(resolver);
+ }
+
+ /**
+ * Registry ServletContext into MainResourceResolver of SkinService
+ * @param sContext
+ * ServletContext will be registried
+ */
+ public void registerContext(ServletContext sContext)
+ {
+ mainResolver.registerContext(sContext);
+ }
+
+ /**
+ * unregister a {@link ServletContext} into {@link MainResourceResolver} of {@link SkinService}
+ *
+ * @param servletContext ServletContext will unregistered
+ */
+ public void unregisterServletContext(ServletContext servletContext)
+ {
+ mainResolver.removeServletContext(servletContext);
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigDeployer.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -27,6 +27,7 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.WebAppEvent;
import org.gatein.wci.WebAppLifeCycleEvent;
+import org.gatein.wci.WebAppListener;
import java.io.InputStream;
import java.net.URL;
@@ -41,7 +42,7 @@
*
* Sep 16, 2009
*/
-public class GateInSkinConfigDeployer extends AbstractResourceHandler
+public class GateInSkinConfigDeployer implements WebAppListener
{
/** . */
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/GateInSkinConfigRemoval.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -25,13 +25,14 @@
import org.gatein.wci.WebAppEvent;
import org.gatein.wci.WebAppLifeCycleEvent;
+import org.gatein.wci.WebAppListener;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
* @version $Id$
*
*/
-public class GateInSkinConfigRemoval extends AbstractResourceHandler
+public class GateInSkinConfigRemoval implements WebAppListener
{
private SkinService service;
@@ -44,9 +45,6 @@
this.service = _service;
}
- /**
- * @see org.exoplatform.portal.resource.AbstractResourceHandler#onEvent(org.gatein.wci.WebAppEvent)
- */
@Override
public void onEvent(WebAppEvent event)
{
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/MainResourceResolver.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/MainResourceResolver.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/MainResourceResolver.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -32,7 +32,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-class MainResourceResolver implements ResourceResolver
+public class MainResourceResolver implements ResourceResolver
{
/** . */
@@ -42,19 +42,12 @@
final CopyOnWriteArrayList<ResourceResolver> resolvers;
/** . */
- final Map<SkinKey, SkinConfig> skins;
-
- /** . */
private final Logger log = LoggerFactory.getLogger(MainResourceResolver.class);
- public MainResourceResolver(String portalContainerName, Map<SkinKey, SkinConfig> skins)
+ public MainResourceResolver()
{
- this.skins = skins;
this.contexts = new HashMap<String, SimpleResourceContext>();
this.resolvers = new CopyOnWriteArrayList<ResourceResolver>();
-
- //
- resolvers.add(new CompositeResourceResolver(portalContainerName, skins));
}
/**
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SimpleResourceContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SimpleResourceContext.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SimpleResourceContext.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -20,6 +20,7 @@
package org.exoplatform.portal.resource;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
@@ -49,25 +50,18 @@
int i2 = path.lastIndexOf("/") + 1;
String targetedParentPath = path.substring(0, i2);
String targetedFileName = path.substring(i2);
- try
- {
- final URL url = context.getResource(path);
- if (url != null)
+ final InputStream inputStream = context.getResourceAsStream(path);
+ if (inputStream != null)
{
return new Resource(contextPath, targetedParentPath, targetedFileName)
{
@Override
public Reader read() throws IOException
{
- return new InputStreamReader(url.openStream());
+ return new InputStreamReader(inputStream);
}
};
}
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
return null;
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -39,6 +39,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.resources.Orientation;
+import org.gatein.wci.WebAppListener;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.picocontainer.Startable;
@@ -66,7 +67,7 @@
@Property(key = "type", value = "skin")})
@ManagedDescription("Skin service")
@RESTEndpoint(path = "skinservice")
-public class SkinService implements Startable
+public class SkinService extends AbstractResourceService implements Startable
{
protected static Log log = ExoLogger.getLogger("portal.SkinService");
@@ -108,10 +109,10 @@
public static final String DEFAULT_SKIN = "Default";
/** The deployer. */
- private final AbstractResourceHandler deployer;
+ private final WebAppListener deployer;
/** The removal. */
- private final AbstractResourceHandler removal;
+ private final WebAppListener removal;
private final Map<SkinKey, SkinConfig> portalSkins_;
@@ -125,8 +126,6 @@
private final Map<String, Set<String>> portletThemes_;
- private final MainResourceResolver mainResolver;
-
/**
* The name of the portal container
*/
@@ -140,10 +139,9 @@
*/
final String id = Long.toString(System.currentTimeMillis());
- private ResourceCompressor compressor;
-
public SkinService(ExoContainerContext context, ResourceCompressor compressor)
{
+ super(compressor);
Loader<String, CachedStylesheet, Orientation> loader = new Loader<String, CachedStylesheet, Orientation>()
{
public CachedStylesheet retrieve(Orientation context, String key) throws Exception
@@ -174,7 +172,6 @@
};
//
- this.compressor = compressor;
portalSkins_ = new LinkedHashMap<SkinKey, SkinConfig>();
skinConfigs_ = new LinkedHashMap<SkinKey, SkinConfig>(20);
availableSkins_ = new HashSet<String>(5);
@@ -182,9 +179,10 @@
rtCache = new FutureMap<String, CachedStylesheet, Orientation>(loader);
portletThemes_ = new HashMap<String, Set<String>>();
portalContainerName = context.getPortalContainerName();
- mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
deployer = new GateInSkinConfigDeployer(portalContainerName, this);
removal = new GateInSkinConfigRemoval(portalContainerName, this);
+
+ addResourceResolver(new CompositeResourceResolver(portalContainerName, skinConfigs_));
}
/**
@@ -425,17 +423,6 @@
}
/**
- * Add a resource resolver to plug external resolvers.
- *
- * @param resolver
- * a resolver to add
- */
- public void addResourceResolver(ResourceResolver resolver)
- {
- mainResolver.resolvers.addIfAbsent(resolver);
- }
-
- /**
* Registry theme category with its themes for portlet Theme
* @param categoryName
* category name that will be registried
@@ -1000,26 +987,6 @@
}
/**
- * Registry ServletContext into MainResourceResolver of SkinService
- * @param sContext
- * ServletContext will be registried
- */
- public void registerContext(ServletContext sContext)
- {
- mainResolver.registerContext(sContext);
- }
-
- /**
- * unregister a {@link ServletContext} into {@link MainResourceResolver} of {@link SkinService}
- *
- * @param servletContext ServletContext will unregistered
- */
- public void unregisterServletContext(ServletContext servletContext)
- {
- mainResolver.removeServletContext(servletContext);
- }
-
- /**
* Clean cache, reload all Skins
*/
@Managed
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/CachedJavascript.java (from rev 8045, portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/CachedJavascript.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/CachedJavascript.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/CachedJavascript.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.application.javascript;
+
+import java.util.Date;
+
+/**
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class CachedJavascript
+{
+ /** . */
+ private final String text;
+
+ private long lastModified;
+
+ public CachedJavascript(String text)
+ {
+ this.text = text;
+
+ // Remove miliseconds because string of date retrieve from Http header doesn't have miliseconds
+ lastModified = (new Date().getTime() / 1000) * 1000;
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ public long getLastModified()
+ {
+ return lastModified;
+ }
+}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/Javascript.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/Javascript.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/Javascript.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -19,58 +19,97 @@
package org.exoplatform.web.application.javascript;
-import javax.servlet.ServletContext;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
public class Javascript
{
-
/** . */
- private final JavascriptKey key;
+ private final String module;
/** . */
- private final ServletContext context;
+ private final String contextPath;
/** . */
private final int priority;
- public Javascript(JavascriptKey key, ServletContext context, Integer priority)
+ private final String path;
+
+ public Javascript(String module, String path, String contextPath, int priority)
{
- this.key = key;
- this.context = context;
- this.priority = priority != null ? priority : -1;
+ this.module = module;
+ if (path.startsWith("http://") || path.startsWith("https://"))
+ {
+ this.path = path;
+ }
+ else
+ {
+ this.path = contextPath + path;
+ }
+ this.contextPath = contextPath;
+ this.priority = priority < 0 ? Integer.MAX_VALUE : priority;
}
public String getPath() {
- if(key.isExternalScript())
- {
- return key.getScriptPath();
- }
- return key.getContextPath() + key.getScriptPath();
+ return this.path;
}
- public JavascriptKey getKey()
+ public String getModule()
{
- return key;
+ return module;
}
- public ServletContext getContext()
+ public String getContextPath()
{
- return context;
+ return this.contextPath;
}
public int getPriority()
{
return priority;
}
+
+ public boolean isExternalScript()
+ {
+ return (path.startsWith("http://") || path.startsWith("https://")) ? true : false;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Javascript[module=" + module + ", path=" + path +"]";
+ }
+
+ public static class PortalJScript extends Javascript
+ {
+ private final String portalName;
- public BufferedReader getReader()
+ public PortalJScript(String module, String path, String contextPath, int priority, String portalName)
+ {
+ super(module, path, contextPath, priority);
+ this.portalName = portalName;
+ }
+
+ public String getPortalName()
+ {
+ return portalName;
+ }
+ }
+
+ public static class ExtendedJScript extends Javascript
{
- return new BufferedReader(new InputStreamReader(context.getResourceAsStream(key.getScriptPath())));
+ private final String script;
+
+ public ExtendedJScript(String module, String path, String contextPath, String script)
+ {
+ super(module, path, contextPath, Integer.MAX_VALUE);
+ this.script = script;
+ }
+
+ public String getScript()
+ {
+ return this.script;
+ }
}
}
Copied: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigDeployer.java (from rev 8045, portal/trunk/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigDeployer.java)
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigDeployer.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigDeployer.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.application.javascript;
+
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.gatein.wci.WebAppEvent;
+import org.gatein.wci.WebAppLifeCycleEvent;
+import org.gatein.wci.WebAppListener;
+
+import java.io.InputStream;
+
+import javax.servlet.ServletContext;
+
+/**
+ * An listener for listening the ADDED and REMOVED events of the webapp
+ * to deploy/undeploy Javascript configured in <code>/WEB-INF/gatein-resources.xml</code> file.
+ *
+ * @author <a href="trongtt(a)gmail.com">Trong Tran</a>
+ * @version $Revision$
+ */
+public class JavascriptConfigDeployer implements WebAppListener
+{
+
+ private static final String GATEIN_CONFIG_RESOURCE = "/WEB-INF/gatein-resources.xml";
+
+ /**
+ * Logger
+ */
+ private static final Log LOG = ExoLogger.getLogger(JavascriptConfigDeployer.class);
+
+ /** . */
+ private final JavascriptConfigService javascriptService;
+
+ /**
+ * The name of the portal container
+ */
+ private final String portalContainerName;
+
+ public JavascriptConfigDeployer(String portalContainerName, JavascriptConfigService javascriptService)
+ {
+ this.javascriptService = javascriptService;
+ this.portalContainerName = portalContainerName;
+ }
+
+ public void onEvent(WebAppEvent event)
+ {
+ if (event instanceof WebAppLifeCycleEvent)
+ {
+ WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
+ ServletContext servletContext = lifeCycleEvent.getWebApp().getServletContext();
+ switch (lifeCycleEvent.getType())
+ {
+ case WebAppLifeCycleEvent.ADDED:
+ add(servletContext);
+ break;
+ case WebAppLifeCycleEvent.REMOVED:
+ remove(servletContext);
+ break;
+ }
+ }
+ }
+
+ private void add(ServletContext scontext)
+ {
+ try
+ {
+ InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ if (is == null)
+ {
+ return;
+ }
+
+ Safe.close(is);
+
+ final PortalContainerPostInitTask task = new PortalContainerPostInitTask()
+ {
+
+ public void execute(ServletContext scontext, PortalContainer portalContainer)
+ {
+ register(scontext, portalContainer);
+ javascriptService.registerContext(scontext);
+ }
+ };
+ PortalContainer.addInitTask(scontext, task, portalContainerName);
+ }
+ catch (Exception ex)
+ {
+ LOG.error("An error occurs while registering 'Javascript in gatein-resources.xml' from the context '"
+ + (scontext == null ? "unknown" : scontext.getServletContextName()) + "'", ex);
+ }
+ }
+
+ private void remove(ServletContext scontext)
+ {
+ javascriptService.unregisterServletContext(scontext);
+ }
+
+ private void register(ServletContext scontext, PortalContainer container)
+ {
+ InputStream is = null;
+ try
+ {
+ is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
+ JavascriptConfigParser.processConfigResource(is, javascriptService, scontext);
+ }
+ catch (Exception ex)
+ {
+ LOG.error("An error occurs while processing 'Javascript in gatein-resources.xml' from the context '"
+ + scontext.getServletContextName() + "'", ex);
+ }
+ finally
+ {
+ Safe.close(is);
+ }
+ }
+}
\ No newline at end of file
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigParser.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -47,6 +47,8 @@
final public static String JAVA_SCRIPT_PATH = "js-path";
final public static String JAVA_SCRIPT_PRIORITY = "js-priority";
+
+ final public static String JAVA_SCRIPT_PORTAL_NAME = "portal-name";
/** . */
private ServletContext context;
@@ -118,19 +120,37 @@
param_ele.getElementsByTagName(JAVA_SCRIPT_MODULE).item(0).getFirstChild().getNodeValue();
String js_path =
param_ele.getElementsByTagName(JAVA_SCRIPT_PATH).item(0).getFirstChild().getNodeValue();
- Integer js_priority = null;
+ int priority;
try
{
- js_priority =
+ priority =
Integer.valueOf(param_ele.getElementsByTagName(JAVA_SCRIPT_PRIORITY).item(0)
- .getFirstChild().getNodeValue());
+ .getFirstChild().getNodeValue()).intValue();
}
catch (Exception e)
{
- //Js_priority still is null;
+ priority = Integer.MAX_VALUE;
}
- JavascriptKey key = new JavascriptKey(js_module, js_path, context.getContextPath());
- Javascript js = new Javascript(key, context, js_priority);
+ String portalName = null;
+ try
+ {
+ portalName = param_ele.getElementsByTagName(JAVA_SCRIPT_PORTAL_NAME).item(0)
+ .getFirstChild().getNodeValue();
+ }
+ catch (Exception e)
+ {
+ // portal-name is null
+ }
+
+ Javascript js;
+ if (portalName == null)
+ {
+ js = new Javascript(js_module, js_path, context.getContextPath(), priority);
+ }
+ else
+ {
+ js = new Javascript.PortalJScript(js_module, js_path, context.getContextPath(), priority, portalName);
+ }
task.addScript(js);
}
return task;
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -19,254 +19,298 @@
package org.exoplatform.web.application.javascript;
+import org.exoplatform.commons.cache.future.FutureMap;
+import org.exoplatform.commons.cache.future.Loader;
import org.exoplatform.commons.utils.Safe;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.resource.AbstractResourceService;
+import org.exoplatform.portal.resource.MainResourceResolver;
+import org.exoplatform.portal.resource.Resource;
+import org.exoplatform.portal.resource.ResourceResolver;
+import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.resource.compressor.ResourceCompressor;
import org.exoplatform.portal.resource.compressor.ResourceType;
+import org.exoplatform.web.application.javascript.Javascript.ExtendedJScript;
+import org.exoplatform.web.application.javascript.Javascript.PortalJScript;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
+import org.gatein.wci.WebAppListener;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.picocontainer.Startable;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
+import java.io.Reader;
+import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import javax.servlet.ServletContext;
-public class JavascriptConfigService implements Startable
+public class JavascriptConfigService extends AbstractResourceService implements Startable
{
-
/** Our logger. */
private final Logger log = LoggerFactory.getLogger(JavascriptConfigService.class);
- private Collection<String> availableScripts_;
+ private List<Javascript> commonJScripts;
+
+ private HashMap<String, List<PortalJScript>> portalJScripts;
- private Collection<String> availableScriptsPaths_;
-
- private List<Javascript> availableScriptsKey_;
-
- private String mergedJavascript = "";
-
- private HashMap<String, String> extendedJavascripts;
-
- private byte[] jsBytes = null;
-
private long lastModified = Long.MAX_VALUE;
/** . */
- private JavascriptDeployer deployer;
+ private WebAppListener deployer;
- private JavascriptRemoval removal;
+ private CachedJavascript mergedCommonJScripts;
- private ResourceCompressor compressor;
+ private final FutureMap<String, CachedJavascript, ResourceResolver> cache;
+
+ public JavascriptConfigService(ExoContainerContext context, ResourceCompressor compressor)
+ {
+ super(compressor);
- /** Used to clear merged Javascript on undeploying an webapp */
- private Map<String, List<String>> object_view_of_merged_JS;
+ Loader<String, CachedJavascript, ResourceResolver> loader = new Loader<String, CachedJavascript, ResourceResolver>()
+ {
+ @Override
+ public CachedJavascript retrieve(ResourceResolver context, String key) throws Exception
+ {
+ Resource resource = context.resolve(key);
+ if (resource == null)
+ {
+ return null;
+ }
+
+ StringBuilder sB = new StringBuilder();
+ try
+ {
+ BufferedReader reader = new BufferedReader(resource.read());
+ String line = reader.readLine();
+ try
+ {
+ while (line != null)
+ {
+ sB.append(line);
+ if ((line = reader.readLine()) != null)
+ {
+ sB.append("\n");
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ finally
+ {
+ Safe.close(reader);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ return new CachedJavascript(sB.toString());
+ }
+ };
+ cache = new FutureMap<String, CachedJavascript, ResourceResolver>(loader);
- public JavascriptConfigService(ExoContainerContext context, ResourceCompressor compressor)
- {
- this.compressor = compressor;
- availableScripts_ = new ArrayList<String>();
- availableScriptsPaths_ = new ArrayList<String>();
- availableScriptsKey_ = new ArrayList<Javascript>();
- extendedJavascripts = new HashMap<String, String>();
- deployer = new JavascriptDeployer(context.getPortalContainerName(), this);
- removal = new JavascriptRemoval(context.getPortalContainerName(), this);
- object_view_of_merged_JS = new HashMap<String, List<String>>();
+ commonJScripts = new ArrayList<Javascript>();
+ deployer = new JavascriptConfigDeployer(context.getPortalContainerName(), this);
+ portalJScripts = new HashMap<String, List<PortalJScript>>();
+
+ addResourceResolver(new ExtendedJScriptResourceResolver());
}
/**
- * Return a collection list This method should return the availables scripts in the service
+ * Return a collection list This method should return the availables scripts in the service
+ *
+ * @deprecated Somehow, it should use {@link #getCommonJScripts()} instead.
* @return
*/
+ @Deprecated
public Collection<String> getAvailableScripts()
{
- return availableScripts_;
+ ArrayList<String> list = new ArrayList<String>();
+ for (Javascript js : commonJScripts)
+ {
+ list.add(js.getModule());
+ }
+ return list;
}
-
+
/**
- * Get a available script paths
- * @return a collection list. This method should return the available script paths
+ * Return a collection of all common JScripts
+ *
+ * @return
*/
- public Collection<String> getAvailableScriptsPaths()
+ public Collection<Javascript> getCommonJScripts()
{
- return availableScriptsPaths_;
+ return commonJScripts;
}
/**
- * Add extended JavaScript into available JavaScript
- * @param module
- * module name
- * @param scriptPath
- * URI path of JavaScript
- * @param scontext
- * the webapp's {@link javax.servlet.ServletContext}
- * @param scriptData
- * Content of JavaScript that will be added into available JavaScript
+ * Return a collection of all available JS paths
+ *
+ * @deprecated Somehow, it should use {@link #getCommonJScripts()} instead.
+ *
+ * @return A collection of all available JS paths
*/
- public synchronized void addExtendedJavascript(String module, String scriptPath, ServletContext scontext, String scriptData)
+ @Deprecated
+ public Collection<String> getAvailableScriptsPaths()
{
- String servletContextName = scontext.getServletContextName();
- String path = "/" + servletContextName + scriptPath;
- availableScripts_.add(module);
- availableScriptsPaths_.add(path);
- extendedJavascripts.put(path, scriptData);
+ ArrayList<String> list = new ArrayList<String>();
+ for (Javascript js : commonJScripts)
+ {
+ list.add(js.getPath());
+ }
+
+ return list;
}
-
+
/**
- * Clear available JavaScript and add new JavaScripts
- * @param jsKeys
- * new list of JavaScript will replace current available JavaScript
+ * Add a JScript to {@link #commonJScripts} list and re-sort the list.
+ * Then invalidate cache of all merged common JScripts to
+ * ensure they will be newly merged next time.
+ *
+ * @param js
*/
- public synchronized void addJavascripts(List<Javascript> jsKeys)
+ public void addCommonJScript(Javascript js)
{
- availableScriptsKey_.addAll(jsKeys);
-
-
- Collections.sort(availableScriptsKey_, new Comparator<Javascript>()
+ commonJScripts.add(js);
+
+ Collections.sort(commonJScripts, new Comparator<Javascript>()
{
public int compare(Javascript o1, Javascript o2)
{
- if (o1.getPriority() == o2.getPriority())
- return o1.getKey().getModule().compareTo(o2.getKey().getModule());
- else if (o1.getPriority() < 0)
- return 1;
- else if (o2.getPriority() < 0)
- return -1;
- else
- return o1.getPriority() - o2.getPriority();
+ return o1.getPriority() - o2.getPriority();
}
});
+
+ invalidateMergedCommonJScripts();
+ }
- mergedJavascript = "";
- availableScripts_.clear();
- availableScriptsPaths_.clear();
- object_view_of_merged_JS.clear();
-
- //
- for (Javascript script : availableScriptsKey_) {
- addJavascript(script);
+ /**
+ * Remove a JScript for this module from {@link #commonJScripts}
+ * and invalidates its cache correspondingly
+ *
+ * @param module
+ */
+ public void removeCommonJScript(String module)
+ {
+ Iterator<Javascript> iterator = commonJScripts.iterator();
+ while (iterator.hasNext())
+ {
+ Javascript js = iterator.next();
+ if (js.getModule().equals(module))
+ {
+ iterator.remove();
+ invalidateCachedJScript(js.getPath());
+ invalidateMergedCommonJScripts();
+ }
}
}
/**
- * Add an JavaScript into available JavaScripts
- * @param javascript
- * JavaScript will be added into available JavaScript
+ * Return a collection of all PortalJScripts which belong to the specified portalName.
+ *
+ * @param portalName
+ * @return list of JavaScript path which will be loaded by particular portal
*/
- private void addJavascript(Javascript javascript)
+ public Collection<PortalJScript> getPortalJScripts(String portalName)
{
- availableScripts_.add(javascript.getKey().getModule());
- availableScriptsPaths_.add(javascript.getPath());
-
- List<String> mergedJS_list = object_view_of_merged_JS.get(javascript.getKey().getContextPath());
- if (mergedJS_list == null)
+ return portalJScripts.get(portalName);
+ }
+
+ /**
+ * Add a PortalJScript which will be loaded with a specific portal.
+ * <p>
+ * For now, we don't persist it inside the Portal site storage but just in memory.
+ * Therefore we could somehow remove all PortalJScript for a Portal by using {@link #removePortalJScripts(String)}
+ * when the portal is being removed.
+ *
+ * @param js
+ */
+ public void addPortalJScript(PortalJScript js)
+ {
+ List<PortalJScript> list = portalJScripts.get(js.getPortalName());
+ if (list == null)
{
- mergedJS_list = new ArrayList<String>();
- object_view_of_merged_JS.put(javascript.getKey().getContextPath(), mergedJS_list);
+ list = new ArrayList<PortalJScript>();
}
+
+ list.add(js);
- //Merge internal javascripts
- if(!javascript.getKey().isExternalScript()) {
- StringBuffer sB = new StringBuffer();
- String line = "";
- try
+ Collections.sort(list, new Comparator<Javascript>()
+ {
+ public int compare(Javascript o1, Javascript o2)
{
- BufferedReader reader = javascript.getReader();
- try
- {
- while ((line = reader.readLine()) != null)
- {
- line = line + "\n";
- sB.append(line);
- mergedJS_list.add(line);
- }
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- finally
- {
- Safe.close(reader);
- }
+ return o1.getPriority() - o2.getPriority();
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
- sB.append("\n");
- mergedJS_list.add("\n");
-
- mergedJavascript = mergedJavascript.concat(sB.toString());
- }
+ });
+
+ portalJScripts.put(js.getPortalName(), list);
}
/**
- * Remove JavaScripts from availabe JavaScipts by ServletContext
- * @param scontext
- * the webapp's {@link javax.servlet.ServletContext}
- *
+ * Remove portal name from a JavaScript module or remove JavaScript module if it contains only one portal name
+ *
+ * @param portalName portal's name which you want to remove
*/
- public synchronized void remove(ServletContext context)
+ public void removePortalJScripts(String portalName)
{
- // We clone to avoid concurrent modification exception
- for (Javascript script : new ArrayList<Javascript>(availableScriptsKey_))
+ List<PortalJScript> list = portalJScripts.remove(portalName);
+ for (PortalJScript js : list)
{
- if (script.getContext().getContextPath().equals(context.getContextPath())) {
- removeJavascript(script);
- }
+ invalidateCachedJScript(js.getPath());
}
}
/**
- * Remove JavaScript from available JavaScripts
- * @param script
- * JavaScript will be removed
+ * unregister a {@link ServletContext} into {@link MainResourceResolver} of {@link SkinService}
+ *
+ * @param servletContext ServletContext will unregistered
*/
- public synchronized void removeJavascript(Javascript script)
+ public void unregisterServletContext(ServletContext servletContext)
{
- availableScripts_.remove(script.getKey().getModule());
- availableScriptsPaths_.remove(script.getPath());
- object_view_of_merged_JS.remove(script.getKey().getContextPath());
-
- // Enlist entries to be removed
- for (Iterator<Javascript> i = availableScriptsKey_.iterator();i.hasNext();)
+ super.unregisterServletContext(servletContext);
+ remove(servletContext);
+ }
+
+ /**
+ * Remove JavaScripts from availabe JavaScipts by ServletContext
+ * @param scontext
+ * the webapp's {@link javax.servlet.ServletContext}
+ *
+ */
+ public synchronized void remove(ServletContext context)
+ {
+ Iterator<Javascript> iterator = commonJScripts.iterator();
+ while (iterator.hasNext())
{
- Javascript _script = i.next();
- if (script.getKey().equals(_script.getKey()))
+ Javascript js = iterator.next();
+ if (js.getContextPath().equals(context.getContextPath()))
{
- i.remove();
+ iterator.remove();
+ invalidateCachedJScript(js.getPath());
+ invalidateMergedCommonJScripts();
}
}
}
/**
- * Refresh the mergedJavascript
+ * @deprecated Use {@link #invalidateMergedCommonJScripts()} instead
*/
+ @Deprecated
public void refreshMergedJavascript()
{
- mergedJavascript = "";
- StringBuffer buffer = new StringBuffer();
- for (String webApp : object_view_of_merged_JS.keySet())
- {
- for (String jsPath : object_view_of_merged_JS.get(webApp))
- {
- buffer.append(jsPath);
- }
- }
- mergedJavascript = buffer.toString();
+ invalidateMergedCommonJScripts();
}
/**
@@ -275,59 +319,98 @@
* @param out the output stream
* @throws IOException any io exception
*/
+ @Deprecated
public void writeMergedJavascript(OutputStream out) throws IOException
{
- jsBytes = getMergedJavascript();
+ byte[] jsBytes = getMergedJavascript();
//
out.write(jsBytes);
}
-
+
+ public String getJScript(String path)
+ {
+ CachedJavascript cachedJScript = getCachedJScript(path);
+ if (cachedJScript != null)
+ {
+ return cachedJScript.getText();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
/**
- * Return merged javascript in byte array
- * @return byte[]
+ * Return a CachedJavascript which is lazy loaded from a {@link FutureMap} cache
+ *
+ * @param path
+ * @return
*/
- public byte[] getMergedJavascript()
+ public CachedJavascript getCachedJScript(String path)
{
- if (jsBytes == null)
+ return cache.get(mainResolver, path);
+ }
+
+ /**
+ * Returns a string which is merging of all common JScripts
+ *
+ * @return
+ */
+ public CachedJavascript getMergedCommonJScripts()
+ {
+ if (mergedCommonJScripts == null)
{
- // Generate javascript in a buffer
- StringBuffer allJavascript = new StringBuffer();
- allJavascript.append(mergedJavascript);
- for (String script : extendedJavascripts.values())
+ StringBuilder sB = new StringBuilder();
+ for (Javascript js : commonJScripts)
{
- allJavascript.append(script);
+ if (!js.isExternalScript())
+ {
+ String jScript = getJScript(js.getPath());
+ if (jScript != null)
+ {
+ sB.append(jScript).append("\n");
+ }
+
+ }
}
- String s = allJavascript.toString();
- // Get bytes
- byte[] bytes;
- try
- {
- bytes = s.getBytes("UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new AssertionError("No access to UTF-8, e");
- }
+ String jScript = sB.toString();
- // Minify
try
{
- String output = compressor.compress(s, ResourceType.JAVASCRIPT);
- jsBytes = output.getBytes();
+ jScript = compressor.compress(jScript, ResourceType.JAVASCRIPT);
}
catch (Exception e)
{
- log.warn("Error when generating minified javascript, will use normal javascript instead", e);
- jsBytes = bytes;
}
-// Remove miliseconds because string of date retrieve from Http header doesn't have miliseconds
- lastModified = (new Date().getTime() / 1000) * 1000;
+
+ mergedCommonJScripts = new CachedJavascript(jScript);
+ lastModified = mergedCommonJScripts.getLastModified();
}
- return jsBytes;
+
+ return mergedCommonJScripts;
}
+ /**
+ * @deprecated Use {@link #getMergedCommonJScripts()} instead.
+ * It is more clearly to see what exactly are included in the returned merging
+ *
+ * @return byte[]
+ */
+ @Deprecated
+ public byte[] getMergedJavascript()
+ {
+ String mergedCommonJS = getMergedCommonJScripts().getText();
+
+ return mergedCommonJS.getBytes();
+ }
+
+ /**
+ * @deprecated the last modification should belong to CachedJavascript object
+ * @return
+ */
+ @Deprecated
public long getLastModified()
{
return lastModified;
@@ -340,12 +423,49 @@
*/
public boolean isModuleLoaded(CharSequence module)
{
- return getAvailableScripts().contains(module);
+ for (Javascript js : commonJScripts)
+ {
+ if (js.getModule().equals(module))
+ {
+ return true;
+ }
+ }
+
+ return false;
}
/**
- * Remove JavaScript from available JavaScripts and extended JavaScripts
+ * Add an extended JavaScript to the list of common JScripts which are loaded by default
+ *
+ * @deprecated This method support was not good in design so it will be unsupported soon.
+ * Absolutely this usage can be replaced by using combination of {@link #addCommonJScript(Javascript)} and {@link ResourceResolver}
+ *
* @param module
+ * module name
+ * @param scriptPath
+ * URI path of JavaScript
+ * @param scontext
+ * the webapp's {@link javax.servlet.ServletContext}
+ * @param scriptData
+ * Content of JavaScript that will be added into available JavaScript
+ */
+ @Deprecated
+ public synchronized void addExtendedJavascript(String module, String scriptPath, ServletContext scontext, String scriptData)
+ {
+ ExtendedJScript js = new ExtendedJScript(module, scriptPath, scontext.getContextPath(), scriptData);
+ commonJScripts.add(js);
+ if (log.isDebugEnabled())
+ {
+ log.debug("Added an extended javascript " + js);
+ }
+ }
+
+ /**
+ * Remove an extended Javascript from the list of common JScripts
+ *
+ * @deprecated This method is deprecated according to {@link #addExtendedJavascript(String, String, ServletContext, String)}.
+ * Use {@link #removeCommonJScript(String)} instead.
+ * @param module
* module will be removed
* @param scriptPath
* URI of script that will be removed
@@ -353,19 +473,31 @@
* the webapp's {@link javax.servlet.ServletContext}
*
*/
+ @Deprecated
public void removeExtendedJavascript(String module, String scriptPath, ServletContext scontext)
{
- String servletContextName = scontext.getServletContextName();
- availableScripts_.remove(module);
- String path = "/" + servletContextName + scriptPath;
- availableScriptsPaths_.remove(path);
- extendedJavascripts.remove(path);
- jsBytes = null;
+ removeCommonJScript(module);
}
-
-
/**
+ * Invalidate cache of merged common JScripts
+ */
+ public void invalidateMergedCommonJScripts()
+ {
+ mergedCommonJScripts = null;
+ }
+
+ /**
+ * Invalidate cache for this <tt>path</tt>
+ *
+ * @param path
+ */
+ public void invalidateCachedJScript(String path)
+ {
+ cache.remove(path);
+ }
+
+ /**
* Start service.
* Registry org.exoplatform.web.application.javascript.JavascriptDeployer,
* org.exoplatform.web.application.javascript.JavascriptRemoval into ServletContainer
@@ -374,7 +506,6 @@
public void start()
{
DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(deployer);
- DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(removal);
}
/**
@@ -386,7 +517,29 @@
public void stop()
{
DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(deployer);
- DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(removal);
}
-
+
+ private class ExtendedJScriptResourceResolver implements ResourceResolver
+ {
+ @Override
+ public Resource resolve(String path) throws NullPointerException
+ {
+ for (final Javascript js : commonJScripts)
+ {
+ if (js instanceof ExtendedJScript && js.getPath().equals(path))
+ {
+ final String jScript = ((ExtendedJScript)js).getScript();
+ return new Resource(path)
+ {
+ @Override
+ public Reader read() throws IOException
+ {
+ return new StringReader(jScript);
+ }
+ };
+ }
+ }
+ return null;
+ }
+ }
}
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptDeployer.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -1,146 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.web.application.javascript;
-
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.gatein.wci.WebAppEvent;
-import org.gatein.wci.WebAppLifeCycleEvent;
-import org.gatein.wci.WebAppListener;
-import org.gatein.wci.impl.DefaultServletContainerFactory;
-import org.picocontainer.Startable;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.servlet.ServletContext;
-
-/**
- * Created by The eXo Platform SAS
- * Jan 19, 2007
- */
-
-public class JavascriptDeployer implements WebAppListener, Startable
-{
-
- private static final String GATEIN_CONFIG_RESOURCE = "/WEB-INF/gatein-resources.xml";
-
- /**
- * Logger
- */
- private static final Log LOG = ExoLogger.getLogger(JavascriptDeployer.class);
-
- /** . */
- private final JavascriptConfigService javascriptService;
-
- /**
- * The name of the portal container
- */
- private final String portalContainerName;
-
- public JavascriptDeployer(String portalContainerName, JavascriptConfigService javascriptService)
- {
- this.javascriptService = javascriptService;
- this.portalContainerName = portalContainerName;
- }
-
- public void start()
- {
- DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(this);
- }
-
- public void stop()
- {
- DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(this);
- }
-
- public void onEvent(WebAppEvent event)
- {
- if (event instanceof WebAppLifeCycleEvent)
- {
- WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
- if (waEvent.getType() == WebAppLifeCycleEvent.ADDED)
- {
- ServletContext scontext = null;
- try
- {
- scontext = event.getWebApp().getServletContext();
-
- InputStream is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- if (is == null)
- return;
- try
- {
- is.close();
- }
- catch (Exception ex)
- {
- // ignore me
- }
- final PortalContainerPostInitTask task = new PortalContainerPostInitTask()
- {
-
- public void execute(ServletContext scontext, PortalContainer portalContainer)
- {
- register(scontext, portalContainer);
- }
- };
- PortalContainer.addInitTask(scontext, task, portalContainerName);
- }
- catch (Exception ex)
- {
- LOG.error("An error occurs while registering 'Javascript in gatein-resources.xml' from the context '"
- + (scontext == null ? "unknown" : scontext.getServletContextName()) + "'", ex);
- }
- }
- }
- }
-
- private void register(ServletContext scontext, PortalContainer container)
- {
- InputStream is = null;
- try
- {
- is = scontext.getResourceAsStream(GATEIN_CONFIG_RESOURCE);
- JavascriptConfigParser.processConfigResource(is, javascriptService, scontext);
- }
- catch (Exception ex)
- {
- LOG.error("An error occurs while processing 'Javascript in gatein-resources.xml' from the context '"
- + scontext.getServletContextName() + "'", ex);
- }
- finally
- {
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- // ignore me
- }
- }
- }
- }
-}
\ No newline at end of file
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptKey.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptKey.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptKey.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.web.application.javascript;
-
-/**
- * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
- * @version $Id$
- *
- */
-public class JavascriptKey
-{
-
- /** . */
- private final String module;
-
- /** . */
- private final String scriptPath;
-
- /** . */
- private final String contextPath;
-
- public JavascriptKey(String module, String scriptPath, String contextPath) throws IllegalArgumentException
- {
- if (module == null || scriptPath == null || contextPath == null)
- {
- throw new IllegalArgumentException("Module and scriptPath are mandatory for JavascriptKey");
- }
- this.module = module;
- this.scriptPath = scriptPath;
- this.contextPath = contextPath;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof JavascriptKey)
- {
- JavascriptKey that = (JavascriptKey)obj;
- return module.equals(that.module) && scriptPath.equals(that.scriptPath) && contextPath.equals(that.contextPath);
- }
- return false;
- }
-
- public String getModule()
- {
- return module;
- }
-
- public String getScriptPath()
- {
- return scriptPath;
- }
-
- public String getContextPath()
- {
- return contextPath;
- }
-
- public boolean isExternalScript()
- {
- return (scriptPath.startsWith("http") || scriptPath.startsWith("https")) ? true : false;
- }
-}
Deleted: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptRemoval.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.web.application.javascript;
-
-import org.gatein.wci.WebAppEvent;
-import org.gatein.wci.WebAppLifeCycleEvent;
-import org.gatein.wci.WebAppListener;
-import org.gatein.wci.impl.DefaultServletContainerFactory;
-import org.picocontainer.Startable;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
- * @version $Id$
- *
- */
-public class JavascriptRemoval implements WebAppListener, Startable
-{
-
- private String portalContainerName;
-
- private JavascriptConfigService javascriptService;
-
- public JavascriptRemoval(String _portalContainerName, JavascriptConfigService _javascriptService)
- {
- this.portalContainerName = _portalContainerName;
- this.javascriptService = _javascriptService;
- }
-
- /**
- * @see org.gatein.wci.WebAppListener#onEvent(org.gatein.wci.WebAppEvent)
- */
- public void onEvent(WebAppEvent arg0)
- {
- if (arg0 instanceof WebAppLifeCycleEvent)
- {
- WebAppLifeCycleEvent wevent = (WebAppLifeCycleEvent)arg0;
- if (wevent.getType() == WebAppLifeCycleEvent.REMOVED)
- {
- removeJavascript(wevent.getWebApp().getServletContext());
- refreshJavascript();
- }
- }
- }
-
- /**
- * Removes javascript deployed in this web app.
- *
- * @param scontext the servlet context
- */
- private void removeJavascript(ServletContext scontext)
- {
- String webApp = scontext.getContextPath();
- javascriptService.remove(scontext);
- }
-
- private void refreshJavascript()
- {
- javascriptService.refreshMergedJavascript();
- }
-
- public void start()
- {
- DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(this);
- }
-
- public void stop()
- {
- DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(this);
- }
-
-}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptTask.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptTask.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptTask.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.web.application.javascript;
+import org.exoplatform.web.application.javascript.Javascript.PortalJScript;
+
import java.util.ArrayList;
import java.util.List;
@@ -40,7 +42,17 @@
public void execute(JavascriptConfigService service, ServletContext scontext)
{
- service.addJavascripts(scripts);
+ for (Javascript js : scripts)
+ {
+ if (js instanceof PortalJScript)
+ {
+ service.addPortalJScript((PortalJScript)js);
+ }
+ else
+ {
+ service.addCommonJScript(js);
+ }
+ }
}
public void addScript(Javascript script)
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/AbstractSkinServiceTest.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/AbstractSkinServiceTest.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/AbstractSkinServiceTest.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -79,7 +79,7 @@
assertEquals(1, skinService.getAvailableSkinNames().size());
assertTrue(skinService.getAvailableSkinNames().contains("TestSkin"));
- String css = skinService.getCSS("/path/to/MockResourceResolver.css");
+ String css = skinService.getCSS("/path/to/MockResourceResolver");
assertEquals(MockResourceResolver.class.getName(), css);
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/MockResourceResolver.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/MockResourceResolver.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/MockResourceResolver.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -40,7 +40,7 @@
public MockResourceResolver()
{
- addResource("/path/to/MockResourceResolver.css", this.getClass().getName());
+ addResource("/path/to/MockResourceResolver", this.getClass().getName());
}
public void addResource(String path, String value)
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestJavascriptConfigService.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestJavascriptConfigService.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestJavascriptConfigService.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -20,12 +20,14 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.test.mocks.servlet.MockServletContext;
+import org.exoplatform.web.application.javascript.Javascript.PortalJScript;
import org.exoplatform.web.application.javascript.JavascriptConfigParser;
import org.exoplatform.web.application.javascript.JavascriptConfigService;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URL;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -35,44 +37,64 @@
/**
* @author <a href="mailto:phuong.vu@exoplatform.com">Vu Viet Phuong</a>
* @version $Id$
- *
*/
public class TestJavascriptConfigService extends AbstractWebResourceTest
{
private JavascriptConfigService jsService;
- private ServletContext mockServletContext;
+ private static MockResourceResolver resResolver;
+
+ private static ServletContext mockServletContext;
- private static final String exModule = "extended.js.test";
+ private static boolean isFirstStartup = true;
- private static final String exPath = "/extended/js/test.js";
-
- private static final ServletContext exContext = new MockJSServletContext("extendedWebApp", null);
-
@Override
protected void setUp() throws Exception
{
final PortalContainer portalContainer = getContainer();
jsService = (JavascriptConfigService)portalContainer.getComponentInstanceOfType(JavascriptConfigService.class);
-
- Map<String, String> resources = new HashMap<String, String>(4);
- resources.put("/js/test1.js", "aaa;");
- resources.put("/js/test2.js", "bbb;");
- resources.put("/js/test3.js", "ccc;");
- resources.put("/js/test4.js", "ddd;");
- mockServletContext = new MockJSServletContext("mockwebapp", resources);
- URL url = portalContainer.getPortalClassLoader().getResource("mockwebapp/gatein-resources.xml");
- JavascriptConfigParser.processConfigResource(url.openStream(), jsService, mockServletContext);
+ if (isFirstStartup)
+ {
+ Map<String, String> resources = new HashMap<String, String>(4);
+ resources.put("/js/test1.js", "aaa; // inline comment");
+ resources.put("/js/test2.js", "bbb;");
+ resources.put("/js/test3.js", "ccc;");
+ resources.put("/js/test4.js", "ddd;");
+ mockServletContext = new MockJSServletContext("mockwebapp", resources);
+ jsService.registerContext(mockServletContext);
+
+ resResolver = new MockResourceResolver();
+ jsService.addResourceResolver(resResolver);
+ URL url = portalContainer.getPortalClassLoader().getResource("mockwebapp/gatein-resources.xml");
+ JavascriptConfigParser.processConfigResource(url.openStream(), jsService, mockServletContext);
+
+ isFirstStartup = false;
+ }
}
- public void testAvailableScripts()
+ public void testResourceResolver()
{
- assertEquals(4, jsService.getAvailableScripts().size());
+ String jScript = jsService.getJScript("/path/to/MockResourceResolver");
+ assertEquals(MockResourceResolver.class.getName(), jScript);
+
+ jScript = jsService.getJScript("/path/to/non-existing.js");
+ assertNull(jScript);
+
+ resResolver.addResource("/path/to/non-existing.js", "foo");
+ jScript = jsService.getJScript("/path/to/non-existing.js");
+ assertNotNull("foo", jScript);
+ }
+
+ public void testCommonJScripts()
+ {
+ assertEquals(5, jsService.getCommonJScripts().size());
assertTrue(jsService.isModuleLoaded("js.test1"));
assertTrue(jsService.isModuleLoaded("js.test2"));
assertTrue(jsService.isModuleLoaded("js.test3"));
assertTrue(jsService.isModuleLoaded("js.test4"));
+ assertTrue(jsService.isModuleLoaded("js.test7"));
+
assertFalse(jsService.isModuleLoaded("js.test5"));
}
@@ -83,11 +105,16 @@
assertEquals(mockServletContext.getContextPath() + "/js/test4.js", availPaths.next());
assertEquals(mockServletContext.getContextPath() + "/js/test1.js", availPaths.next());
assertEquals(mockServletContext.getContextPath() + "/js/test3.js", availPaths.next());
+ assertEquals("http://example.com/test7.js", availPaths.next());
assertFalse(availPaths.hasNext());
}
- public void testExtendedJS() throws Exception
+ public void testAddingExtendedJScript() throws Exception
{
+ ServletContext exContext = new MockJSServletContext("extendedWebApp", null);
+ String exModule = "extended.js.test";
+ String exPath = "/extended/js/test.js";
+
jsService.addExtendedJavascript(exModule, exPath, exContext, "extendedJS;");
assertTrue(jsService.isModuleLoaded(exModule));
assertTrue(jsService.getAvailableScriptsPaths().contains(exContext.getContextPath() + exPath));
@@ -107,33 +134,57 @@
assertTrue(first < second);
assertTrue(second < System.currentTimeMillis());
}
-
- public void testMergedJS()
- {
+
+ public void testMergingCommonJScripts()
+ {
String mergedJS = new String(jsService.getMergedJavascript());
- assertEquals("\nbbb;ddd;aaa;ccc;", mergedJS);
+ assertEquals("\nbbb;ddd;aaa;ccc;", mergedJS);
+ assertEquals("\nbbb;ddd;aaa;ccc;", jsService.getMergedCommonJScripts().getText());
assertTrue(jsService.getLastModified() < System.currentTimeMillis());
- }
-
- public void testRemoveJS()
+ }
+
+ public void testCaching()
{
- assertEquals(4, jsService.getAvailableScripts().size());
- assertEquals(4, jsService.getAvailableScriptsPaths().size());
- jsService.remove(mockServletContext);
- assertEquals(0, jsService.getAvailableScripts().size());
- assertEquals(0, jsService.getAvailableScriptsPaths().size());
+ String path = "/path/to/caching";
+ resResolver.addResource(path, "foo");
+ String jScript = jsService.getJScript(path);
+ assertEquals("foo", jScript);
- assertTrue(jsService.getMergedJavascript().length > 0);
- jsService.refreshMergedJavascript();
- //bug of service
-// assertTrue(jsService.getMergedJavascript().length == 0);
+ resResolver.addResource(path, "bar");
+ jScript = jsService.getJScript(path);
+ assertEquals("foo", jScript);
+
+ // invalidate cache
+ jsService.invalidateCachedJScript(path);
+ jScript = jsService.getJScript(path);
+ assertEquals("bar", jScript);
}
- @Override
- protected void tearDown() throws Exception
+ public void testPortalJScript()
{
- jsService.remove(mockServletContext);
- jsService.removeExtendedJavascript(exModule, exPath, exContext);
+ Collection<PortalJScript> site = jsService.getPortalJScripts("site1");
+ assertEquals(1, site.size());
+ Iterator<PortalJScript> iterator = site.iterator();
+ assertEquals(mockServletContext.getContextPath() + "/js/test5.js", iterator.next().getPath());
+
+ site = jsService.getPortalJScripts("site2");
+ assertEquals(2, site.size());
+ iterator = site.iterator();
+ assertEquals(mockServletContext.getContextPath() + "/js/test6.js", iterator.next().getPath());
+ assertEquals(mockServletContext.getContextPath() + "/js/test5.js", iterator.next().getPath());
+
+ assertNull(jsService.getPortalJScripts("classic"));
+
+ jsService.removePortalJScripts("site1");
+ assertNull(jsService.getPortalJScripts("site1"));
+
+ PortalJScript portalJScript = new PortalJScript("portal_module1", "/path/to/portal/jscript1", "/portal", Integer.MAX_VALUE, "portal1");
+ jsService.addPortalJScript(portalJScript);
+ String jScript = jsService.getJScript(portalJScript.getPath());
+ assertNull(jScript);
+ resResolver.addResource(portalJScript.getPath(), "bar1");
+ jScript = jsService.getJScript(portalJScript.getPath());
+ assertEquals("bar1", jScript);
}
private static class MockJSServletContext extends MockServletContext
@@ -155,7 +206,15 @@
@Override
public InputStream getResourceAsStream(String s)
{
- return new ByteArrayInputStream(resources.get(s).getBytes());
+ String input = resources.get(s);
+ if (input != null)
+ {
+ return new ByteArrayInputStream(input.getBytes());
+ }
+ else
+ {
+ return null;
+ }
}
}
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -59,6 +59,6 @@
{
assertHash("c68ea6831c3d24a242f63abd2db261a6", "gatein_resources_1_0.xsd");
assertHash("c55b7e0dc8ae23e2d34430b38260cd96", "gatein_resources_1_1.xsd");
- assertHash("6d5566a86feb32f30fb9c7551c026042", "gatein_resources_1_2.xsd");
+ assertHash("56f2ed48327fed8ea506be982ef53730", "gatein_resources_1_2.xsd");
}
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/resources/mockwebapp/gatein-resources.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/resources/mockwebapp/gatein-resources.xml 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/resources/mockwebapp/gatein-resources.xml 2011-11-12 23:15:56 UTC (rev 8051)
@@ -19,10 +19,8 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<gatein-resources
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_2 http://www.gatein.org/xml/ns/gatein_resources_1_2"
- xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_2">
+<gatein-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_2 http://www.gatein.org/xml/ns/gatein_resources_1_2"
+ xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_2">
<portal-skin>
<skin-name>TestSkin</skin-name>
@@ -110,4 +108,30 @@
<js-priority>2</js-priority>
</param>
</javascript>
+ <javascript>
+ <param>
+ <portal-name>site1</portal-name>
+ <js-module>js.test5</js-module>
+ <js-path>/js/test5.js</js-path>
+ </param>
+ <param>
+ <portal-name>site2</portal-name>
+ <js-module>js.test5</js-module>
+ <js-path>/js/test5.js</js-path>
+ </param>
+ </javascript>
+ <javascript>
+ <param>
+ <portal-name>site2</portal-name>
+ <js-module>js.test6</js-module>
+ <js-path>/js/test6.js</js-path>
+ <js-priority>1</js-priority>
+ </param>
+ </javascript>
+ <javascript>
+ <param>
+ <js-module>js.test7</js-module>
+ <js-path>http://example.com/test7.js</js-path>
+ </param>
+ </javascript>
</gatein-resources>
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2011-11-12 23:15:56 UTC (rev 8051)
@@ -16,6 +16,7 @@
String skin = uicomponent.getSkin();
def portalSkins = uicomponent.getPortalSkins() ;
def portletSkins = uicomponent.getPortletSkins() ;
+ def portalJScripts = uicomponent.getPortalJScripts();
def scriptsPaths = uicomponent.getJavascriptURLs();
def lang = uicomponent.getLocale().getLanguage();
def title = rcontext.getTitle();
@@ -96,8 +97,15 @@
</script>
<script type="text/javascript" src="/eXoResources/javascript/eXo/i18n/I18NMessage.js"></script>
<script type="text/javascript" src="/eXoResources/javascript/eXo/i18n/MessageResource_<%=lang%>.js"></script>
-
- <%
+ <%
+ if (portalJScripts != null)
+ {
+ for (jScript in portalJScripts) {
+ %>
+ <script type="text/javascript" src="<%=jScript.getPath()%>"></script>
+ <%
+ }
+ }
def headerElements = rcontext.getExtraMarkupHeadersAsStrings();
if (headerElements != null)
{
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -22,10 +22,12 @@
import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.application.ResourceRequestFilter;
+import org.exoplatform.web.application.javascript.CachedJavascript;
import org.exoplatform.web.application.javascript.JavascriptConfigService;
import java.io.IOException;
import java.io.OutputStream;
+import java.net.URLDecoder;
import java.util.Date;
import javax.servlet.ServletConfig;
@@ -62,7 +64,15 @@
final JavascriptConfigService service =
(JavascriptConfigService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
JavascriptConfigService.class);
- long lastModified = service.getLastModified();
+ final String uri = URLDecoder.decode(request.getRequestURI(), "UTF-8");
+
+ CachedJavascript jScript = service.getCachedJScript(uri);
+ if (jScript == null)
+ {
+ jScript = service.getMergedCommonJScripts();
+ }
+
+ long lastModified = jScript.getLastModified();
long ifModifiedSince = request.getDateHeader(ResourceRequestFilter.IF_MODIFIED_SINCE);
// Julien: should we also set charset along with the content type ?
@@ -74,8 +84,8 @@
}
}
- byte[] jsBytes = service.getMergedJavascript();
+ String js = jScript.getText();
response.setDateHeader(ResourceRequestFilter.LAST_MODIFIED, lastModified);
- response.getOutputStream().write(jsBytes);
+ response.getWriter().write(js);
}
}
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2011-11-12 17:58:35 UTC (rev 8050)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2011-11-12 23:15:56 UTC (rev 8051)
@@ -30,8 +30,6 @@
import org.exoplatform.portal.resource.SkinConfig;
import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.resource.SkinURL;
-import org.exoplatform.web.url.MimeType;
-import org.exoplatform.web.url.navigation.NodeURL;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.page.UIPageActionListener.ChangeNodeActionListener;
import org.exoplatform.portal.webui.page.UISiteBody;
@@ -46,7 +44,10 @@
import org.exoplatform.services.resources.LocaleConfigService;
import org.exoplatform.services.resources.LocaleContextInfo;
import org.exoplatform.services.resources.Orientation;
+import org.exoplatform.web.application.javascript.Javascript.PortalJScript;
import org.exoplatform.web.application.javascript.JavascriptConfigService;
+import org.exoplatform.web.url.MimeType;
+import org.exoplatform.web.url.navigation.NodeURL;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -320,6 +321,16 @@
return service.getAvailableScriptsPaths();
}
+ /**
+ * Get all JavaScript path which available on selected portal site
+ * @return
+ */
+ public Collection<PortalJScript> getPortalJScripts()
+ {
+ JavascriptConfigService service = getApplicationComponent(JavascriptConfigService.class);
+ return service.getPortalJScripts(Util.getUIPortal().getName());
+ }
+
public Collection<Skin> getPortalSkins()
{
SkinService skinService = getApplicationComponent(SkinService.class);
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906,8045
14 years, 5 months
gatein SVN: r8050 - epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-12 12:58:35 -0500 (Sat, 12 Nov 2011)
New Revision: 8050
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/web.xml
Log:
JBEPP-1336
Potential authentication bypass issue in gatein.ear
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/web.xml 2011-11-12 15:50:20 UTC (rev 8049)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/web.xml 2011-11-12 17:58:35 UTC (rev 8050)
@@ -304,8 +304,6 @@
<url-pattern>/private/*</url-pattern>
<url-pattern>/g/*</url-pattern>
<url-pattern>/u/*</url-pattern>
- <http-method>POST</http-method>
- <http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>users</role-name>
@@ -318,8 +316,6 @@
<web-resource-collection>
<web-resource-name>admin authentication</web-resource-name>
<url-pattern>/admin/*</url-pattern>
- <http-method>POST</http-method>
- <http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
14 years, 5 months