gatein SVN: r5380 - in exo/portal/branches/3.1.x/component/web/src: test/java/org/exoplatform/web/filter and 1 other directory.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-30 04:05:47 -0500 (Tue, 30 Nov 2010)
New Revision: 5380
Modified:
exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/GenericFilter.java
exo/portal/branches/3.1.x/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
Log:
EXOGTN-195 Improve performance for each of request to Extensible filter
Modified: exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
===================================================================
--- exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java 2010-11-30 08:49:27 UTC (rev 5379)
+++ exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java 2010-11-30 09:05:47 UTC (rev 5380)
@@ -40,7 +40,7 @@
* nicolas.filotto(a)exoplatform.com
* 25 sept. 2009
*/
-public class ExtensibleFilter implements Filter
+public class ExtensibleFilter
{
/**
@@ -77,10 +77,10 @@
/**
* @see org.exoplatform.web.filter.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, String path) throws IOException,
ServletException
{
- ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters);
+ ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters, path);
efChain.doFilter(request, response);
}
@@ -90,19 +90,18 @@
private final FilterChain parentChain;
private final Iterator<FilterDefinition> filters;
+
+ private final String path;
- private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters)
+ private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters, String path_)
{
this.parentChain = parentChain;
this.filters = filters.iterator();
+ this.path = path_;
}
public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException
{
- HttpServletRequest req = (HttpServletRequest) request;
- String regex = "[/]*" + req.getContextPath() + "[/]*";
- String path = req.getRequestURI().replaceFirst(regex, "/");
-
while (filters.hasNext())
{
FilterDefinition filterDef = filters.next();
Modified: exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/GenericFilter.java
===================================================================
--- exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/GenericFilter.java 2010-11-30 08:49:27 UTC (rev 5379)
+++ exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/filter/GenericFilter.java 2010-11-30 09:05:47 UTC (rev 5380)
@@ -23,11 +23,15 @@
import org.exoplatform.container.web.AbstractFilter;
import java.io.IOException;
+import java.util.regex.Pattern;
import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
/**
* This filter allows the rest of the platform to add their own filters without changing the web.xml
@@ -40,13 +44,20 @@
*/
public class GenericFilter extends AbstractFilter
{
-
+ private Pattern contextPathPattern;
/**
* @see javax.servlet.Filter#destroy()
*/
public void destroy()
{
}
+
+ @Override
+ protected void afterInit(FilterConfig config) throws ServletException
+ {
+ ServletContext servletContext = this.getServletContext();
+ contextPathPattern = Pattern.compile("[/]*" + servletContext.getContextPath() + "[/]*");
+ }
/**
* This filter calls <code>doFilter</code> of the {@link ExtensibleFilter} of
@@ -63,7 +74,8 @@
}
else
{
- filter.doFilter(request, response, chain);
+ String path = contextPathPattern.matcher(((HttpServletRequest)request).getRequestURI()).replaceFirst("/");
+ filter.doFilter(request, response, chain, path);
}
}
}
Modified: exo/portal/branches/3.1.x/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
===================================================================
--- exo/portal/branches/3.1.x/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-11-30 08:49:27 UTC (rev 5379)
+++ exo/portal/branches/3.1.x/component/web/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-11-30 09:05:47 UTC (rev 5380)
@@ -52,13 +52,14 @@
public void testDoFilter() throws IOException, ServletException
{
+ String pathRequest = "/testPath";
ExtensibleFilter exFilter = new ExtensibleFilter();
MockFilterOKTF mockFilterOKTF = new MockFilterOKTF();
MockFilterOKWTF mockFilterOKWTF = new MockFilterOKWTF();
MockFilterChain chain = new MockFilterChain();
exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
getFilterDefinition(mockFilterOKWTF)));
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
assertTrue(mockFilterOKTF.start);
assertTrue(mockFilterOKTF.end);
assertTrue(mockFilterOKWTF.start);
@@ -70,7 +71,7 @@
chain = new MockFilterChain();
exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKO())));
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
assertTrue(mockFilterOKTF.start);
assertTrue(mockFilterOKTF.end);
assertTrue(mockFilterOKWTF.start);
@@ -84,7 +85,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("IOException is expected");
}
catch (IOException e)
@@ -103,7 +104,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOSE())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("ServletException is expected");
}
catch (ServletException e)
@@ -122,7 +123,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKORE())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("RuntimeException is expected");
}
catch (RuntimeException e)
@@ -141,7 +142,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOER())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("Error is expected");
}
catch (Error e)
@@ -162,7 +163,7 @@
getFilterDefinition(mockFilterOKTF2)));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("IOException is expected");
}
catch (IOException e)
14 years
gatein SVN: r5379 - in portal/branches/navcontroller: webui/portal/src/main/java/org/exoplatform/portal/url and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-30 03:49:27 -0500 (Tue, 30 Nov 2010)
New Revision: 5379
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java
Removed:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
Log:
rename MediaType to MimeType
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java 2010-11-30 08:49:05 UTC (rev 5378)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ControllerURL.java 2010-11-30 08:49:27 UTC (rev 5379)
@@ -48,7 +48,7 @@
protected ParameterMap queryParams;
/** . */
- protected MediaType mimeType;
+ protected MimeType mimeType;
/**
* Create a resource URL instance.
@@ -150,11 +150,11 @@
/**
* Returns the current mime type that this URL will be generated for, or null if none is set (which means
- * there is no guarantees about the mime type that will be used as target but it's likely to be {@link MediaType#XHTML}}).
+ * there is no guarantees about the mime type that will be used as target but it's likely to be {@link MimeType#XHTML}}).
*
* @return the current mime type
*/
- public MediaType getMimeType()
+ public MimeType getMimeType()
{
return mimeType;
}
@@ -165,7 +165,7 @@
*
* @param mimeType the new mime type
*/
- public void setMimeType(MediaType mimeType)
+ public void setMimeType(MimeType mimeType)
{
this.mimeType = mimeType;
}
Deleted: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java 2010-11-30 08:49:05 UTC (rev 5378)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java 2010-11-30 08:49:27 UTC (rev 5379)
@@ -1,33 +0,0 @@
-/*
- * 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.url;
-
-/**
- * A simple media type enumeration that is used when a URL is generated.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public enum MediaType
-{
-
- XHTML, PLAIN
-
-}
Copied: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java (from rev 5248, portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MediaType.java)
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/MimeType.java 2010-11-30 08:49:27 UTC (rev 5379)
@@ -0,0 +1,33 @@
+/*
+ * 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.url;
+
+/**
+ * A simple mime type enumeration that is used when a URL is generated.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public enum MimeType
+{
+
+ XHTML, PLAIN
+
+}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java 2010-11-30 08:49:05 UTC (rev 5378)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java 2010-11-30 08:49:27 UTC (rev 5379)
@@ -22,7 +22,7 @@
import org.exoplatform.commons.utils.CharEncoder;
import org.exoplatform.commons.utils.CharsetCharEncoder;
import org.exoplatform.web.controller.router.RenderContext;
-import org.exoplatform.web.url.MediaType;
+import org.exoplatform.web.url.MimeType;
import java.util.ArrayList;
import java.util.Collections;
@@ -38,12 +38,12 @@
{
/** . */
- private static final Map<MediaType, String> AMP_MAP = new EnumMap<MediaType, String>(MediaType.class);
+ private static final Map<MimeType, String> AMP_MAP = new EnumMap<MimeType, String>(MimeType.class);
static
{
- AMP_MAP.put(MediaType.XHTML, "&");
- AMP_MAP.put(MediaType.PLAIN, "&");
+ AMP_MAP.put(MimeType.XHTML, "&");
+ AMP_MAP.put(MimeType.PLAIN, "&");
}
/** . */
@@ -62,7 +62,7 @@
private List<String[]> queryParams;
/** . */
- private MediaType mimeType;
+ private MimeType mimeType;
PortalURLRenderContext(StringBuilder buffer)
@@ -71,12 +71,12 @@
this.queryParams = EMPTY;
}
- public MediaType getMimeType()
+ public MimeType getMimeType()
{
return mimeType;
}
- public void setMimeType(MediaType mimeType)
+ public void setMimeType(MimeType mimeType)
{
this.mimeType = mimeType;
}
@@ -128,10 +128,10 @@
*/
void flush()
{
- MediaType mt = mimeType;
+ MimeType mt = mimeType;
if (mt == null)
{
- mt = MediaType.XHTML;
+ mt = MimeType.XHTML;
}
String amp = AMP_MAP.get(mt);
14 years
gatein SVN: r5378 - components/pc/branches.
by do-not-reply@jboss.org
Author: alain_defrance
Date: 2010-11-30 03:49:05 -0500 (Tue, 30 Nov 2010)
New Revision: 5378
Added:
components/pc/branches/adf/
Log:
Creating pc branche for wci integration
Copied: components/pc/branches/adf (from rev 5377, components/pc/tags/2.2.0-GA)
14 years
gatein SVN: r5377 - in portal/branches/navcontroller/component/web/controller/src: main/java/org/exoplatform/web/controller/router and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-30 03:46:11 -0500 (Tue, 30 Nov 2010)
New Revision: 5377
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/regexp/RegExpRenderer.java
Removed:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RegExpAnalyser.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternBuilder.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRegExpAnalyser.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRouteEscaper.java
Log:
improve
Copied: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/regexp/RegExpRenderer.java (from rev 5351, portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RegExpAnalyser.java)
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/regexp/RegExpRenderer.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/regexp/RegExpRenderer.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -0,0 +1,176 @@
+/*
+ * 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.controller.regexp;
+
+import java.io.IOException;
+
+/**
+ * Renders a {@link RENode} to its pattern representation.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RegExpRenderer
+{
+
+ public <A extends Appendable> A render(RENode re, A appendable) throws IOException, NullPointerException
+ {
+ if (re == null)
+ {
+ throw new NullPointerException("No null disjunction accepted");
+ }
+ if (appendable == null)
+ {
+ throw new NullPointerException("No null appendable accepted");
+ }
+
+ //
+ if (re instanceof RENode.Disjunction)
+ {
+ render((RENode.Disjunction)re, appendable);
+ }
+ else if (re instanceof RENode.Alternative)
+ {
+ render((RENode.Alternative)re, appendable);
+ }
+ else if (re instanceof RENode.Expr)
+ {
+ render((RENode.Expr)re, appendable);
+ }
+ else if (re instanceof RENode.CharacterClassExpr)
+ {
+ render((RENode.CharacterClassExpr)re, appendable);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
+ //
+ return appendable;
+ }
+
+ private void render(RENode.Disjunction disjunction, Appendable appendable) throws IOException, NullPointerException
+ {
+ render(disjunction.getAlternative(), appendable);
+ RENode.Disjunction next = disjunction.getNext();
+ if (next != null)
+ {
+ appendable.append('|');
+ render(next, appendable);
+ }
+ }
+
+ private void render(RENode.Alternative alternative, Appendable appendable) throws IOException, NullPointerException
+ {
+ render(alternative.getExp(), appendable);
+ RENode.Alternative next = alternative.getNext();
+ if (next != null)
+ {
+ render(next, appendable);
+ }
+ }
+
+ private void render(RENode.Expr expression, Appendable appendable) throws IOException, NullPointerException
+ {
+ Quantifier quantifier = null;
+ if (expression instanceof RENode.Any)
+ {
+ appendable.append('.');
+ quantifier = expression.getQuantifier();
+ }
+ else if (expression instanceof RENode.Group)
+ {
+ RENode.Group group = (RENode.Group)expression;
+ appendable.append("(?:");
+ this.render(group.getDisjunction(), appendable);
+ appendable.append(")");
+ quantifier = expression.getQuantifier();
+ }
+ else if (expression instanceof RENode.Char)
+ {
+ RENode.Char character = (RENode.Char)expression;
+ appendable.append(character.getValue());
+ quantifier = expression.getQuantifier();
+ }
+ else if (expression instanceof RENode.CharacterClass)
+ {
+ RENode.CharacterClass characterClass = (RENode.CharacterClass)expression;
+ render(characterClass.getExpr(), appendable);
+ quantifier = expression.getQuantifier();
+ }
+
+ //
+ if (quantifier != null)
+ {
+ appendable.append(quantifier.toString());
+ }
+ }
+
+ private void render(RENode.CharacterClassExpr expr, Appendable appendable) throws IOException, NullPointerException
+ {
+ appendable.append("[");
+ render(expr, true, appendable);
+ appendable.append("]");
+ }
+
+ private void render(RENode.CharacterClassExpr expr, boolean braced, Appendable appendable) throws IOException, NullPointerException
+ {
+ if (expr instanceof RENode.CharacterClassExpr.Char)
+ {
+ RENode.CharacterClassExpr.Char simple = (RENode.CharacterClassExpr.Char)expr;
+ appendable.append(simple.getValue());
+ }
+ else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Range)
+ {
+ RENode.CharacterClass.CharacterClassExpr.Range range = (RENode.CharacterClass.CharacterClassExpr.Range)expr;
+ appendable.append(range.getFrom());
+ appendable.append('-');
+ appendable.append(range.getTo());
+ }
+ else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.And)
+ {
+ RENode.CharacterClass.CharacterClassExpr.And and = (RENode.CharacterClass.CharacterClassExpr.And)expr;
+ render(and.getLeft(), false, appendable);
+ appendable.append("&&");
+ render(and.getRight(), false, appendable);
+ }
+ else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Or)
+ {
+ RENode.CharacterClass.CharacterClassExpr.Or or = (RENode.CharacterClass.CharacterClassExpr.Or)expr;
+ render(or.getLeft(), false, appendable);
+ render(or.getRight(), false, appendable);
+ }
+ else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Not)
+ {
+ RENode.CharacterClass.CharacterClassExpr.Not not = (RENode.CharacterClass.CharacterClassExpr.Not)expr;
+ if (!braced)
+ {
+ appendable.append("[");
+ }
+ appendable.append("^");
+ render(not.getNegated(), false, appendable);
+ if (!braced)
+ {
+ appendable.append(']');
+ }
+ }
+ }
+}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternBuilder.java 2010-11-30 08:34:43 UTC (rev 5376)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternBuilder.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -33,7 +33,7 @@
/** . */
private final StringBuilder buffer = new StringBuilder();
- public PatternBuilder expr(String s)
+ public PatternBuilder expr(CharSequence s)
{
if (s == null)
{
Deleted: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RegExpAnalyser.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RegExpAnalyser.java 2010-11-30 08:34:43 UTC (rev 5376)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RegExpAnalyser.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -1,185 +0,0 @@
-/*
- * 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.controller.router;
-
-import org.exoplatform.web.controller.regexp.Quantifier;
-import org.exoplatform.web.controller.regexp.RENode;
-import org.exoplatform.web.controller.regexp.RegExpParser;
-import org.exoplatform.web.controller.regexp.SyntaxException;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class RegExpAnalyser
-{
-
- /** . */
- private StringBuilder pattern;
-
- /** . */
- private boolean needReset;
-
- public RegExpAnalyser()
- {
- this.pattern = new StringBuilder();
- this.needReset = false;
- }
-
- public String getPattern()
- {
- return pattern.toString();
- }
-
- public RegExpAnalyser reset()
- {
- pattern.setLength(0);
- needReset = false;
- return this;
- }
-
- public void process(CharSequence pattern) throws MalformedRegExpException
- {
- try
- {
- RegExpParser parser = new RegExpParser(pattern);
- RENode.Disjunction disjunction = parser.parseDisjunction();
- process(disjunction);
- }
- catch (SyntaxException e)
- {
- throw new MalformedRegExpException(e);
- }
- }
-
- public void process(RENode.Disjunction disjunction) throws MalformedRegExpException
- {
- if (needReset)
- {
- throw new IllegalStateException();
- }
-
- //
- needReset = true;
- visit(disjunction);
- }
-
- private void visit(RENode.Disjunction disjunction) throws MalformedRegExpException
- {
- visit(disjunction.getAlternative());
- RENode.Disjunction next = disjunction.getNext();
- if (next != null)
- {
- pattern.append('|');
- visit(next);
- }
- }
-
- private void visit(RENode.Alternative alternative) throws MalformedRegExpException
- {
- visit(alternative.getExp());
- RENode.Alternative next = alternative.getNext();
- if (next != null)
- {
- visit(next);
- }
- }
-
- private void visit(RENode.Expr expression) throws MalformedRegExpException
- {
- Quantifier quantifier = null;
- if (expression instanceof RENode.Any)
- {
- pattern.append('.');
- quantifier = expression.getQuantifier();
- }
- else if (expression instanceof RENode.Group)
- {
- RENode.Group group = (RENode.Group)expression;
- pattern.append("(?:");
- visit(group.getDisjunction());
- pattern.append(")");
- quantifier = expression.getQuantifier();
- }
- else if (expression instanceof RENode.Char)
- {
- RENode.Char character = (RENode.Char)expression;
- pattern.append(character.getValue());
- quantifier = expression.getQuantifier();
- }
- else if (expression instanceof RENode.CharacterClass)
- {
- RENode.CharacterClass characterClass = (RENode.CharacterClass)expression;
- pattern.append("[");
- visit(characterClass.getExpr(), true);
- pattern.append("]");
- quantifier = expression.getQuantifier();
- }
-
- //
- if (quantifier != null)
- {
- pattern.append(quantifier);
- }
- }
-
- private void visit(RENode.CharacterClassExpr expr, boolean braced)
- {
- if (expr instanceof RENode.CharacterClassExpr.Char)
- {
- RENode.CharacterClassExpr.Char simple = (RENode.CharacterClassExpr.Char)expr;
- pattern.append(simple.getValue());
- }
- else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Range)
- {
- RENode.CharacterClass.CharacterClassExpr.Range range = (RENode.CharacterClass.CharacterClassExpr.Range)expr;
- pattern.append(range.getFrom());
- pattern.append('-');
- pattern.append(range.getTo());
- }
- else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.And)
- {
- RENode.CharacterClass.CharacterClassExpr.And and = (RENode.CharacterClass.CharacterClassExpr.And)expr;
- visit(and.getLeft(), false);
- pattern.append("&&");
- visit(and.getRight(), false);
- }
- else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Or)
- {
- RENode.CharacterClass.CharacterClassExpr.Or or = (RENode.CharacterClass.CharacterClassExpr.Or)expr;
- visit(or.getLeft(), false);
- visit(or.getRight(), false);
- }
- else if (expr instanceof RENode.CharacterClass.CharacterClassExpr.Not)
- {
- RENode.CharacterClass.CharacterClassExpr.Not not = (RENode.CharacterClass.CharacterClassExpr.Not)expr;
- if (!braced)
- {
- pattern.append("[");
- }
- pattern.append("^");
- visit(not.getNegated(), false);
- if (!braced)
- {
- pattern.append(']');
- }
- }
- }
-}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-30 08:34:43 UTC (rev 5376)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -24,10 +24,12 @@
import org.exoplatform.web.controller.metadata.RequestParamDescriptor;
import org.exoplatform.web.controller.metadata.RouteDescriptor;
import org.exoplatform.web.controller.metadata.RouteParamDescriptor;
+import org.exoplatform.web.controller.regexp.RegExpRenderer;
import org.exoplatform.web.controller.regexp.RENode;
import org.exoplatform.web.controller.regexp.RegExpParser;
import org.exoplatform.web.controller.regexp.SyntaxException;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -653,8 +655,8 @@
}
// Now work on the regex
- String renderingRegex;
- String routingRegex;
+ StringBuilder renderingRegex = new StringBuilder();
+ StringBuilder routingRegex = new StringBuilder();
try
{
RegExpParser parser = new RegExpParser(regex);
@@ -666,17 +668,17 @@
RouteEscaper escaper = new RouteEscaper('/', '_');
escaper.visit(routingDisjunction);
}
- RegExpAnalyser routingAnalyser = new RegExpAnalyser();
- routingAnalyser.process(routingDisjunction);
- routingRegex = routingAnalyser.getPattern();
+ new RegExpRenderer().render(routingDisjunction, routingRegex);
//
parser.reset();
RENode.Disjunction renderingDisjunction = parser.parseDisjunction();
- RegExpAnalyser renderingAnalyser = new RegExpAnalyser();
- renderingAnalyser.process(renderingDisjunction);
- renderingRegex = renderingAnalyser.getPattern();
+ new RegExpRenderer().render(renderingDisjunction, renderingRegex);
}
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
catch (SyntaxException e)
{
throw new RuntimeException(e);
@@ -686,10 +688,10 @@
throw new RuntimeException(e);
}
- //
+ // Append routing regex to the route regex
builder.expr("(").expr(routingRegex).expr(")");
- //
+ // Add the path param with the rendering regex
parameterPatterns.add(new PathParam(
parameterQName,
encodingMode,
@@ -700,10 +702,7 @@
//
builder.litteral(path, previous, pos);
chunks.add(path.substring(previous, pos));
- // Julien : should the pattern end with a $ ?????? I don't see that for now
- // we need to figure out clearly
- Pattern pattern = builder.build();
- PatternRoute route = new PatternRoute(pattern, parameterPatterns, chunks);
+ PatternRoute route = new PatternRoute(builder.build(), parameterPatterns, chunks);
// Wire
add(route);
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRegExpAnalyser.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRegExpAnalyser.java 2010-11-30 08:34:43 UTC (rev 5376)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRegExpAnalyser.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -20,6 +20,9 @@
package org.exoplatform.web.controller.router;
import org.exoplatform.component.test.BaseGateInTest;
+import org.exoplatform.web.controller.regexp.RegExpRenderer;
+import org.exoplatform.web.controller.regexp.RENode;
+import org.exoplatform.web.controller.regexp.RegExpParser;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -29,35 +32,21 @@
{
/** . */
- private RegExpAnalyser analyser = new RegExpAnalyser();
+ private RegExpRenderer analyser = new RegExpRenderer();
private void assertAnalyse(String expectedPattern, String pattern)
{
try
{
- analyser.reset();
- analyser.process(pattern);
- assertEquals(expectedPattern, analyser.getPattern());
+ RENode.Disjunction disjunction = new RegExpParser(pattern).parseDisjunction();
+ assertEquals(expectedPattern, analyser.render(disjunction, new StringBuilder()).toString());
}
- catch (MalformedRegExpException e)
+ catch (Exception e)
{
fail(e);
}
}
- private void assertAnalyseFails(String pattern)
- {
- analyser.reset();
- try
- {
- analyser.process(pattern);
- fail();
- }
- catch (MalformedRegExpException e)
- {
- }
- }
-
public void testCharacterClass()
{
assertAnalyse("[a]", "[a]");
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRouteEscaper.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRouteEscaper.java 2010-11-30 08:34:43 UTC (rev 5376)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRouteEscaper.java 2010-11-30 08:46:11 UTC (rev 5377)
@@ -20,6 +20,7 @@
package org.exoplatform.web.controller.router;
import org.exoplatform.component.test.BaseGateInTest;
+import org.exoplatform.web.controller.regexp.RegExpRenderer;
import org.exoplatform.web.controller.regexp.RENode;
import org.exoplatform.web.controller.regexp.RegExpParser;
@@ -39,9 +40,7 @@
RouteEscaper escaper = new RouteEscaper('/', '_');
RENode.Disjunction re = parser.parseDisjunction();
escaper.visit(re);
- RegExpAnalyser analyser = new RegExpAnalyser();
- analyser.process(re);
- Pattern p = Pattern.compile(analyser.getPattern());
+ Pattern p = Pattern.compile(new RegExpRenderer().render(re, new StringBuilder()).toString());
Matcher matcher = p.matcher(test);
assertTrue(matcher.find());
assertEquals(expectedValue, matcher.group());
14 years
gatein SVN: r5376 - in portal/branches/branch-GTNPORTAL-1700/component/web/api/src: test/java/org/exoplatform/web/filter and 1 other directory.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-30 03:34:43 -0500 (Tue, 30 Nov 2010)
New Revision: 5376
Modified:
portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java
portal/branches/branch-GTNPORTAL-1700/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
Log:
GTNPORTAL-1701 Improve performance for each of request to extensible filer
Modified: portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java 2010-11-30 08:04:31 UTC (rev 5375)
+++ portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java 2010-11-30 08:34:43 UTC (rev 5376)
@@ -29,7 +29,6 @@
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
/**
* This class allows the rest of the platform to define new filters thanks to the external
@@ -40,7 +39,7 @@
* nicolas.filotto(a)exoplatform.com
* 25 sept. 2009
*/
-public class ExtensibleFilter implements Filter
+public class ExtensibleFilter
{
/**
@@ -74,35 +73,31 @@
}
}
- /**
- * @see Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
- */
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
- ServletException
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, String path)
+ throws IOException, ServletException
{
- ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters);
+ ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters, path);
efChain.doFilter(request, response);
}
-
+
private static class ExtensibleFilterChain implements FilterChain
{
private final FilterChain parentChain;
private final Iterator<FilterDefinition> filters;
+
+ private final String path;
- private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters)
+ private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters, String path_)
{
this.parentChain = parentChain;
this.filters = filters.iterator();
+ this.path = path_;
}
public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException
{
- HttpServletRequest req = (HttpServletRequest) request;
- String regex = "[/]*" + req.getContextPath() + "[/]*";
- String path = req.getRequestURI().replaceFirst(regex, "/");
-
while (filters.hasNext())
{
FilterDefinition filterDef = filters.next();
Modified: portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java 2010-11-30 08:04:31 UTC (rev 5375)
+++ portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java 2010-11-30 08:34:43 UTC (rev 5376)
@@ -23,11 +23,15 @@
import org.exoplatform.container.web.AbstractFilter;
import java.io.IOException;
+import java.util.regex.Pattern;
import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
/**
* This filter allows the rest of the platform to add their own filters without changing the web.xml
@@ -41,12 +45,20 @@
public class GenericFilter extends AbstractFilter
{
+ private Pattern contextPathPattern;
/**
* @see javax.servlet.Filter#destroy()
*/
public void destroy()
{
}
+
+ @Override
+ protected void afterInit(FilterConfig config) throws ServletException
+ {
+ ServletContext servletContext = this.getServletContext();
+ contextPathPattern = Pattern.compile("[/]*" + servletContext.getContextPath() + "[/]*");
+ }
/**
* This filter calls <code>doFilter</code> of the {@link ExtensibleFilter} of
@@ -63,7 +75,8 @@
}
else
{
- filter.doFilter(request, response, chain);
+ String path = contextPathPattern.matcher(((HttpServletRequest)request).getRequestURI()).replaceFirst("/");
+ filter.doFilter(request, response, chain, path);
}
}
}
Modified: portal/branches/branch-GTNPORTAL-1700/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-11-30 08:04:31 UTC (rev 5375)
+++ portal/branches/branch-GTNPORTAL-1700/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java 2010-11-30 08:34:43 UTC (rev 5376)
@@ -52,13 +52,14 @@
public void testDoFilter() throws IOException, ServletException
{
+ String pathRequest = "/testPath";
ExtensibleFilter exFilter = new ExtensibleFilter();
MockFilterOKTF mockFilterOKTF = new MockFilterOKTF();
MockFilterOKWTF mockFilterOKWTF = new MockFilterOKWTF();
MockFilterChain chain = new MockFilterChain();
exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
getFilterDefinition(mockFilterOKWTF)));
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
assertTrue(mockFilterOKTF.start);
assertTrue(mockFilterOKTF.end);
assertTrue(mockFilterOKWTF.start);
@@ -70,7 +71,7 @@
chain = new MockFilterChain();
exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKO())));
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
assertTrue(mockFilterOKTF.start);
assertTrue(mockFilterOKTF.end);
assertTrue(mockFilterOKWTF.start);
@@ -84,7 +85,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("IOException is expected");
}
catch (IOException e)
@@ -103,7 +104,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOSE())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("ServletException is expected");
}
catch (ServletException e)
@@ -122,7 +123,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKORE())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("RuntimeException is expected");
}
catch (RuntimeException e)
@@ -141,7 +142,7 @@
getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOER())));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("Error is expected");
}
catch (Error e)
@@ -162,7 +163,7 @@
getFilterDefinition(mockFilterOKTF2)));
try
{
- exFilter.doFilter(new MockServletRequest(), null, chain);
+ exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
fail("IOException is expected");
}
catch (IOException e)
14 years
gatein SVN: r5375 - exo/portal/branches/3.1.x/docs/reference-guide.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-11-30 03:04:31 -0500 (Tue, 30 Nov 2010)
New Revision: 5375
Added:
exo/portal/branches/3.1.x/docs/reference-guide/html-zip.xml
Modified:
exo/portal/branches/3.1.x/docs/reference-guide/pom.xml
Log:
EXOGTN-183: Publish the reference guide in docbook format
Added: exo/portal/branches/3.1.x/docs/reference-guide/html-zip.xml
===================================================================
--- exo/portal/branches/3.1.x/docs/reference-guide/html-zip.xml (rev 0)
+++ exo/portal/branches/3.1.x/docs/reference-guide/html-zip.xml 2010-11-30 08:04:31 UTC (rev 5375)
@@ -0,0 +1,21 @@
+<assembly>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>en/</directory>
+ <outputDirectory>org.gatein.doc</outputDirectory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.png</include>
+ <include>**/*.ent</include>
+ </includes>
+ <!--excludes>
+ <exclude>**/*.fo</exclude>
+ <exclude>**/*.pdf</exclude>
+ </excludes-->
+ </fileSet>
+ </fileSets>
+</assembly>
Modified: exo/portal/branches/3.1.x/docs/reference-guide/pom.xml
===================================================================
--- exo/portal/branches/3.1.x/docs/reference-guide/pom.xml 2010-11-30 07:18:16 UTC (rev 5374)
+++ exo/portal/branches/3.1.x/docs/reference-guide/pom.xml 2010-11-30 08:04:31 UTC (rev 5375)
@@ -34,4 +34,50 @@
<packaging>jdocbook</packaging>
<name>GateIn Reference Guide en</name>
+ <build>
+ <plugins>
+ <!-- Zip the reference guide -->
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>doc-zip-packaging</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>html-zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Attach the doc to the pom in maven repo -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/${project.artifactId}-${project.version}.zip</file>
+ <type>zip</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
</project>
14 years
gatein SVN: r5374 - epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-30 02:18:16 -0500 (Tue, 30 Nov 2010)
New Revision: 5374
Modified:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/ClusteringConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/DatabaseConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/EMailServiceConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Launching.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Post_Installation.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml
Log:
Homogenized file paths with other EPP docs
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/ClusteringConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/ClusteringConfiguration.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/ClusteringConfiguration.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -44,7 +44,7 @@
<section id="sect-Reference_Guide-Clustering_Properties">
<title>configuration.properties</title>
- <para>Edit the following entries in the <filename>$JBOSS_HOME/jboss-as/server/$CONFIG/conf/gatein/configuration.properties</filename> file:</para>
+ <para>Edit the following entries in the <filename><replaceable>JBOSS_HOME</replaceable>/jboss-as/server/<replaceable><PROFILE></replaceable>/conf/gatein/configuration.properties</filename> file:</para>
<itemizedlist>
<listitem>
<para>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/DatabaseConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/DatabaseConfiguration.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/DatabaseConfiguration.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -39,7 +39,7 @@
<para>To configure the database datasource used by JCR you will need to edit the
datasource descriptor located at
- <filename>$JBOSS_HOME/server/$CONFIG/deploy/gatein-ds.xml</filename>:
+ <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>:
<programlisting>
<no-tx-datasource>
<jndi-name>gatein-jcr</jndi-name>
@@ -70,7 +70,7 @@
created.</para>
<para>Add the JDBC driver to the classpath, by copying the relevant
- JAR file to the <filename>$JBOSS_HOME/server/$CONFIG/lib</filename> directory.</para>
+ JAR file to the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/lib</filename> directory.</para>
</section>
@@ -79,7 +79,7 @@
<title>Configuring the database datasource for the default identity store</title>
<para>To configure the database datasource used by IDM you will need to edit the
- datasource descriptor located at <filename>$JBOSS_HOME/server/$CONFIG/deploy/gatein-ds.xml</filename>:
+ datasource descriptor located at <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>:
<programlisting>
<no-tx-datasource>
@@ -239,7 +239,7 @@
<orderedlist>
<listitem>
<para>
- Edit the file located at <filename>$JBOSS_HOME/server/$CONFIG/deploy/gatein-ds.xml</filename>.
+ Edit the file located at <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein-ds.xml</filename>.
</para>
</listitem>
<listitem>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/EMailServiceConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/EMailServiceConfiguration.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/EMailServiceConfiguration.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -20,11 +20,11 @@
<title>Configuring the outgoing e-mail account</title>
<para>The e-mail service can use any SMTP account configured in
- <filename>$JBOSS_HOME/server/$CONFIG/conf/gatein/configuration.properties</filename></para>
+ <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/conf/gatein/configuration.properties</filename></para>
<para>The relevant section looks like:</para>
- <programlisting># EMail
+<programlisting># EMail
gatein.email.smtp.username=
gatein.email.smtp.password=
gatein.email.smtp.host=smtp.gmail.com
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -697,7 +697,7 @@
For security reasons, before going in production, you should restrict the access to the login servlet to POST.
</para>
<para>
- To do so, edit the file <filename>$JBOSS_HOME/server/[configuration]/gatein.ear/02portal.war/WEB-INF/web.xml</filename> and add:
+ To do so, edit the file <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/web.xml</filename> and add:
</para>
<programlisting language="XML" role="XML"><![CDATA[
<security-constraint>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -48,7 +48,7 @@
<title><emphasis role="bold"></emphasis></title>
<step>
<para>
- Comment the following lines in <filename>jboss/server/<replaceable>PROFILE</replaceable>/deploy/jbossweb.sar/server.xml</filename>:
+ Comment the following lines in <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/jbossweb.sar/server.xml</filename>:
</para>
<programlisting><![CDATA[<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
connectionTimeout="20000" redirectPort="8443" >
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Installation.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -69,7 +69,7 @@
</listitem>
<listitem>
<para>
- the <literal>production</literal> server configuration includes Portal components and clustering services. It is preconfigured with default settings which would be more accurate for a production environment.
+ the <literal>production</literal> server configuration includes Portal components and clustering services. It is preconfigured with default settings which would be more accurate for a production environment.
</para>
</listitem>
</itemizedlist>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Launching.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Launching.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Launching.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -18,7 +18,7 @@
</step>
<step>
<para>
- Within this directory navigate to <filename>/jboss-as/bin</filename>.
+ Within this directory navigate to <filename><replaceable>JBOSS_HOME</replaceable>/jboss-as/bin</filename>.
</para>
</step>
<step>
@@ -62,7 +62,7 @@
<procedure>
<step>
<para>
- Navigate to the <filename>/jboss-as/bin</filename> directory as discussed in <xref linkend="sect-Install_Guide-Launching_PRODUCT-Launching_a_Zip_installation" />.
+ Navigate to the <filename><replaceable>JBOSS_HOME</replaceable>/jboss-as/bin</filename> directory as discussed in <xref linkend="sect-Install_Guide-Launching_PRODUCT-Launching_a_Zip_installation" />.
</para>
</step>
<step>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Post_Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Post_Installation.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Post_Installation.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -14,7 +14,7 @@
On a Linux Platform
</title>
<para>
- Create an environment variable that points to the installation directory (<filename>JBOSS_DIST/jboss-as</filename>) and call it <literal>JBOSS_HOME</literal>. Add <literal>$JBOSS_HOME/bin</literal> to the system path to be able to run the server from the command line. You can do this by adding the following lines to the <filename>.bashrc</filename> file in your home directory.
+ Create an environment variable that points to the installation directory (<filename><replaceable><JBOSS_DIST></replaceable>/jboss-as</filename>) and call it <literal>JBOSS_HOME</literal>. Add <literal>$JBOSS_HOME/bin</literal> to the system path to be able to run the server from the command line. You can do this by adding the following lines to the <filename>.bashrc</filename> file in your home directory.
</para>
</formalpara>
<programlisting>
@@ -51,7 +51,7 @@
<para><remark>End Note to Reviewer</remark></para>
-->
<para>
- If the server is running out of memory, you may adjust the memory settings before deploying the applications. You can do this by updating <literal>JAVA_OPTS</literal> settings in the file <filename>JBOSS_DIST/jboss-as/bin/run.conf</filename> on Linux or <filename>JBOSS_DIST/jboss-as/bin/run.conf.bat</filename> on Windows. The default values don't take into account the memory requirements of your applications:
+ If the server is running out of memory, you may adjust the memory settings before deploying the applications. You can do this by updating <literal>JAVA_OPTS</literal> settings in the file <filename><replaceable>JBOSS_HOME</replaceable>/jboss-as/bin/run.conf</filename> on Linux or <filename><replaceable>JBOSS_HOME</replaceable>/jboss-as/bin/run.conf.bat</filename> on Windows. The default values don't take into account the memory requirements of your applications:
<programlisting>
-Xms1303m -Xmx1303m -XX:MaxPermSize=256m ....
</programlisting>
@@ -73,33 +73,34 @@
It is recommended that the admin=admin username and password configuration, which is commented out by default, not be used for a production server. The admin user is included as an example of the username/password definition format only.
</para>
</important>
-
+ <note>
+ <title><replaceable>JBOSS_HOME</replaceable> and <replaceable><PROFILE></replaceable></title>
+ <para>
+ <replaceable>JBOSS_HOME</replaceable> is the <filename>jboss-as</filename> directory, a level above the bin directory. <replaceable><PROFILE></replaceable> is the chosen server profile: all, default, minimal production, standard or web.
+ </para>
+ </note>
<formalpara><title>Set up the <literal>jmx-console</literal> users and roles</title>
<para>
- Edit the <filename>jmx-console-users.properties</filename> file located in the <filename>$JBOSS_HOME/server/$CONFIG/conf/props/</filename> directory defining the username and password:
+ Edit the <filename>jmx-console-users.properties</filename> file located in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/conf/props/</filename> directory defining the username and password:
</para>
</formalpara>
<programlisting>user=password</programlisting>
<para>
- Edit the <filename>jmx-console-roles.properties</filename> file located in the <filename>$JBOSS_HOME/server/$CONFIG/conf/props/</filename> directory to define the user's roles:
+ Edit the <filename>jmx-console-roles.properties</filename> file located in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/conf/props/</filename> directory to define the user's roles:
</para>
<programlisting>user=JBossAdmin,HttpInvoker</programlisting>
<formalpara><title>Set up the <literal>admin-console</literal> users and roles</title>
<para>
- Edit the <filename>web-console-users.properties</filename> file located in the <filename>$JBOSS_HOME/server/$CONFIG/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/</filename> directory:
+ Edit the <filename>web-console-users.properties</filename> file located in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/</filename> directory:
</para>
</formalpara>
<programlisting>user=password</programlisting>
<para>
- Edit the <filename>web-console-roles.properties</filename> file located in the <filename>$JBOSS_HOME/server/$CONFIG/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/</filename> directory:
+ Edit the <filename>web-console-roles.properties</filename> file located in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/</filename> directory:
</para>
<programlisting>user=JBossAdmin,HttpInvoker</programlisting>
- <note><title>$JBOSS_HOME and $CONFIG</title>
- <para>
- <varname>$JBOSS_HOME</varname> is the <filename>jboss-as</filename> directory, a level above the bin directory. <varname>$CONFIG</varname> is the chosen server configuration - all, default, minimal production, standard or web.
- </para>
- </note>
+
<important>
<para>
Login credentials for the <literal>admin-console</literal> are the same as those used for the JMX console.
@@ -108,11 +109,13 @@
<formalpara>
<title>Set SuckerPassword for JBoss Messaging:</title>
<para>
- JBoss Messaging makes internal connections between nodes in order to redistribute messages between clustered destinations. These connections are made with the user name of a special reserved user whose password is specified by the <literal>suckerPassword</literal> attribute in the Server Peer configuration file:
- <programlisting>$JBOSS_HOME/server/$CONFIG/deploy/messaging/messaging-jboss-beans.xml</programlisting>
- Where <literal>$JBOSS_HOME</literal> is the install directory and <literal>$CONFIG</literal> is the server configuration being used.
- To avoid a security risk, you MUST specify the value of the <literal>SuckerPassword</literal> attribute, failing which the default value will be used. Any one who knows the default password will be able to gain access to any destinations on the server. The following fragment should be uncommented and modified:
- <programlisting><bean name="SecurityStore"
+ JBoss Messaging makes internal connections between nodes in order to redistribute messages between clustered destinations. These connections are made with the user name of a special reserved user whose password is specified by the <literal>suckerPassword</literal> attribute in the Server Peer configuration file: <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/messaging/messaging-jboss-beans.xml</filename>.
+ </para>
+ </formalpara>
+ <para>
+ To avoid a security risk, you MUST specify the value of the <literal>SuckerPassword</literal> attribute, failing which the default value will be used. Any one who knows the default password will be able to gain access to any destinations on the server. The following fragment should be uncommented and modified:
+ </para>
+<programlisting><bean name="SecurityStore"
class="org.jboss.jms.server.jbosssx.JBossASSecurityMetadataStore">
<! default security configuration >
...
@@ -124,8 +127,7 @@
...
</bean>
</programlisting>
- </para>
- </formalpara>
+
</section>
<section id="Disabling_Authentication">
@@ -134,23 +136,14 @@
<para>
It is possible to disable authentication for specific services by following the instructions in this section.
</para>
- <para>
- All paths specified in the sub-sections below are relative to <literal>$JBOSS_HOME</literal>.
- </para>
+
<formalpara>
<title>Disabling Authentication for JXM Console:</title>
<para>
- To disable authentication for the JMX console, edit the following file and comment out the security-constraint section:
+ To disable authentication for the JMX console, edit the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/jmx-console.war/WEB-INF/web.xml</filename> file and comment out the security-constraint section:
</para>
</formalpara>
-
<programlisting>
-server/$CONFIG/deploy/jmx-console.war/WEB-INF/web.xml
-</programlisting>
- <para>
- The following fragment should be commented out:
- </para>
-<programlisting>
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
@@ -170,12 +163,8 @@
<formalpara>
<title>Disabling Authentication for Web Console:</title>
<para>
- To disable authentication for the Web console, edit the following file to comment out the security-constraint section:
- <programlisting>
-server/$CONFIG/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml
- </programlisting>
- The following fragment should be commented out:
- <programlisting>
+ To disable authentication for the Web console, edit the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml</filename> file to comment out the security-constraint section:
+<programlisting>
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
@@ -196,12 +185,8 @@
<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 file:
- <programlisting>
-server/$CONFIG/deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml
- </programlisting>
- For example, the security-constraint element should look as follows:
- <programlisting>
+ 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:
+<programlisting>
<security-constraint>
<web-resource-collection>
<web-resource-name>HttpInvokers</web-resource-name>
@@ -222,12 +207,13 @@
<formalpara>
<title>Disabling Authentication for JMX Invoker:</title>
<para>
- To disable authentication for the JMX invoker, edit the following file to comment out the security interceptor passthrough:
- <programlisting>
-server/$CONFIG/deploy/jmx-invoker-service.xml
- </programlisting>
- Locate the mbean section with the class <literal>org.jboss.jmx.connector.invoker.InvokerAdaptorService</literal>. In that section comment out the line that relates to authenticated users:
- <programlisting>
+ 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:
+ </para>
+ </formalpara>
+ <para>
+ Locate the mbean section with the class <literal>org.jboss.jmx.connector.invoker.InvokerAdaptorService</literal>. In that section comment out the line that relates to authenticated users:
+ </para>
+<programlisting>
<descriptors>
<interceptors>
<!-- Uncomment to require authenticated users -->
@@ -238,9 +224,8 @@
policyClass="StripModelMBeanInfoPolicy"/>
</interceptors>
</descriptors>
- </programlisting>
- </para>
- </formalpara>
+</programlisting>
+
<formalpara>
<title>Disabling Pre-configured Accounts</title>
<para>
@@ -251,7 +236,7 @@
For security reasons, before going in production, you should restrict the access to the login servlet to POST.
</para>
<para>
- To do so, edit the file <filename>$JBOSS_HOME/server/[configuration]/gatein.ear/02portal.war/WEB-INF/web.xml</filename> and add:
+ To do so, edit the file <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/gatein.ear/02portal.war/WEB-INF/web.xml</filename> and add:
</para>
<programlisting language="XML" role="XML"><![CDATA[
<security-constraint>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml 2010-11-30 06:09:59 UTC (rev 5373)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Test_Your_Installation.xml 2010-11-30 07:18:16 UTC (rev 5374)
@@ -15,7 +15,7 @@
<itemizedlist>
<listitem>
<para>
- move to the <filename>$JBOSS_HOME/bin</filename> directory;
+ move to the <filename><replaceable>JBOSS_HOME</replaceable>/bin</filename> directory;
</para>
</listitem>
<listitem>
@@ -24,7 +24,7 @@
<itemizedlist>
<listitem>
<para>
- Ensure that you run the configuration corresponding to the <filename>$JBOSS_HOME/server/$CONFIG/</filename> chosen in <xref linkend="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database"></xref>
+ Ensure that you run the configuration corresponding to the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/</filename> chosen in <xref linkend="form-Portal_EAP-Using_a_MySQL_Database-Creating_a_MySQL_Database"></xref>
</para>
</listitem>
</itemizedlist>
@@ -33,7 +33,7 @@
</itemizedlist>
</para>
<para>
- The example below uses the production configuration. Your output should look like the following (accounting for installation directory differences) and should not contain any error or exception messages:
+ The example below uses the production configuration. Your output should look like the following (accounting for installation directory differences and version numbers) and should not contain any error or exception messages:
</para>
<programlisting>
[user@localhost bin]$ ./run.sh -c production
@@ -70,7 +70,7 @@
</programlisting>
<note><title>Note: Production server log file</title>
<para>
- There is no "Server Started" message shown at the console when the server is started using the <literal>production</literal> profile. This message may be observed in the <filename>server.log</filename> file located in the <filename>server/production/log</filename> subdirectory.
+ There is no "Server Started" message shown at the console when the server is started using the <literal>production</literal> profile. This message may be observed in the <filename>server.log</filename> file located in the <filename><replaceable>JBOSS_HOME</replaceable>/server/production/log</filename> subdirectory.
</para>
</note>
14 years
gatein SVN: r5373 - epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-30 01:09:59 -0500 (Tue, 30 Nov 2010)
New Revision: 5373
Modified:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml
Log:
JBEPP-671: Removed reference to HTTPS In Tomcat
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml 2010-11-30 06:00:01 UTC (rev 5372)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml 2010-11-30 06:09:59 UTC (rev 5373)
@@ -71,7 +71,8 @@
</procedure>
</section>
- <section id="sect-Installation_Guide-HTTPS_Configuration-Use_In_Tomcat">
+ <!-- Removed as per JBEPP-671
+ <section id="sect-Installation_Guide-HTTPS_Configuration-Use_In_Tomcat">
<title>Setup Tomcat configuration to use your key</title>
<para>
To set the Tomcat configuration to use the new key:
@@ -103,7 +104,8 @@
</para>
</step>
</procedure>
- </section>
+ </section>-->
+
<section>
<title><emphasis role="bold">Restart</emphasis></title>
<para>
14 years
gatein SVN: r5372 - in epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US: extras/PortletDevelopment_Standard and 5 other directories.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-30 01:00:01 -0500 (Tue, 30 Nov 2010)
New Revision: 5372
Modified:
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortalDevelopment_DefaultPortalPermissionConfiguration/default146.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortletDevelopment_Standard/JSPHelloUserPortlet.java
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/search-configuration.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/DefaultPortalPermissionConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/LocalizationConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/gettingstarted.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml
Log:
JBEPP-517: Updates from feedback
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortalDevelopment_DefaultPortalPermissionConfiguration/default146.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortalDevelopment_DefaultPortalPermissionConfiguration/default146.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortalDevelopment_DefaultPortalPermissionConfiguration/default146.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -1,21 +1,20 @@
<external-component-plugins>
- <target-component>org.exoplatform.portal.config.UserACL</target-component>
+ <target-component>org.exoplatform.portal.config.UserACL</target-component>
<component-plugin>
<name>addPortalACLPlugin</name>
<set-method>addPortalACLPlugin</set-method>
<type>org.exoplatform.portal.config.PortalACLPlugin</type>
<description>setting some permission for portal</description>
- <init-params>
+ <init-params>
<values-param>
- <name>access.control.workspace.roles</name>
- <value>*:/platform/administrators</value>
- <value>*:/organization/management/executive-board</value>
+ <name>super.user</name>
+ <value>root</value>
</values-param>
<values-param>
<name>portal.creation.roles</name>
<value>*:/platform/administrators</value>
- <value>*:/organization/management/executive-board</value>
+ <value>*:/organization/management/executive-board</value>
</values-param>
</init-params>
</component-plugin>
- </external-component-plugins>
+</external-component-plugins>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortletDevelopment_Standard/JSPHelloUserPortlet.java
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortletDevelopment_Standard/JSPHelloUserPortlet.java 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/PortletDevelopment_Standard/JSPHelloUserPortlet.java 2010-11-30 06:00:01 UTC (rev 5372)
@@ -1,4 +1,4 @@
-package org.jboss.portal.portlet.portlets;
+package org.jboss.portal.portlet.samples;
import java.io.IOException;
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -159,7 +159,6 @@
<section id="sect-Reference_Guide-Portal_and_Standalone_configuration-Repository_service_configuration">
<title>Example of the portal-system workspace</title>
-<!--DOCS NOTE: The callout configuration below is not rerndering correctly in Publican builds. The callout list icons do not rener from number 15 onwards. -->
<programlistingco>
<areaspec>
<!--1-->
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -520,7 +520,7 @@
</procedure>
<para>
- The above configures two workspaces which will be persisted in two different databases (<literal>ws</literal> in <literal>HSQLDB</literal> and <literal>ws1</literal> in <literal>MySQL</literal>.
+ The above configures two workspaces which will be persisted in two different databases (<literal>ws</literal> in <literal>HSQLDB</literal> and <literal>ws1</literal> in <literal>MySQL</literal>).
</para>
<note>
<para>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/search-configuration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/search-configuration.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/search-configuration.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -28,12 +28,13 @@
The table below has been updated based on QE feedback. Please review for technical accuracy.
</para>
</note>
- <table align="left" id="tabl-Reference_Guide-Search_Configuration-Configuration_parameters" pgwide="1">
+ <table id="tabl-Reference_Guide-Search_Configuration-Configuration_parameters" > <!--align="left" pgwide="1"-->
<title>Configuration parameters</title>
<tgroup cols="4">
- <colspec colwidth="90pt"></colspec>
- <colspec colwidth="135pt"></colspec>
- <colspec colwidth="270pt"></colspec>
+ <colspec colname="1" colwidth="90pt"></colspec>
+ <colspec colname="2" colwidth="90pt"></colspec>
+ <colspec colname="3" colwidth="150pt"></colspec>
+ <colspec colname="4" colwidth="50pt"></colspec>
<thead>
<row>
<entry>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -16,7 +16,7 @@
An example would be hosting the portal from <emphasis role="bold">http://www.sample.com</emphasis> and the gadgets from <emphasis role="bold">http://www.samplemodules.com</emphasis>.
</para>
<para>
- To do this, configure the <emphasis>gadgets.hostName</emphasis>parameter in the <filename>server/<replaceable>PROFILE</replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/conf/portal/application-registry-configuration.xml</filename>file. The value is the <emphasis role="bold">path/to/gadgetServer</emphasis>in <literal>GadgetRegisteryService</literal>:
+ To do this, configure the <emphasis>gadgets.hostName</emphasis>parameter in the <filename>server/<replaceable>PROFILE</replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/conf/portal/application-registry-configuration.xml</filename>file. The value is the <emphasis role="bold">path/to/gadgetServer</emphasis>in <literal>GadgetRegistryService.xml</literal>:
</para>
<programlisting language="XML" role="XML"><xi:include href="../../extras/Gadget_Development_SetupGadgetServer/default139.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
@@ -25,7 +25,7 @@
It is also possible to have multiple rendering servers. This helps to balance the rendering load across multiple servers.
</para>
<para>
- When deploying on the same server ensure the gadget initiates before anything that calls it (for example; the webapp <literal>GateInGadgets</literal>which uses <literal>org.exoplatform.application.gadget.GadgetRegister</literal>).
+ When deploying on the same server ensure the gadget initiates before anything that calls it (for example; the webapp <literal>eXoGadgets</literal>which uses <literal>org.exoplatform.application.gadget.GadgetRegister</literal>).
</para>
</section>
<section id="sect-Reference_Guide-Advanced_Gadget_Administration-Configuration">
@@ -50,7 +50,7 @@
<section id="sect-Reference_Guide-Configuration-Gadget_proxy_and_concat_configuration">
<title>Gadget proxy and concat configuration</title>
<para>
- These servers have to be on the same domain as the gadget server. You can configure the container in <filename>eXoGadgetServer:/WEB-INF/classes/containers/default/container.js</filename>.
+ These servers have to be on the same domain as the gadget server. You can configure the container in <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/eXoGadgetServer.war:/WEB-INF/classes/containers/default/container.js</filename>.
</para>
<programlisting language="Java" role="Java"><xi:include href="../../extras/Gadget_Development_SetupGadgetServer/default141.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/DefaultPortalPermissionConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/DefaultPortalPermissionConfiguration.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/DefaultPortalPermissionConfiguration.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -8,7 +8,7 @@
<section id="sect-Reference_Guide-Portal_Default_Permission_Configuration-Overview">
<title>Overview</title>
<para>
- The default permission configuration for the portal is defined through the <literal>org.exoplatform.portal.config.UserACL</literal> component configuration in the <filename>02portal.war:/WEB-INF/conf/portal/portal-configuration.xml</filename> file.
+ The default permission configuration for the portal is defined through the <literal>org.exoplatform.portal.config.UserACL</literal> component configuration in the <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war:/WEB-INF/conf/portal/portal-configuration.xml</filename> file.
</para>
<para>
It defines eight permissions types:
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/LocalizationConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/LocalizationConfiguration.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/LocalizationConfiguration.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -4,10 +4,9 @@
%BOOK_ENTITIES;
]>
<chapter id="chap-Reference_Guide-Localization_Configuration">
- <title>Localization Configuration - PLEASE REVIEW</title>
+ <title>Localization Configuration</title>
<section id="sect-Reference_Guide-Portal_Development-Pluggable_Locale_Policy">
<title>Pluggable Locale Policy</title>
-
<para>
Every request processed by every portlet is invoked within a context of the current <literal>Locale</literal>.
</para>
@@ -18,23 +17,20 @@
The exact algorithm for determining the current <literal>Locale</literal> is not specified by Portlet Specification. Portlet containers implement this the way they deem most appropriate.
</para>
<para>
- In &PRODUCT; each portal instance has a default language which can be used to present content for new users. Another option is to use each user’s browser language preference, provided it matches one of the available localizations that &PRODUCT; supports, and only fallback to portal default language if no match is found.
+ In &PRODUCT;, each portal instance has a default language which can be used to present content for new users. Another option is to use each user’s browser language preference, provided it matches one of the available localizations that &PRODUCT; supports, and only fallback to the portal's default language if no match is found.
</para>
<para>
- Every user, while visiting a portal, has an option to change the language of the user interface by using a Language chooser.
- The choice can be remembered for the duration of the session, or it can be remembered for a longer period using a browser cookie,
- or - for registered and logged-in users - it can be saved into user’s profile.
+ Every user, while visiting a portal, has an option to change the language of the user interface by using a Language chooser. The choice can be remembered for the duration of the session, or it can be remembered for a longer period using a browser cookie, or, for registered and logged-in users, it can be saved into the user’s profile.
</para>
- <para>So, we can see that there is more than one way to determine the <literal>Locale</literal> to be used for displaying a portal page
- to the user. For this reason the mechanism for determining the current <literal>Locale</literal> of the request
- is pluggable in &PRODUCT;, so the exact algorithm can be customized.
+ <para>
+ As there is more than one way to determine the <literal>Locale</literal> to be used for displaying a portal page, the mechanism for determining the current <literal>Locale</literal> of the request is pluggable in &PRODUCT;, and the exact algorithm can be customized.
</para>
<section>
<title>LocalePolicy API</title>
- <para>Customization is achieved by using LocalePolicy API, which is a simple API consisting of one interface,
- and one class:
+ <para>
+ Customization is achieved by using LocalePolicy API, which is a simple API consisting of one interface, and one class:
</para>
<itemizedlist>
<listitem>
@@ -45,8 +41,8 @@
</listitem>
</itemizedlist>
- <para><literal>LocalePolicy</literal> interface defines a single method that’s invoked on the installed
- <literal>LocalePolicy</literal> service implementation:
+ <para>
+ The <literal>LocalePolicy</literal> interface defines a single method that is invoked on the installed <literal>LocalePolicy</literal> service implementation:
</para>
<programlisting language="Java" role="Java"><![CDATA[public interface LocalePolicy
@@ -54,36 +50,38 @@
public Locale determineLocale(LocaleContextInfo localeContext);
}]]>
</programlisting>
- <para><literal>Locale</literal> returned by determineLocale() method is the <literal>Locale</literal>
- that will be returned to portlets when they call <literal>javax.portlet.PortletRequest.getLocale()</literal> method.
+ <para>
+ The <literal>Locale</literal> returned by determineLocale() method is the <literal>Locale</literal> that will be returned to portlets when they call <literal>javax.portlet.PortletRequest.getLocale()</literal> method.
</para>
- <para>The returned <literal>Locale</literal> has to be one of the locales supported by portal,
- otherwise it will fallback to portal-default <literal>Locale</literal>.
+ <para>
+ The returned <literal>Locale</literal> has to be one of the locales supported by portal, otherwise it will fall back to the portal default <literal>Locale</literal>.
</para>
-
- <para>The supported locales are listed in <filename>gatein.ear/02portal.war/WEB-INF/conf/common/locales-config.xml</filename> file
- as described in <xref linkend="sect-Reference_Guide-Internationalization_Configuration-Locales_Configuration"/> .
+ <para>
+ The supported locales are listed in <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/conf/common/locales-config.xml</filename> file as described in <xref linkend="sect-Reference_Guide-Internationalization_Configuration-Locales_Configuration"/> .
</para>
-
- <para>The <literal>determineLocale()</literal> method takes a parameter of type <literal>LocaleContextInfo</literal>,
- which represents a compilation of preferred locales from different sources - user’s profile, portal default,
- browser language settings, current session, browser cookie … All these different sources of <literal>Locale</literal>
- configuration or preference are used as input to <literal>LocalePolicy</literal> implementation
- that decides which <literal>Locale</literal> should be used.
+ <para>
+ The <literal>determineLocale()</literal> method takes a parameter of type <literal>LocaleContextInfo</literal>, which represents a compilation of preferred locales from different sources; user’s profile, portal default, browser language settings, current session, browser cookie.
</para>
+ <para>
+ All these different sources of <literal>Locale</literal> configuration or preference are used as input to <literal>LocalePolicy</literal> implementation that decides which <literal>Locale</literal> should be used.
+ </para>
+ </section>
- </section>
- <section>
+ <section id="sect-Reference_Guide-Portal_Development-Default_LocalePolicy">
<title>Default <literal>LocalePolicy</literal></title>
- <para>By default, <literal>org.exoplatform.portal.application.localization.DefaultLocalePolicyService</literal> - an implementation
- of <literal>LocalePolicy</literal> - is installed to provide the default behaviour.
+ <para>
+ By default, <literal>org.exoplatform.portal.application.localization.DefaultLocalePolicyService</literal>, an implementation
+ of <literal>LocalePolicy</literal>, is installed to provide the default behaviour.
This, however, can easily be extended and overriden. A completely new implementation can also be written from scratch.
</para>
- <para><literal>DefaultLocalePolicyService</literal> treats logged-in users slightly differently than anonymous users.
- Logged-in users have a profile that can contain language preference, while anonymous users don't.
+ <para>
+ <literal>DefaultLocalePolicyService</literal> treats logged-in users slightly differently than anonymous users.
+ Logged-in users have a profile that can contain language preference, while anonymous users do not.
</para>
- <para>Here is an algorithm used for anonymous users.</para>
- <procedure>
+ <para>
+ Here is an algorithm used for anonymous users.
+ </para>
+ <procedure id="proc-Reference_Guide-Portal_Development-Default_LocalePolicy-anonymous_users">
<title>An algorithm for anonymous users</title>
<step>
<para>
@@ -105,29 +103,33 @@
</itemizedlist>
</step>
<step>
- <para>Get each property's value - if it's a collection, get the first value.
+ <para>
+ Get each property's value. If it's a collection, get the first value.
</para>
</step>
<step>
- <para>If value is one of the supported locales return it as a result.
+ <para>
+ If value is one of the supported locales return it as a result.
</para>
</step>
<step>
- <para>If value is not in the supported locales set, try to remove country information,
- and check if a language matching locale is in the list of supported locales.
- If so, return it as a result.
+ <para>
+ If the value is not in the supported locales set, try to remove country information and check if a language matching locale is in the list of supported locales. If so, return it as a result.
</para>
</step>
<step>
- <para>Otherwise, continue with the next property.
+ <para>
+ Otherwise, continue with the next property.
</para>
</step>
</procedure>
- <para>If no supported locale is found the return locale eventually defaults to <literal>portalLocale</literal>.
+ <para>
+ If no supported locale is found the return locale eventually defaults to <literal>portalLocale</literal>.
</para>
- <para>The algorithm for logged-in users is virtually the same except that the first <literal>Locale</literal>
+ <para>
+ The algorithm for logged-in users is virtually the same except that the first <literal>Locale</literal>
source checked is user's profile.</para>
- <procedure>
+ <procedure id="proc-Reference_Guide-Portal_Development-Default_LocalePolicy-logged-in_users">
<title>An algorithm for logged-in users</title>
<step>
<para>
@@ -152,20 +154,23 @@
</itemizedlist>
</step>
<step>
- <para>The rest is the same as for anonymous users ...</para>
+ <para>
+ Perform the rest of the steps in <xref linkend="proc-Reference_Guide-Portal_Development-Default_LocalePolicy-anonymous_users"/>.
+ </para>
</step>
</procedure>
+ </section>
- </section>
- <section>
+ <section id="sect-Reference_Guide-Portal_Development-Custom_LocalePolicy">
<title>Custom <literal>LocalePolicy</literal></title>
- <para>The easiest way to customize the <literal>LocalePolicy</literal> is to extend <literal>DefaultLocalePolicyService</literal>.
- The study of its source code will be required. There is ample JavaDoc that provides thorough information.
+ <para>
+ The easiest way to customize the <literal>LocalePolicy</literal> is to extend <literal>DefaultLocalePolicyService</literal>. A study of the source code is required. JavaDocs provide thorough information on this.
+ </para>
+ <para>
Most customizations will involve simply overriding one or more of its protected methods.
</para>
<para>
- An example of a customization is an already provided <literal>NoBrowserLocalePolicyService</literal>.
- By overriding just one method, it skips any use of browser language preference.
+ An example of a customization is an already provided <literal>NoBrowserLocalePolicyService</literal>. By overriding just one method, it skips any use of browser language preference.
</para>
<programlisting language="Java" role="Java"><![CDATA[public class NoBrowserLocalePolicyService extends DefaultLocalePolicyService
{
@@ -184,61 +189,70 @@
</programlisting>
</section>
- <section>
+ <section id="sect-Reference_Guide-Portal_Development-LocalePolicy_Configuration">
<title>LocalePolicy Configuration</title>
- <para>The <literal>LocalePolicy</literal> framework is enabled for portlets by configuring LocalizationLifecycle class in portal's webui configuration file:
- <filename>gatein.ear/02portal.war/WEB-INF/webui-configuration.xml</filename>:</para>
+ <para>
+ The <literal>LocalePolicy</literal> framework is enabled for portlets by configuring <literal>LocalizationLifecycle</literal> class in portal's webui configuration file: <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/webui-configuration.xml</filename>:
+ </para>
-<programlisting language="XML" role="XML"><![CDATA[ <application-lifecycle-listeners>
+<programlisting language="XML" role="XML"><![CDATA[<application-lifecycle-listeners>
...
<listener>org.exoplatform.portal.application.localization.LocalizationLifecycle</listener>
- </application-lifecycle-listeners>]]>
+</application-lifecycle-listeners>]]>
</programlisting>
- <para>The default <literal>LocalePolicy</literal> implementation is installed as GateIn Kernel portal service via
- <filename>gatein.ear/lib/exo.portal.webui.portal-VERSION.jar/conf/portal/configuration.xml</filename>.
+ <para>
+ The default <literal>LocalePolicy</literal> implementation is installed as GateIn Kernel portal service via <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/lib/exo.portal.webui.portal-VERSION.jar/conf/portal/configuration.xml</filename>.
</para>
- <para>The following fragment is responsible for installing the service:
+ <para>
+ The following excerpt is responsible for installing the service:
</para>
-<programlisting language="XML" role="XML"><![CDATA[ <component>
+<programlisting language="XML" role="XML"><![CDATA[<component>
<key>org.exoplatform.services.resources.LocalePolicy</key>
<type>org.exoplatform.portal.application.localization.DefaultLocalePolicyService</type>
</component>]]>
</programlisting>
- <para>Besides implementing <literal>LocalePolicy</literal>, the service class also needs to implement
- <literal>org.picocontainer.Startable</literal> interface in order to get installed.
+ <para>
+ Besides implementing <literal>LocalePolicy</literal>, the service class also needs to implement <literal>org.picocontainer.Startable</literal> interface in order to get installed.
</para>
- <para>This configuration file should not be changed. The configuration in it can be overriden by placing it into portal's .war file:
- <filename>gatein.ear/02portal.war/WEB-INF/conf/configuration.xml</filename> (usually as another file included into this one).
+ <para>
+ This configuration file should not be changed. The configuration in it can be overridden by placing it into portal's .war file:
+ <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/conf/configuration.xml</filename> (usually as another file included into this one).
</para>
</section>
- <section>
+ <section id="sect-Reference_Guide-Portal_Development-non-bridged_sync">
<title>Keeping non-bridged resources in sync with current Locale</title>
- <para>In portals all the resources that are not portlets themselves but are accessed through portlets - reading
+ <para>
+ All the resources in portals that are not portlets themselves, but are accessed through portlets - reading
data through <literal>PortletRequest</literal>, and writing to <literal>PortletResponse</literal> - are
referred to as 'bridged'. Any resources that are accessed directly, bypassing portal filters and servlets,
are referred to as 'non-bridged'.
</para>
- <para>Non-bridged servlets, and .jsps have no access to <literal>PortalRequest</literal>. They don't use
+ <para>
+ Non-bridged servlets, and .jsps have no access to <literal>PortalRequest</literal>. They don't use
<literal>PortletRequest.getLocale()</literal> to determine current <literal>Locale</literal>.
Instead, they use <literal>ServletRequest.getLocale()</literal> which is subject to precise semantics
defined by Servlet specification - it reflects browser's language preference.
</para>
- <para>In other words, non-bridged resources don't have a notion of current <literal>Locale</literal>
+ <para>
+ In other words, non-bridged resources do not have a notion of current <literal>Locale</literal>
in the same sense that portlets do. The result is that when mixing portlets and non-bridged resources there
- may be a localization mismatch - an inconsistency in the language used by different resources composing your portal
+ may be a localization mismatch, an inconsistency in the language used by different resources composing your portal
page.
</para>
- <para>This problem is addressed by <literal>LocalizationFilter</literal>. This is a filter that changes the behaviour
- of <literal>ServletRequest.getLocale()</literal> method so that it behaves the same way as
- <literal>PortletRequest.getLocale()</literal>. That way even localization of servlets, and .jsps
- accessed in a non-bridged manner can stay in sync with portlet localization.
+ <para>
+ This problem is addressed by <literal>LocalizationFilter</literal>. This is a filter that changes the behavior
+ of <literal>ServletRequest.getLocale()</literal> method so that it behaves the same way as <literal>PortletRequest.getLocale()</literal>.
</para>
- <para><literal>LocalizationFilter</literal> is installed through portal's web.xml file: <filename>gatein.ear/02portal.war/WEB-INF/web.xml</filename>
+ <para>
+ That way even localization of servlets, and .jsps accessed in a non-bridged manner can stay in sync with portlet localization.
</para>
-<programlisting language="XML" role="XML"><![CDATA[ <filter>
+ <para>
+ <literal>LocalizationFilter</literal> is installed through the portal's web.xml file: <filename><replaceable>JBOSS_HOME</replaceable>/server/<replaceable><PROFILE></replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/web.xml</filename>.
+ </para>
+<programlisting language="XML" role="XML"><![CDATA[<filter>
<filter-name>LocalizationFilter</filter-name>
<filter-class>org.exoplatform.portal.application.localization.LocalizationFilter</filter-class>
</filter>
@@ -254,11 +268,10 @@
<dispatcher>ERROR</dispatcher>
</filter-mapping>]]>
</programlisting>
- <para>There is a tiny limitation with this mechanism in that it is unable to determine the current portal,
- and consequently its default language. As a result the portalLocale defaults to <literal>English</literal>, but can be configured
- to something else by using filter's <literal>PortalLocale</literal> init param. For example:
+ <para>
+ There is a minor limitation with this mechanism in that it is unable to determine the current portal,and consequently, its default language. As a result the portalLocale defaults to <literal>English</literal>, but can be configured to something else by using the filter's <literal>PortalLocale</literal> init param. For example:
</para>
-<programlisting language="XML" role="XML"><![CDATA[ <filter>
+<programlisting language="XML" role="XML"><![CDATA[<filter>
<filter-name>LocalizationFilter</filter-name>
<filter-class>org.exoplatform.portal.application.localization.LocalizationFilter</filter-class>
<init-param>
@@ -267,13 +280,18 @@
</init-param>
</filter> ]]>
</programlisting>
- <para>By default, <literal>LocalizationFilter</literal> is applied very broadly to cover all the resources automatically.
- &PRODUCT; uses some non-bridged .jsps that require <literal>LocalizationFilter</literal>, so narrowing
- the mapping to *.jsp is enough for &PRODUCT; to still function correctly. Additionally deployed portlets,
- and portal applications, however, may require broader mapping to cover their non-bridged resources.
+ <para>
+ By default, <literal>LocalizationFilter</literal> is applied very broadly to cover all the resources automatically.
</para>
- <para>Narrowing the mapping might improve performance. This is something to consider, when optimizing for speed.
+ <para>
+ &PRODUCT; uses some non-bridged .jsps that require <literal>LocalizationFilter</literal>, so narrowing the mapping to *.jsp is enough for &PRODUCT; to function correctly.
</para>
+ <para>
+ Additionally deployed portlets, and portal applications, however, may require broader mapping to cover their non-bridged resources.
+ </para>
+ <para>
+ Narrowing the mapping might improve performance. This is something to consider, when optimizing for speed.
+ </para>
</section>
</section>
</chapter>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/gettingstarted.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/gettingstarted.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/gettingstarted.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -110,7 +110,7 @@
The embedded version in the &PRODUCT; is made to be compatible with the JSF implementation, portal and application server that compose the product. You will find the binaries embedded in <filename>jboss-epp-5.0/portletbridge</filename>
</para>
<para>
- You can run a provided archetype (See <xref linkend="sect-Reference_Guide-Getting_started_with_JBoss_Portlet_Bridge-Maven_Archetypes" />) and deploy the generated <literal>war</literal> in a few easy steps.
+ You can run a provided archetype (See <xref linkend="sect-Reference_Guide-Getting_started_with_JBoss_Portlet_Bridge-Maven_Archetypes" />) and deploy the generated <literal>war</literal> or <literal>ear</literal> in a few easy steps.
</para>
</section>
@@ -118,7 +118,9 @@
<section id="sect-Reference_Guide-Getting_started_with_JBoss_Portlet_Bridge-Maven_Archetypes">
<title>Maven Archetypes</title>
<para>
- This product utilizes <ulink url="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html">Maven archetypes</ulink> which allow you get up and running with different flavors of the bridge quickly.
+ This product utilizes <ulink url="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html">Maven archetypes</ulink> which allow you get up and running with different flavors of the bridge quickly.
+ </para>
+<!--DOC NOTE: Branching issue -->
<table frame="all" id="tabl-Reference_Guide-Maven_Archetypes-Available_Archetypes">
<title>Available Archetypes</title>
<tgroup align="left" cols="5" colsep="1" rowsep="1">
@@ -137,6 +139,11 @@
</row>
</thead>
<tbody>
+ <row>
+ <entry align="left" nameend="c5" namest="c1">
+ <emphasis role="bold">For PortletBridge 2.0.0 as shipped with &PRODUCT; 5.0</emphasis>.
+ </entry>
+ </row>
<row class="table-odd" style="background-color:#D6DEE0;border:1px solid #E1E9EB;color:#334558;">
<entry align="left">
JSF 1.2 Basic
@@ -167,10 +174,23 @@
</entry>
</row>
+ <row>
+ <entry align="left" nameend="c5" namest="c1">
+ <emphasis role="bold">For PortletBridge 2.1.0 as shipped with &PRODUCT; &VERSION_MINOR;</emphasis>.
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Any combination JSF 1.2, RichFaces, or Seam.
+ </entry>
+ <entry align="left" nameend="c5" namest="c2">
+<programlisting >mvn archetype:generate -DarchetypeCatalog=http://anonsvn.jboss.org/repos/portletbridge/trunk/archetypes/archetype-catalog.xml
+</programlisting>
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
- </para>
</section>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -210,8 +210,8 @@
</section>
- <section id="sect-Reference_Guide-Developing_Portlets_with_the_Bridge-Linking_to_PortletJSF_Pages_Using_houtputink">
- <title>Linking to Portlet/JSF Pages Using h:outputink</title>
+ <section id="sect-Reference_Guide-Developing_Portlets_with_the_Bridge-Linking_to_PortletJSF_Pages_Using_houtputlink">
+ <title>Linking to Portlet/JSF Pages Using h:outputlink</title>
<para>
For linking to any JSF/Facelets page within your portlet web application, you can use the following.
</para>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml 2010-11-30 05:06:37 UTC (rev 5371)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml 2010-11-30 06:00:01 UTC (rev 5372)
@@ -77,7 +77,7 @@
<term><replaceable>EPP_HOME</replaceable></term>
<listitem>
<para>
- <replaceable>EPP_HOME</replaceable> refers to the directory that your instance of &PRODUCT; has been extracted/installed to. For example: <filename>/home/<replaceable>USERNAME</replaceable>/jboss-epp-5.0/</filename>
+ <replaceable>EPP_HOME</replaceable> refers to the directory that your instance of &PRODUCT; has been extracted/installed to. For example: <filename>/home/<replaceable>USERNAME</replaceable>/jboss-epp-<replaceable><VERSION></replaceable>/</filename>
</para>
</listitem>
</varlistentry>
14 years
gatein SVN: r5371 - in exo/portal/branches/standalone: web/portal/src/main/webapp/WEB-INF and 2 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-11-30 00:06:37 -0500 (Tue, 30 Nov 2010)
New Revision: 5371
Modified:
exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebAppController.java
exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebRequestHandler.java
exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml
exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalController.java
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java
Log:
Move handler registration to configuration instead of code programming
the handler should initialize its corresponding WebuiApplication by itself
Modified: exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebAppController.java
===================================================================
--- exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebAppController.java 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebAppController.java 2010-11-30 05:06:37 UTC (rev 5371)
@@ -20,9 +20,11 @@
package org.exoplatform.web;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
+import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -133,6 +135,15 @@
handlers_.remove(path);
}
+ public void onHandlersInit(ServletConfig config) throws Exception
+ {
+ Collection<WebRequestHandler> handlers = handlers_.values();
+ for (WebRequestHandler handler : handlers)
+ {
+ handler.onInit(this, config);
+ }
+ }
+
/**
* This is the first method - in the eXo web framework - reached by incoming HTTP request, it acts like a
* servlet service() method
Modified: exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebRequestHandler.java
===================================================================
--- exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebRequestHandler.java 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/component/web/src/main/java/org/exoplatform/web/WebRequestHandler.java 2010-11-30 05:06:37 UTC (rev 5371)
@@ -19,6 +19,7 @@
package org.exoplatform.web;
+import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -37,10 +38,9 @@
*/
abstract public class WebRequestHandler extends BaseComponentPlugin
{
-
- public void onInit(WebAppController controller) throws Exception
+ public void onInit(WebAppController controller, ServletConfig sConfig) throws Exception
{
-
+
}
abstract public String[] getPath();
Modified: exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml 2010-11-30 05:06:37 UTC (rev 5371)
@@ -272,23 +272,22 @@
<url-pattern>/download/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
+ <servlet-name>portal</servlet-name>
+ <url-pattern>/standalone/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
<servlet-name>RestServer</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
-
<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>/connector</url-pattern>
</servlet-mapping>
-
<servlet-mapping>
<servlet-name>GateInServlet</servlet-name>
<url-pattern>/gateinservlet</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>portal</servlet-name>
- <url-pattern>/standalone/*</url-pattern>
- </servlet-mapping>
+
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Modified: exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml
===================================================================
--- exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml 2010-11-30 05:06:37 UTC (rev 5371)
@@ -24,11 +24,29 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <type>org.exoplatform.portal.application.ApplicationStatisticService</type>
- </component>
+ <component>
+ <type>org.exoplatform.portal.application.ApplicationStatisticService</type>
+ </component>
- <component>
- <type>org.exoplatform.portal.application.PortalStatisticService</type>
- </component>
+ <component>
+ <type>org.exoplatform.portal.application.PortalStatisticService</type>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.web.WebAppController</target-component>
+ <component-plugin>
+ <name>PortalRequestHandler</name>
+ <set-method>register</set-method>
+ <type>org.exoplatform.portal.application.PortalRequestHandler</type>
+ </component-plugin>
+ </external-component-plugins>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.web.WebAppController</target-component>
+ <component-plugin>
+ <name>StandaloneAppRequestHandler</name>
+ <set-method>register</set-method>
+ <type>org.exoplatform.portal.application.StandaloneAppRequestHandler</type>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Modified: exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalController.java
===================================================================
--- exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalController.java 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalController.java 2010-11-30 05:06:37 UTC (rev 5371)
@@ -73,15 +73,8 @@
// Set the full classloader of the portal container
Thread.currentThread().setContextClassLoader(portalContainer.getPortalClassLoader());
hasChanged = true;
- PortalApplication application = new PortalApplication(config);
- application.onInit();
- controller.addApplication(application);
- controller.register(new PortalRequestHandler());
- StandaloneApplication standaloneApplication = new StandaloneApplication(config);
- standaloneApplication.onInit();
- controller.addApplication(standaloneApplication);
- controller.register(new StandaloneAppRequestHandler());
+ controller.onHandlersInit(config);
log.info("The WebAppController has been successfully initialized for the portal '" + portalContainer.getName()
+ "'");
}
Modified: exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
===================================================================
--- exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2010-11-30 05:06:37 UTC (rev 5371)
@@ -32,6 +32,7 @@
import java.util.List;
+import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -53,6 +54,14 @@
{
return PATHS;
}
+
+ @Override
+ public void onInit(WebAppController controller, ServletConfig sConfig) throws Exception
+ {
+ PortalApplication application = new PortalApplication(sConfig);
+ application.onInit();
+ controller.addApplication(application);
+ }
/**
* This method will handle incoming portal request. It gets a reference to the WebAppController
Modified: exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java
===================================================================
--- exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java 2010-11-30 04:24:48 UTC (rev 5370)
+++ exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java 2010-11-30 05:06:37 UTC (rev 5371)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.application;
+import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -35,6 +36,14 @@
return PATHS;
}
+ @Override
+ public void onInit(WebAppController controller, ServletConfig sConfig) throws Exception
+ {
+ StandaloneApplication standaloneApplication = new StandaloneApplication(sConfig);
+ standaloneApplication.onInit();
+ controller.addApplication(standaloneApplication);
+ }
+
public void execute(WebAppController controller, HttpServletRequest req, HttpServletResponse res) throws Exception
{
log.debug("Session ID = " + req.getSession().getId());
14 years