gatein SVN: r5055 - portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-11-12 03:04:49 -0500 (Fri, 12 Nov 2010)
New Revision: 5055
Modified:
portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl
Log:
GTNPORTAL-1608 Provide popup links for edit and view URL in Gadget Registry
Modified: portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl 2010-11-12 07:31:50 UTC (rev 5054)
+++ portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl 2010-11-12 08:04:49 UTC (rev 5055)
@@ -11,6 +11,9 @@
if(gadgetThumbnail == null || gadgetThumbnail.length() == 0){
gadgetThumbnail = srcBGError ;
}
+ def viewURL = uicomponent.getViewUrl();
+ def editURL = uicomponent.getEditUrl();
+ def refURL = gadget.getReferenceUrl();
%>
<div class="UIGadgetInfo" id="$uicomponent.id">
<div class="UIBreadcumb">
@@ -41,12 +44,12 @@
<table>
<tr>
<td class="LeftLabel"><%=_ctx.appRes("UIGadgetInfo.label.viewUrl")%></td>
- <td class="RightLabel" title=" <%= uicomponent.getViewUrl() %> "><%= uicomponent.getViewUrl() %></td>
+ <td class="RightLabel" title=" <%=viewURL %> "><a href="<%=viewURL %>" target="_blank">$viewURL</a></td>
</tr>
<% if(gadget.isLocal()) {%>
<tr>
<td class="LeftLabel"><%=_ctx.appRes("UIGadgetInfo.label.editUrl")%></td>
- <td class="RightLabel"><%= uicomponent.getEditUrl() %></td>
+ <td class="RightLabel"><a href="<%=editURL %>" target="_blank">$editURL</a></td>
</tr>
<% } %>
</table>
@@ -54,7 +57,7 @@
<tr>
<td class="LeftLabel"><%=_ctx.appRes("UIGadgetInfo.label.reference")%></td>
<td class="RightLabel">
- <%= gadget.getReferenceUrl() %>
+ <a href="<%=refURL %>" target="_blank">$refURL</a>
</td>
</tr>
</table>
15 years, 5 months
gatein SVN: r5054 - in exo/portal/branches/3.1.x/component/scripting/src: test/java/org/exoplatform/groovyscript and 1 other directory.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-11-12 02:31:50 -0500 (Fri, 12 Nov 2010)
New Revision: 5054
Modified:
exo/portal/branches/3.1.x/component/scripting/src/main/java/org/exoplatform/groovyscript/TemplateParser.java
exo/portal/branches/3.1.x/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
Log:
GTNPORTAL-1563 Backslash not properly handled in gtmpl
Modified: exo/portal/branches/3.1.x/component/scripting/src/main/java/org/exoplatform/groovyscript/TemplateParser.java
===================================================================
--- exo/portal/branches/3.1.x/component/scripting/src/main/java/org/exoplatform/groovyscript/TemplateParser.java 2010-11-12 06:59:11 UTC (rev 5053)
+++ exo/portal/branches/3.1.x/component/scripting/src/main/java/org/exoplatform/groovyscript/TemplateParser.java 2010-11-12 07:31:50 UTC (rev 5054)
@@ -55,7 +55,9 @@
GSTRING_CURLY_EXPR,
- GSTRING_EXPR
+ GSTRING_EXPR,
+
+ BACKSLASH
}
public List<TemplateSection> parse(String s)
@@ -127,6 +129,10 @@
{
status = Status.START_ANGLE;
}
+ else if (c == '\\')
+ {
+ status = Status.BACKSLASH;
+ }
else if (c == '$')
{
status = Status.MAYBE_GSTRING_EXPR;
@@ -286,6 +292,11 @@
accumulator.append(c);
}
break;
+ case BACKSLASH:
+ accumulator.append('\\');
+ accumulator.append(c);
+ status = Status.TEXT;
+ break;
default:
throw new AssertionError();
}
Modified: exo/portal/branches/3.1.x/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
===================================================================
--- exo/portal/branches/3.1.x/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-11-12 06:59:11 UTC (rev 5053)
+++ exo/portal/branches/3.1.x/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2010-11-12 07:31:50 UTC (rev 5054)
@@ -128,7 +128,7 @@
assertEquals("bar", s);
}
- public void testGString2() throws Exception
+ public void testQuoteAfterGString() throws Exception
{
GroovyTemplate template = new GroovyTemplate("$foo\"");
Map<String, String> context = new HashMap<String, String>();
@@ -137,6 +137,51 @@
assertEquals("bar\"", s);
}
+ public void testDollarInExpression() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<%= \"$foo\" %>");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", "bar");
+ String s = template.render(context);
+ assertEquals("bar", s);
+ }
+
+ public void testEscapeDollarInExpression() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<%= \"\\$foo\" %>");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", "bar");
+ String s = template.render(context);
+ assertEquals("$foo", s);
+ }
+
+ public void testEscapeDollarInText() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("\\$foo");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", "bar");
+ String s = template.render(context);
+ assertEquals("$foo", s);
+ }
+
+ public void testDollarInScriplet() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<% out.print(\"$foo\") %>");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", "bar");
+ String s = template.render(context);
+ assertEquals("bar", s);
+ }
+
+ public void testEscapeDollarInScriplet() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<% out.print(\"\\$foo\") %>");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", "bar");
+ String s = template.render(context);
+ assertEquals("$foo", s);
+ }
+
public void testQuote() throws Exception
{
GroovyTemplate template = new GroovyTemplate("\"");
15 years, 5 months
gatein SVN: r5053 - portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-12 01:59:11 -0500 (Fri, 12 Nov 2010)
New Revision: 5053
Modified:
portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
Log:
GTNPORTAL-1630 Allow display a page has page reference value but page has been removed already
Modified: portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java 2010-11-12 06:48:59 UTC (rev 5052)
+++ portal/branches/branch-GTNPORTAL-1643/portlet/exoadmin/src/main/java/org/exoplatform/toolbar/webui/component/UIUserToolBarSitePortlet.java 2010-11-12 06:59:11 UTC (rev 5053)
@@ -68,7 +68,7 @@
{
PageNavigation navi = getPageNavigation(PortalConfig.PORTAL_TYPE + "::" + getCurrentPortal());
String remoteUser = Util.getPortalRequestContext().getRemoteUser();
- return PageNavigationUtils.filter(navi, remoteUser);
+ return PageNavigationUtils.filterNavigation(navi, remoteUser, false, true);
}
private PageNavigation getPageNavigation(String owner) throws Exception
15 years, 5 months
gatein SVN: r5052 - in exo/portal/branches/3.1.x: examples/extension/war/src/main/webapp/login/jsp and 5 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-11-12 01:48:59 -0500 (Fri, 12 Nov 2010)
New Revision: 5052
Removed:
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
Modified:
exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
exo/portal/branches/3.1.x/examples/extension/war/src/main/webapp/login/jsp/login.jsp
exo/portal/branches/3.1.x/examples/portal/war/src/main/webapp/login/jsp/login.jsp
exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
exo/portal/branches/3.1.x/web/portal/src/main/webapp/login/jsp/login.jsp
exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
Log:
EXOGTN-86 There is invalid page when login successfully to the intranet after a failed login
Modified: exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
===================================================================
--- exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-12 06:48:59 UTC (rev 5052)
@@ -129,12 +129,12 @@
}
try
{
- req.setAttribute("org.gatein.portal.login.initial_uri", initialURI);
+ req.getSession(true).setAttribute("org.gatein.portal.login.initial_uri", initialURI);
getServletContext().getRequestDispatcher("/login/jsp/login.jsp").include(req, resp);
}
finally
{
- req.removeAttribute("org.gatein.portal.login.initial_uri");
+ req.getSession(true).removeAttribute("org.gatein.portal.login.initial_uri");
}
}
Modified: exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java
===================================================================
--- exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/component/web/src/main/java/org/exoplatform/web/login/PortalLoginController.java 2010-11-12 06:48:59 UTC (rev 5052)
@@ -73,12 +73,13 @@
// otherwise compute one
if (uri == null || uri.length() == 0)
{
- uri = req.getContextPath() + "/private/classic";
+ uri = req.getContextPath();
log.debug("No initial URI found, will use default " + uri + " instead ");
}
else
{
log.debug("Found initial URI " + uri);
+ req.getSession(true).setAttribute("org.gatein.portal.login.initial_uri", uri);
}
// if we do have a remember me
Modified: exo/portal/branches/3.1.x/examples/extension/war/src/main/webapp/login/jsp/login.jsp
===================================================================
--- exo/portal/branches/3.1.x/examples/extension/war/src/main/webapp/login/jsp/login.jsp 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/examples/extension/war/src/main/webapp/login/jsp/login.jsp 2010-11-12 06:48:59 UTC (rev 5052)
@@ -26,6 +26,7 @@
<%@ page import="java.util.ResourceBundle"%>
<%@ page import="org.exoplatform.web.login.InitiateLoginServlet"%>
<%@ page import="org.gatein.common.text.EntityEncoder"%>
+<%@ page import="javax.servlet.http.HttpSession"%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%
@@ -40,7 +41,9 @@
ResourceBundleService service = (ResourceBundleService) portalContainer.getComponentInstanceOfType(ResourceBundleService.class);
ResourceBundle res = service.getResourceBundle(service.getSharedResourceBundleNames(), request.getLocale()) ;
- String uri = (String)request.getAttribute("org.gatein.portal.login.initial_uri");
+ HttpSession httpSession = request.getSession(true);
+ String uri = (String)httpSession.getAttribute("org.gatein.portal.login.initial_uri");
+ httpSession.removeAttribute("org.gatein.portal.login.initial_uri");
Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, "");
cookie.setPath(request.getContextPath());
Modified: exo/portal/branches/3.1.x/examples/portal/war/src/main/webapp/login/jsp/login.jsp
===================================================================
--- exo/portal/branches/3.1.x/examples/portal/war/src/main/webapp/login/jsp/login.jsp 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/examples/portal/war/src/main/webapp/login/jsp/login.jsp 2010-11-12 06:48:59 UTC (rev 5052)
@@ -26,6 +26,7 @@
<%@ page import="java.util.ResourceBundle"%>
<%@ page import="org.exoplatform.web.login.InitiateLoginServlet"%>
<%@ page import="org.gatein.common.text.EntityEncoder"%>
+<%@ page import="javax.servlet.http.HttpSession"%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%
@@ -40,7 +41,9 @@
ResourceBundleService service = (ResourceBundleService) portalContainer.getComponentInstanceOfType(ResourceBundleService.class);
ResourceBundle res = service.getResourceBundle(service.getSharedResourceBundleNames(), request.getLocale()) ;
- String uri = (String)request.getAttribute("org.gatein.portal.login.initial_uri");
+ HttpSession httpSession = request.getSession(true);
+ String uri = (String)httpSession.getAttribute("org.gatein.portal.login.initial_uri");
+ httpSession.removeAttribute("org.gatein.portal.login.initial_uri");
Cookie cookie = new Cookie(InitiateLoginServlet.COOKIE_NAME, "");
cookie.setPath(request.getContextPath());
Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2010-11-12 06:48:59 UTC (rev 5052)
@@ -7,7 +7,7 @@
jsmanager.addCustomizedOnLoadScript('document.getElementById("UIPortalComponentLogin").username.focus();');
HttpSession session = rcontext.getRequest().getSession();
String requestPath = rcontext.getRequestContextPath() + "/private/" + rcontext.getPortalOwner();
- session.setAttribute("initialURI", requestPath);
+ //session.setAttribute("initialURI", requestPath);
%>
<div class="UILoginForm">
<div class="LoginDecorator">
@@ -22,22 +22,20 @@
<div class="MiddleRightLoginDecorator">
<div class="LoginDecoratorBackground">
<div class="LoginDetailBox">
- <% uiform.begin(); %>
- <!--<form class="UIForm" id="$uicomponent.id" name="loginForm" action="<%= rcontext.getRequestContextPath() + "/login"%>" method="post" style="margin: 0px;">
- <input type="hidden" name="<%= uiform.ACTION %>" value=""/>-->
- <input type="hidden" name="initialURI" value="<%=session.getAttribute("initialURI"); %>"/>
+ <form class="UIForm" id="$uicomponent.id" name="loginForm" action="<%= rcontext.getRequestContextPath() + "/login"%>" method="post" style="margin: 0px;">
+ <input type="hidden" name="initialURI" value="<%=requestPath%>"/>
<div class="VerticalLayout">
<table class="UIFormGrid">
<tr class="UserNameField">
<td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.UserName")%></td>
- <td><% uiform.renderChild(0)%></td>
+ <td><input class="UserName" name="username"/></td>
</tr>
<tr class="PasswordField" id="UIPortalLoginFormControl" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
<td class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.password")%></td>
- <td><% uiform.renderChild(1)%></td>
+ <td><input class="Password" type="password" name="password"/></td>
</tr>
<tr class="RememberField" onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
- <td class="FieldLabel"><% uiform.renderChild(2)%></td>
+ <td class="FieldLabel"><input type="checkbox" class="checkbox" value="true" name="rememberme"/></td>
<td><%=_ctx.appRes("UILoginForm.label.RememberOnComputer")%></td>
</tr>
</table>
@@ -69,7 +67,7 @@
</table>
</div>
</div>
- <%uiform.end()%>
+ </form>
</div>
</div>
</div>
@@ -84,7 +82,6 @@
<script>
function login(ele) {
var formEle = eXo.core.DOMUtil.findAncestorByTagName(ele,'form');
- formEle.action = eXo.env.portal.context + "/login";
formEle.submit();
}
</script>
Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/login/jsp/login.jsp
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/login/jsp/login.jsp 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/login/jsp/login.jsp 2010-11-12 06:48:59 UTC (rev 5052)
@@ -26,6 +26,7 @@
<%@ page import="java.util.ResourceBundle"%>
<%@ page import="org.exoplatform.web.login.InitiateLoginServlet"%>
<%@ page import="org.gatein.common.text.EntityEncoder"%>
+<%@ page import="javax.servlet.http.HttpSession"%>
<%@ page language="java" %>
<%
String contextPath = request.getContextPath() ;
@@ -44,8 +45,9 @@
cookie.setMaxAge(0);
response.addCookie(cookie);
- String uri = (String)request.getAttribute("org.gatein.portal.login.initial_uri");
-
+ HttpSession httpSession = request.getSession(true);
+ String uri = (String)httpSession.getAttribute("org.gatein.portal.login.initial_uri");
+ httpSession.removeAttribute("org.gatein.portal.login.initial_uri");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
%>
Deleted: exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java
===================================================================
--- exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/UILoginForm.java 2010-11-12 06:48:59 UTC (rev 5052)
@@ -1,92 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.webui;
-
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.services.organization.OrganizationService;
-import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.exception.MessageException;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormStringInput;
-
-import java.net.URLEncoder;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Nhu Dinh Thuan
- * nhudinhthuan(a)exoplatform.com
- * Jul 11, 2006
- */
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
- @EventConfig(listeners = UILoginForm.SigninActionListener.class),
- @EventConfig(phase = Phase.DECODE, listeners = UIMaskWorkspace.CloseActionListener.class)})
-public class UILoginForm extends UIForm
-{
-
- public UILoginForm() throws Exception
- {
- addUIFormInput(new UIFormStringInput("username", "username", null)).addUIFormInput(
- new UIFormStringInput("password", "password", null).setType(UIFormStringInput.PASSWORD_TYPE));
- }
-
- static public class SigninActionListener extends EventListener<UILoginForm>
- {
-
- public void execute(Event<UILoginForm> event) throws Exception
- {
- UILoginForm uiForm = event.getSource();
- String username = uiForm.getUIStringInput("username").getValue();
- String password = uiForm.getUIStringInput("password").getValue();
-
- OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
- boolean authentication = orgService.getUserHandler().authenticate(username, password);
- if (!authentication)
- {
- throw new MessageException(new ApplicationMessage("UILoginForm.msg.Invalid-account", null));
- }
-
- PortalRequestContext prContext = Util.getPortalRequestContext();
- HttpServletRequest request = prContext.getRequest();
- HttpSession session = request.getSession();
- session.setAttribute("authentication.username", username);
- session.setAttribute("authentication.password", password);
- UIPortal uiPortal = Util.getUIPortal();
- prContext.setResponseComplete(true);
- String portalName = uiPortal.getName();
- portalName = URLEncoder.encode(portalName, "UTF-8");
- String redirect = request.getContextPath() + "/private/" + portalName + "/";
- prContext.getResponse().sendRedirect(redirect);
- }
-
- }
-
-}
Modified: exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
===================================================================
--- exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2010-11-12 05:48:02 UTC (rev 5051)
+++ exo/portal/branches/3.1.x/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2010-11-12 06:48:59 UTC (rev 5052)
@@ -20,17 +20,13 @@
package org.exoplatform.portal.webui.login;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.web.login.InitiateLoginServlet;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.event.EventListener;
/**
* Created by The eXo Platform SARL
@@ -38,58 +34,15 @@
* nhudinhthuan(a)exoplatform.com
* Jul 11, 2006
*/
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
- // @EventConfig(listeners = UILoginForm.SigninActionListener.class),
+@ComponentConfig(template = "system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
@EventConfig(phase = Phase.DECODE, listeners = UIMaskWorkspace.CloseActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners = UILoginForm.ForgetPasswordActionListener.class)})
-public class UILoginForm extends UIForm
+public class UILoginForm extends UIComponent
{
- final static String USER_NAME = "username";
-
- final static String PASSWORD = "password";
-
public UILoginForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).addValidator(MandatoryValidator.class))
- .addUIFormInput(
- new UIFormStringInput(PASSWORD, PASSWORD, null).setType(UIFormStringInput.PASSWORD_TYPE).addValidator(
- MandatoryValidator.class));
- addUIFormInput(new UIFormCheckBoxInput<String>(InitiateLoginServlet.COOKIE_NAME,
- InitiateLoginServlet.COOKIE_NAME, Boolean.TRUE.toString()));
}
- static public class SigninActionListener extends EventListener<UILoginForm>
- {
-
- public void execute(Event<UILoginForm> event) throws Exception
- {
- // UILoginForm uiForm = event.getSource();
- // String username = uiForm.getUIStringInput(USER_NAME).getValue();
- // String password = uiForm.getUIStringInput(PASSWORD).getValue();
- // OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
- // boolean authentication = orgService.getUserHandler().authenticate(username, password);
- // if(!authentication){
- // throw new MessageException(new ApplicationMessage("UILoginForm.msg.Invalid-account", null));
- // }
- // PortalRequestContext prContext = Util.getPortalRequestContext();
- // HttpServletRequest request = prContext.getRequest();
- // HttpSession session = request.getSession();
- // session.setAttribute("authentication.username", username);
- // session.setAttribute("authentication.password", password);
- // UIPortal uiPortal = Util.getUIPortal();
- // prContext.setResponseComplete(true);
- // String portalName = uiPortal.getName() ;
- // HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request) ;
- // wrapper.getParameterMap().put("username", username) ;
- // wrapper.getParameterMap().put("password", password) ;
- // portalName = URLEncoder.encode(portalName, "UTF-8") ;
- // String redirect = request.getContextPath() + "/private/" + portalName + "/";
- // prContext.getResponse().sendRedirect(redirect);
- }
-
- }
-
- //TODO: dang.tung - forget password
static public class ForgetPasswordActionListener extends EventListener<UILoginForm>
{
public void execute(Event<UILoginForm> event) throws Exception
@@ -100,4 +53,16 @@
event.getRequestContext().addUIComponentToUpdateByAjax(uiLogin);
}
}
+
+ @Override
+ public void processDecode(WebuiRequestContext context) throws Exception
+ {
+ super.processDecode(context);
+ String action = context.getRequestParameter(context.getActionParameterName());
+ Event<UIComponent> event = createEvent(action, Event.Phase.DECODE, context);
+ if (event != null)
+ {
+ event.broadcast();
+ }
+ }
}
15 years, 5 months
gatein SVN: r5051 - epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-12 00:48:02 -0500 (Fri, 12 Nov 2010)
New Revision: 5051
Added:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml
Modified:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Book_Info.xml
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Configuration.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/Revision_History.xml
Log:
JBEPP-569: Added HTTPSConfiguration patch from GTNPORTAL-1535. Edited new section.
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Book_Info.xml 2010-11-12 05:07:40 UTC (rev 5050)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Book_Info.xml 2010-11-12 05:48:02 UTC (rev 5051)
@@ -12,7 +12,7 @@
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5</productnumber>
<edition>1</edition>
- <pubsnumber>1.8</pubsnumber>
+ <pubsnumber>1.9</pubsnumber>
<abstract>
<para>
This book provides information about obtaining, installing and
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Configuration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Configuration.xml 2010-11-12 05:07:40 UTC (rev 5050)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Configuration.xml 2010-11-12 05:48:02 UTC (rev 5051)
@@ -9,7 +9,7 @@
<xi:include href="DatabaseConfiguration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="EMailServiceConfiguration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="ClusteringConfiguration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="HTTPSConfiguration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
</chapter>
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-12 05:07:40 UTC (rev 5050)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-11-12 05:48:02 UTC (rev 5051)
@@ -10,7 +10,6 @@
<title>Pre-Requisites</title>
<para>
You must have adequate disk space to install a JDK and &PRODUCT; (about 520MB) while also allowing enough space for your applications. Before installing &PRODUCT; you must have a working installation of Java. Since JBoss is 100% pure Java you can have it working on any Operating System / Platform that supports Java.
- <!--However, only some combinations are certified (tested prior to shipping) or supported (on which you can open support tickets), the certified combinations are listed below. -->
</para>
<section id="Pre_Requisites-EAP">
<title>Enterprise Application Platform</title>
@@ -49,7 +48,7 @@
The server configuration including the selected log files, their designated size and general server tuning.
</para>
</listitem>
- </itemizedlist>
+ </itemizedlist>
<para>
The following discussion relates to the deployment of a simple application on a server experiencing minimal demand. In view of this, the absolute minimum requirements for an operational server are:
</para>
@@ -210,10 +209,10 @@
</table>
<para>
- The following is a <emphasis role="bold">cumulative</emphasis> list of supported databases and JDBC drivers.
+ The following is a <emphasis role="bold">cumulative</emphasis> table of supported databases and JDBC drivers.
</para>
<para>
- Entries shown for each release are supported in <emphasis>addition</emphasis> to those in previous releases:
+ Entries shown for each release are supported <emphasis role="bold">in addition to those in previous releases</emphasis>:
</para>
<indexterm>
<primary>System Requirements</primary>
Added: 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 (rev 0)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/HTTPSConfiguration.xml 2010-11-12 05:48:02 UTC (rev 5051)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "Installation_Guide.ent">
+%BOOK_ENTITIES;
+]>
+<section id="sect-Installation_Guide-HTTPS_Configuration">
+ <title>HTTPS Configuration</title>
+
+ <section id="sect-Installation_Guide-HTTPS_Configuration-Overview">
+ <title>Overview</title>
+ <para>
+ &PRODUCT; runs, by default, in HTTP mode. However, for security purposes, you can configure it to run in HTTPS mode. This section explains how to run &PRODUCT; in HTTPS mode.
+ </para>
+
+ </section>
+ <section id="sect-Installation_Guide-HTTPS_Configuration-Generate_Key">
+ <title>Generate your key</title>
+ <para>
+ If you haven't a X.509 certificate, you can make a simple certificate using the <command>keytool</command> command:
+ </para>
+ <procedure>
+ <title><emphasis role="bold"></emphasis></title>
+ <step>
+ <para>
+ Change the variables in the following command to suit your circumstances then run it a terminal:
+ </para>
+<programlisting>keytool -genkey -alias serverkeys -keyalg RSA -keystore server.keystore -storepass 123456 -keypass 123456 -dname "CN=localhost, OU=MYOU, O=MYORG, L=MYCITY, ST=MYSTATE, C=MY"</programlisting>
+ <para>
+ Your key will be stored in <filename>server.keystore</filename>
+ </para>
+ </step>
+ <step>
+ <para>
+ Import your key into the Sun JDK keystore (this is required to help running gadget features) with the following command:
+ </para>
+<programlisting>keytool -importkeystore -srckeystore server.keystore -destkeystore $JAVA_HOME/jre/lib/security/cacerts</programlisting>
+ </step>
+ </procedure>
+ </section>
+
+ <section id="sect-Installation_Guide-HTTPS_Configuration-Use_In_Jboss">
+ <title>Setup JBoss configuration to use your key</title>
+ <para>
+ To set the JBoss configuration to use the new key:
+ </para>
+ <procedure>
+ <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>:
+ </para>
+<programlisting><![CDATA[<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
+ connectionTimeout="20000" redirectPort="8443" >
+]]></programlisting>
+ </step>
+ <step>
+ <para>
+ Uncomment the following lines...
+ </para>
+<programlisting><![CDATA[<Connector protocol="HTTP/1.1" SSLEnabled="true"
+ port="8443" address="${jboss.bind.address}"
+ scheme="https" secure="true" clientAuth="false"
+ keystoreFile="$JAVA_HOME/jre/lib/security/cacerts"
+ keystorePass="123456" sslProtocol = "TLS" />
+]]></programlisting>
+ <para>
+ ...and change the values of <literal>keystoreFile</literal> and <literal>keystorePass</literal> to values of your key.
+ </para>
+ </step>
+ </procedure>
+ </section>
+
+ <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:
+ </para>
+ <procedure>
+ <title><emphasis role="bold"></emphasis></title>
+ <step>
+ <para>
+ Comment the following lines in <filename>tomcat/conf/server.xml</filename>:
+ </para>
+<programlisting><![CDATA[<Connector port="8080" protocol="HTTP/1.1"
+ maxThreads="150" connectionTimeout="20000"
+ redirectPort="8443" URIEncoding="UTF-8"
+ emptySessionPath="true"/ >
+]]></programlisting>
+ </step>
+ <step>
+ <para>
+ Uncomment the following lines...
+ </para>
+<programlisting><![CDATA[<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
+ maxThreads="150" scheme="https" secure="true"
+ clientAuth="false" sslProtocol="TLS"
+ keystoreFile="$JAVA_HOME/jre/lib/security/cacerts"
+ keystorePass="123456" />
+]]></programlisting>
+ <para>
+ ...and change the values of <literal>keystoreFile</literal> and <literal>keystorePass</literal> to values of your key.
+ </para>
+ </step>
+ </procedure>
+ </section>
+ <section>
+ <title><emphasis role="bold">Restart</emphasis></title>
+ <para>
+ Once you have configured your environment, restart your &PRODUCT; instance.
+ </para>
+ <para>
+ You can now access the portal via address: <literal>https://<replaceable><ServerAddress></replaceable>:8443/portal</literal>
+ </para>
+ </section>
+</section>
Modified: epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Revision_History.xml 2010-11-12 05:07:40 UTC (rev 5050)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Revision_History.xml 2010-11-12 05:48:02 UTC (rev 5051)
@@ -8,8 +8,21 @@
<title>Revision History</title>
<simpara>
<revhistory>
-
- <revision>
+ <revision>
+ <revnumber>1-1.9</revnumber>
+ <date></date>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Mumford</surname>
+ <email>smumford(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Added and edited HTTPS Configuration section.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
<revnumber>1-1.8</revnumber>
<date>Tue Oct 26 2010</date>
<author>
15 years, 5 months
gatein SVN: r5050 - portal/trunk/component/web/server/src/main/java/org/exoplatform/upload.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-11-12 00:07:40 -0500 (Fri, 12 Nov 2010)
New Revision: 5050
Modified:
portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
Log:
GTNPORTAL-1380 Support more createUploadResource method that work with Inputstream
Modified: portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java
===================================================================
--- portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-11-12 04:21:12 UTC (rev 5049)
+++ portal/trunk/component/web/server/src/main/java/org/exoplatform/upload/UploadService.java 2010-11-12 05:07:40 UTC (rev 5050)
@@ -71,7 +71,7 @@
/**
* Create UploadResource for HttpServletRequest
*
- * @param requestow
+ * @param request
* the webapp's {@link javax.servlet.http.HttpServletRequest}
* @throws FileUploadException
*/
@@ -79,10 +79,15 @@
public void createUploadResource(HttpServletRequest request) throws FileUploadException
{
String uploadId = request.getParameter("uploadId");
+ createUploadResource(uploadId, request);
+ }
+
+ public void createUploadResource(String uploadId, HttpServletRequest request) throws FileUploadException
+ {
UploadResource upResource = new UploadResource(uploadId);
upResource.setFileName("");// Avoid NPE in UploadHandler
uploadResources.put(upResource.getUploadId(), upResource);
-
+
putToStackInSession(request.getSession(true), uploadId);
double contentLength = request.getContentLength();
15 years, 5 months
gatein SVN: r5049 - epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-11 23:21:12 -0500 (Thu, 11 Nov 2010)
New Revision: 5049
Modified:
epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml
Log:
JBEPP-627: Separated supported database table into 5.0 and 5.1. Added entries for 5.1
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-12 02:47:21 UTC (rev 5048)
+++ epp/docs/branches/EPP_5_1_Branch/Installation_Guide/en-US/Getting_Started.xml 2010-11-12 04:21:12 UTC (rev 5049)
@@ -210,7 +210,10 @@
</table>
<para>
- The following is a list of supported databases and JDBC drivers:
+ The following is a <emphasis role="bold">cumulative</emphasis> list of supported databases and JDBC drivers.
+ </para>
+ <para>
+ Entries shown for each release are supported in <emphasis>addition</emphasis> to those in previous releases:
</para>
<indexterm>
<primary>System Requirements</primary>
@@ -220,14 +223,12 @@
<primary>Database</primary>
<secondary>System Requirements</secondary>
</indexterm>
- <table>
- <title>
- Supported and Certified Database / JDBC driver Combinations.
- </title>
-
+ <table>
+ <title>Supported Database and JDBC driver Combinations</title>
<tgroup cols="2">
- <colspec colnum="1" colname="DB" colwidth="1*"></colspec>
- <colspec colnum="2" colname="DB_driver" colwidth="1*"></colspec>
+ <colspec colnum="1" colname="c1" colwidth="1*"></colspec>
+ <colspec colnum="2" colname="c2" colwidth="1*"></colspec>
+ <spanspec spanname="hspan" namest="c1" nameend="c2" align="left"></spanspec>
<thead>
<row>
<entry>
@@ -239,6 +240,11 @@
</row>
</thead>
<tbody>
+ <row>
+ <entry spanname="hspan">
+ <emphasis><emphasis role="bold">&PRODUCT; 5.0</emphasis></emphasis>
+ </entry>
+ </row>
<row>
<entry>
MySQL 5.1
@@ -319,9 +325,31 @@
JConnect v6.0.5 (Build 26564 / 11 Jun 2009)
</entry>
</row>
+ <row>
+ <entry spanname="hspan">
+ <emphasis><emphasis role="bold">&PRODUCT; 5.1</emphasis></emphasis>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Oracle 11g R2
+ </entry>
+ <entry>
+ 11g R2 (DOC NOTE: NEED VERSION NUMBER)
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Oracle 11g R2 RAC
+ </entry>
+ <entry>
+ 11g R2 RAC (DOC NOTE: NEED VERSION NUMBER)
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
+
<indexterm>
<primary>System Requirements</primary>
<secondary>Directory server</secondary>
15 years, 5 months
gatein SVN: r5048 - in epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US: extras/Advanced_Development_JCR_jdbc-data-container-config and 5 other directories.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-11 21:47:21 -0500 (Thu, 11 Nov 2010)
New Revision: 5048
Removed:
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/Advanced_Development_JCR_jdbc-data-container-config/default38.xml
Modified:
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Book_Info.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Reference_Guide.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Revision_History.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/cluster-config.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration-persister.xml
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/external-value-storages.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/intro.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/AuthenticationAndIdentity/SSO.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/InternationalizationConfiguration.xml
epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml
Log:
JBEPP-517: Incorporated EPP Docs Review feedback/action items
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Book_Info.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Book_Info.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -9,7 +9,7 @@
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5</productnumber>
<edition>1</edition>
- <pubsnumber>1.14</pubsnumber>
+ <pubsnumber>1.15</pubsnumber>
<abstract>
<para>
This Reference Guide is a high-level usage document. It deals with more advanced topics than the Installation and User Guides, adding new content or taking concepts discussed in the earlier documents further. It aims to provide supporting documentation for advanced users of the &PRODUCT; product. Its primary focus is on advanced use of the product and it assumes an intermediate or advanced knowledge of the technology and terms.
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Reference_Guide.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Reference_Guide.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Reference_Guide.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -9,7 +9,7 @@
<xi:include href="modules/Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/PortalDevelopment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/PortletDevelopment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="modules/GadgetDevelopment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!--<xi:include href="modules/GadgetDevelopment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
<xi:include href="modules/AuthenticationAndIdentity.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/WSRP.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="modules/Advanced.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Revision_History.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/Revision_History.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -6,7 +6,23 @@
<appendix id="appe-Reference_Guide-Revision_History">
<title>Revision History</title>
<simpara>
- <revhistory>
+ <revhistory>
+ <revision>
+ <revnumber>1-1.15</revnumber>
+ <date>Thu Nov 11 2010</date>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Mumford</surname>
+ <email>smumford(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Incorporated further feedback from GLS.</member>
+ <member>Added first cut of WSRP 2.0 content.</member>
+ <member>Highlighted JCR sections for possible removal.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
<revision>
<revnumber>1-1.14</revnumber>
<date>Tue Nov 02 2010</date>
Deleted: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/Advanced_Development_JCR_jdbc-data-container-config/default38.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/Advanced_Development_JCR_jdbc-data-container-config/default38.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/extras/Advanced_Development_JCR_jdbc-data-container-config/default38.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -1,69 +0,0 @@
-<component>
- <key>org.exoplatform.services.naming.InitialContextInitializer</key>
- <type>org.exoplatform.services.naming.InitialContextInitializer</type>
- <component-plugins>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/portal"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="url" value="jdbc:mysql://exoua.dnsalias.net/jcr"/>
- <property name="username" value="exoadmin"/>
- <property name="password" value="exo12321"/>
- <property name="maxActive" value="50"/>
- <property name="maxIdle" value="5"/>
- <property name="initialSize" value="5"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugins>
- <init-params>
- <value-param>
- <name>default-context-factory</name>
- <value>org.exoplatform.services.naming.SimpleContextFactory</value>
- </value-param>
- </init-params>
- </component>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/cluster-config.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/cluster-config.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/cluster-config.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -3,10 +3,9 @@
<!ENTITY % BOOK_ENTITIES SYSTEM "Reference_Guide.ent">
%BOOK_ENTITIES;
]>
-<!--This file has been commented out. See ../JCR.xml -->
<section id="sect-Reference_Guide-Configuring_JBoss_AS_with_eXo_JCR_in_cluster">
- <title>Clustering with JBoss Application Server</title>
+ <title>Clustering with JBoss Application Server - REMOVABLE?</title>
<formalpara id="form-Reference_Guide-Configuring_JBoss_AS_with_eXo_JCR_in_cluster-Deploying_eXo_JCR_to_JBoss_As">
<title>Deploying eXo JCR in JBoss Application Server</title>
<para>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration-persister.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration-persister.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration-persister.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -3,10 +3,9 @@
<!ENTITY % BOOK_ENTITIES SYSTEM "Reference_Guide.ent">
%BOOK_ENTITIES;
]>
-<!--This file has been commented out. See ../JCR.xml -->
<section id="sect-Reference_Guide-The_JCR_Configuration_persister">
- <title>The JCR Configuration persister</title>
+ <title>The JCR Configuration persister - REMOVABLE?</title>
<para>
The JCR Repository Service uses the <classname>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</classname> component to read its configuration.
</para>
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-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/configuration.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -3,7 +3,6 @@
<!ENTITY % BOOK_ENTITIES SYSTEM "../../../Reference_Guide.ent">
%BOOK_ENTITIES;
]>
-<!--This file has been commented out. See ../JCR.xml -->
<section id="sect-Reference_Guide-JCR_configuration">
<title>JCR configuration</title>
@@ -15,7 +14,9 @@
<para>
To modify the configuration of the JCR Service, you would need to modify the file found at <filename>/<replaceable>JBOSS_AS</replaceable>/server/<replaceable>PROFILE</replaceable>/deploy/gatein.ear/02portal.war/WEB-INF/conf/jcr/repository-configuration.xml</filename>.
- <programlisting><![CDATA[
+ </para>
+
+<programlisting><![CDATA[
<repository-service default-repository="repository">
<repositories>
<repository name="repository" system-workspace="system" default-workspace="portal-system">
@@ -30,9 +31,7 @@
</repository>
</repositories>
</repository-service>]]>
-
- </programlisting>
- </para>
+</programlisting>
<procedure>
<step>
<para>
@@ -43,33 +42,35 @@
<literal>system</literal>
</para>
</listitem>
- <listitem>
- <para>
- <literal>portal-system</literal>: To store portal metadata such as page compositions
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>portal-work</literal>: To store elements that are temporary such as tokens
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>wsrp-system</literal>: To store WSRP related data
- </para>
- </listitem>
- <listitem>
- <para>
- <literal>wsrp-system</literal>: To store Portlet Container related data (such as portlet preferences
- </para>
- </listitem>
+ <listitem>
+ <para>
+ <literal>portal-system</literal>: To store portal metadata such as page compositions
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>portal-work</literal>: To store elements that are temporary such as tokens
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>wsrp-system</literal>: To store WSRP related data
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>wsrp-system</literal>: To store Portlet Container related data (such as portlet preferences
+ </para>
+ </listitem>
</itemizedlist>
</para>
</step>
- <step>
- <para>Locate the workspace to modify.
- <step>
+ <step>
+ <para>
+ Locate the workspace to modify.
+ </para>
+ </step>
<step>
<para>
The repository configuration supports human-readable values. They are not case-sensitive.
@@ -220,7 +221,7 @@
</programlistingco>
</section>
-
+<!--
<section id="sect-Reference_Guide-JCR_configuration-Related_documents">
<title>Related Sections</title>
<itemizedlist>
@@ -241,5 +242,5 @@
</listitem>
</itemizedlist>
</section>
-
+-->
</section>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/external-value-storages.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/external-value-storages.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/external-value-storages.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -3,7 +3,6 @@
<!ENTITY % BOOK_ENTITIES SYSTEM "Reference_Guide.ent">
%BOOK_ENTITIES;
]>
-<!--This file has been commented out. See ../JCR.xml -->
<section id="sect-Reference_Guide-External_Value_Storages">
<title>External Value Storages</title>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/intro.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/intro.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/intro.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -8,7 +8,10 @@
<warning>
<title>eXo JCR usage</title>
<para>
- The JBoss Enterprise Portal Platform is using a JCR API to store its information for internal usage. We do not support usage of the JCR to store application infornation. The information below only exists if one need to understand particular low level details on how the JBoss Enterprise Portal Platform works and how it can be fine-tuned.
+ The JBoss Enterprise Portal Platform is using a JCR API to store its information for internal usage. We do not support usage of the JCR to store application information.
+ </para>
+ <para>
+ The information below is intended to assist users to understand particular low level details on how the JBoss Enterprise Portal Platform works and how it can be fine-tuned.
</para>
</warning>
<para>
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-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -231,8 +231,8 @@
<para>
For example, in <application>mysql</application> it is necessary to add a parameter for the JDBC driver to the JDBC URL protocol. For instance: <code>jdbc:mysql://exoua.dnsalias.net/portal?characterEncoding=utf8</code>
</para>
- <para>
- There are pre-configured configuration files for HSQLDB. These files are stored in the <filename>/conf/portal</filename> and <filename>/conf/standalone</filename> folders of the <filename>exo.jcr.component.core-XXX.XXX.jar</filename> jar-file or source-distribution of the eXo JCR implementation.
+ <para>
+ While HSQL is not supported in production, there are pre-configured configuration files stored in the <filename>/conf/portal</filename> and <filename>/conf/standalone</filename> folders of the <filename>exo.jcr.component.core-XXX.XXX.jar</filename> jar-file or source-distribution of the eXo JCR implementation. <emphasis role="bold">These files are included primarily for development and/or familiarization purposes.</emphasis>
</para>
<para>
The configuration files are located in service jars <filename>/conf/portal/configuration.xml</filename> (eXo services including JCR Repository Service) and <filename>exo-jcr-config.xml</filename> (repositories configuration) by default.
@@ -327,11 +327,7 @@
<para>
It is the JNDI context initializer which registers (binds) naming resources (DataSources) for data containers.
</para>
- <!-- DOC NOTE: The below section has been commented as it refers to an example of repositories configured in standalone mode
-<para>
-The following example is in standalone mode with two data containers <parameter>jdbcjcr</parameter> (a local HSQLDB) and <parameter>jdbcjcr1</parameter> (a remote MySQL container):
-</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="../../../extras/Advanced_Development_JCR_jdbc-data-container-config/default38.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting> -->
+
</step>
<step>
<para>
@@ -339,7 +335,7 @@
</para>
<variablelist>
<varlistentry>
- <term>driverClassName</term>
+ <term><emphasis role="bold">driverClassName</emphasis></term>
<listitem>
<para>
Some examples are "<literal>org.hsqldb.jdbcDriver</literal>", "<literal>com.mysql.jdbc.Driver</literal>" and "<literal>org.postgresql.Driver</literal>"
@@ -347,7 +343,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>URL</term>
+ <term><emphasis role="bold">URL</emphasis></term>
<listitem>
<para>
For example: "<literal>jdbc:hsqldb:file:target/temp/data/portal", "jdbc:mysql://exoua.dnsalias.net/jcr</literal>"
@@ -355,7 +351,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>username</term>
+ <term><emphasis role="bold">username</emphasis></term>
<listitem>
<para>
Examples are "<literal>sa</literal>", "<literal>exoadmin</literal>"
@@ -363,7 +359,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>password</term>
+ <term><emphasis role="bold">password</emphasis></term>
<listitem>
<para>
Enter a password.
@@ -378,7 +374,7 @@
</para>
<variablelist>
<varlistentry>
- <term>maxActive</term>
+ <term><emphasis role="bold">maxActive</emphasis></term>
<listitem>
<para>
Enter a maximum period of active time. For example; 50.
@@ -386,7 +382,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>maxIdle</term>
+ <term><emphasis role="bold">maxIdle</emphasis></term>
<listitem>
<para>
Enter a period of idle time.
@@ -394,7 +390,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>initialSize</term>
+ <term><emphasis role="bold">initialSize</emphasis></term>
<listitem>
<para>
Define an initial size. For example; 5.
@@ -420,7 +416,7 @@
<programlisting language="XML" role="XML"><xi:include href="../../../extras/Advanced_Development_JCR_jdbc-data-container-config/default39.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
<variablelist>
<varlistentry>
- <term>source-name</term>
+ <term><emphasis role="bold">source-name</emphasis></term>
<listitem>
<para>
A <literal>javax.sql.DataSource</literal> name configured in the <literal>InitialContextInitializer</literal> component. This was known as <parameter>sourceName</parameter> in JCR versions earlier than 1.9.
@@ -428,7 +424,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>dialect</term>
+ <term><emphasis role="bold">dialect</emphasis></term>
<listitem>
<para>
A database dialect.
@@ -496,7 +492,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>multi-db</term>
+ <term><emphasis role="bold">multi-db</emphasis></term>
<listitem>
<para>
This parameter enables multi-database containers when set to "true".
@@ -504,7 +500,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>max-buffer-size</term>
+ <term><emphasis role="bold">max-buffer-size</emphasis></term>
<listitem>
<para>
A threshold (in bytes) after which a <literal>javax.jcr.Value</literal> content will be swapped to a file in a temporary storage. That is, swap for pending changes.
@@ -512,7 +508,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term>swap-directory</term>
+ <term><emphasis role="bold">swap-directory</emphasis></term>
<listitem>
<para>
A path in the file system used to swap the pending changes.
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -10,14 +10,15 @@
<!--
<xi:include href="JCR/jdbc-data-container-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-->
- <xi:include href="JCR/external-value-storages.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--Section removed as JCR requirements already configured in EPP-->
+ <xi:include href="JCR/external-value-storages.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/search-configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/multilanguage-support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!--<xi:include href="JCR/configuration-persister.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
- <!--Section removed as JCR requirements already configured in EPP-->
- <!--<xi:include href="JCR/cluster-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />-->
- <!--Section removed as JCR requirements already configured in EPP-->
+ <!--
+ <xi:include href="JCR/configuration-persister.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
+ <!--
+ <xi:include href="JCR/cluster-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
<xi:include href="JCR/jbosscache-configuration-templates.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/lock-manager-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/query-handler-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -723,7 +723,7 @@
<section id="sect-Reference_Guide-SSO_Single_Sign_On-SPNEGO_Simple_and_Protected_GSSAPI_Negotiation_Mechanism">
- <title>SPNEGO - Simple and Protected GSSAPI Negotiation Mechanism</title>
+ <title>SPNEGO - Simple and Protected GSSAPI Negotiation Mechanism - Please Review</title>
<para>
The Simple and Protected GSSAPI Negotiation Mechanism (<emphasis role="bold">SPNEGO</emphasis>) uses desktop credentials provided during a desktop login to transparently authenticate a portal user through a web browser.
</para>
@@ -785,11 +785,6 @@
</step>
<step>
<para>
- Add the JBoss Negotiation binary by copying <filename><replaceable>PORTAL_SSO</replaceable>/spnego/jboss-negotiation-2.0.3.GA.jar</filename> to <filename>jboss-as/server/<replaceable>PROFILE</replaceable>/lib</filename>.
- </para>
- </step>
- <step>
- <para>
Add the Gatein SSO module binaries by adding <filename><replaceable>PORTAL_SSO</replaceable>/spnego/gatein.ear/lib/sso-agent.jar</filename> and <filename><replaceable>PORTAL_SSO</replaceable>/spnego/gatein.ear/lib/spnego-<replaceable>VERSION</replaceable>-epp-GA.jar</filename> to <filename>deploy/gatein.ear/lib</filename>.
</para>
</step>
Modified: epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/InternationalizationConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-11-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/PortalDevelopment/InternationalizationConfiguration.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -47,7 +47,7 @@
It is also possible to use a proprietary XML format to define translations. This is a more convenient way to translate a document for some languages such as Japanese, Arabic or Russian.
</para>
<para>
- Property files have te be ASCII encoded, while the XML file can define its encoding. As a result it's easier for a human being to read a translation in XML instead of having to decode and encode the property file.
+ Property files have to be ISO 8859-1 encoded, while the XML file can define its encoding. As a result it's easier for a human being to read a translation in XML instead of having to decode and encode the property file.
</para>
<para>
For more information refer to: <xref linkend="chap-Reference_Guide-XML_Resources_Bundles" />
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-12 02:40:21 UTC (rev 5047)
+++ epp/docs/branches/EPP_5_1_Branch/Reference_Guide/en-US/modules/WSRP.xml 2010-11-12 02:47:21 UTC (rev 5048)
@@ -4,7 +4,7 @@
%BOOK_ENTITIES;
]>
<chapter id="chap-Reference_Guide-Web_Services_for_Remote_Portlets_WSRP">
- <title>Web Services for Remote Portlets (WSRP)</title>
+ <title>Web Services for Remote Portlets (WSRP) - Please Review</title>
<section id="sect-Reference_Guide-Web_Services_for_Remote_Portlets_WSRP-Introduction">
<title>Introduction</title>
<para>
@@ -56,13 +56,8 @@
&PRODUCT; 5.0 provides a complete implementation of WSRP 1.0 while &PRODUCT; 5.1 includes an implementation of WSRP 2.0.
</para>
<para>
- All optional features in WSRP 2 are implemented except support for lifetimes and leasing support.
+ All optional features in WSRP 2 are implemented in &PRODUCT; 5.1 except support for lifetimes and leasing support.
</para>
- <note>
- <para>
- As of version &VERSION; of &PRODUCT;, WSRP is only activated and supported when &PRODUCT; is deployed on JBoss Application Server.
- </para>
- </note>
<para>
Users should familiarize themselves with the appropriate sections of this chapter based on their version of &PRODUCT;.
</para>
@@ -72,28 +67,50 @@
<section id="sect-Reference_Guide-Web_Services_for_Remote_Portlets_WSRP-Deploying_WSRP">
<title>Deploying WSRP</title>
<note>
- <title>Assumptions</title>
+ <title>Notational Devices</title>
<para>
- The following list of support files assumes:
+ The following list of support files uses the following notational devices:
</para>
- <orderedlist>
- <listitem>
- <para>
- That the directory &PRODUCT; has been installed into will be referred to as <replaceable>PORTAL_HOME</replaceable>.
- </para>
- </listitem>
- <listitem>
- <para>
- That <replaceable>WSRP_VERSION</replaceable> is the version of the WSRP component in use.
- </para>
- </listitem>
- <listitem>
- <para>
- That <replaceable>PORTAL_VERSION</replaceable> is the version of &PRODUCT; in use.
- </para>
- </listitem>
- </orderedlist>
+ <variablelist>
+ <title></title>
+ <varlistentry>
+ <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>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><replaceable>WSRP_PATH</replaceable></term>
+ <listitem>
+ <para>
+ The WSRP files referred to in this section are found in the <filename><replaceable>EPP_HOME</replaceable>/jboss-as/server/$CONFIG/deploy/gatein.ear</filename> directory.
+ </para>
+ <para>
+ For ease of reference this path will be represented by: <replaceable>WSRP_PATH</replaceable>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><replaceable>WSRP_VERSION</replaceable></term>
+ <listitem>
+ <para>
+ <replaceable>WSRP_VERSION</replaceable> represents the version of the WSRP component in use.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><replaceable>PORTAL_VERSION</replaceable></term>
+ <listitem>
+ <para>
+ <replaceable>PORTAL_VERSION</replaceable> represents the version of &PRODUCT; in use.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</note>
+
<variablelist id="vari-Reference_Guide-Deploying_WSRP-WSRP_support_files">
<title>WSRP support files</title>
<varlistentry>
@@ -250,12 +267,6 @@
<section id="sect-Reference_Guide-Web_Services_for_Remote_Portlets_WSRP-Consuming_WSRP_portlets_from_a_remote_Consumer">
<title>Consuming WSRP portlets from a remote Consumer</title>
- <important>
- <title><emphasis role="bold">DOC NOTE</emphasis></title>
- <para>
- Is this section relevant? Do we want users consuming portlets produced by EPP elsewhere?
- </para>
- </important>
<para>
Configuration is extremely variable between different WSRP Consumers. Most, however, require a specification of the URL for the Producer's WSDL definition. If the &PRODUCT; Consumer is not being used, refer to the documentation for the Consumer that is in use for specific instructions.
</para>
@@ -310,10 +321,30 @@
<section id="sect-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet">
<title>The Configuration Portlet</title>
<para>
- &PRODUCT; provides a portlet to configure access (among other functions) to remote WSRP Producers grahically.
+ &PRODUCT; provides a graphical portlet to assist with configuring access to, and other facets of, remote WSRP Producers.
</para>
- <formalpara>
- <title><emphasis role="bold">&PRODUCT; 5.0: Installing the Configuration Portlet</emphasis></title>
+<!--DOC NOTE: Branching issue -->
+ <important>
+ <title>Version-specific Information:</title>
+ <para>
+ <emphasis role="bold">The implementation of this portlet has changed between the &PRODUCT; 5.0 and &PRODUCT; 5.1 releases:</emphasis>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">&PRODUCT; version 5.0</emphasis> users should read <xref linkend="form-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet-5.0_Installing"/> for instructions on how to install the configuration portlet.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">&PRODUCT; version 5.1</emphasis> users should read <xref linkend="form-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet-5.1_Accessing"/> for how to access the pre-installed configuration portlet.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </important>
+
+ <formalpara id="form-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet-5.0_Installing" >
+ <title><emphasis role="bold">EPP 5.0: Installing the Configuration Portlet</emphasis></title>
<para>
This portlet is not installed by default in &PRODUCT; 5.0. It must be installed using the Application Registry.
</para>
@@ -339,8 +370,8 @@
</para>
</step>
</procedure>
- <formalpara>
- <title><emphasis role="bold">&PRODUCT; 5.1: Accessing the Configuration Portlet</emphasis></title>
+ <formalpara id="form-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet-5.1_Accessing">
+ <title><emphasis role="bold">EPP 5.1: Accessing the Configuration Portlet</emphasis></title>
<para>
The Configuration Portlet is installed by default in &PRODUCT; 5.1. It is available at: <ulink type="http" url="http://localhost:8080/portal/login?initialURI=%2Fportal%2Fprivate%2Fclass..."></ulink>
</para>
@@ -465,7 +496,7 @@
<imagedata align="center" contentwidth="140mm" fileref="images/WSRP/config_end.png" format="PNG" />
</imageobject>
</mediaobject>
- </section> <!-- Close Section: <number><title> -->
+ </section>
</section>
@@ -541,7 +572,7 @@
The information defined at the XML level is only processed for producer definition for which no information is already present in the JCR.
</para>
<para>
- Therefore, to delete a Producer configuration, the associated information in the database must be deleted (this can be accomplished using the configuration portlet as shown in <xref linkend="sect-Reference_Guide-Configuring_a_Remote_Producer-Using_the_Configuration_Portlet" />).
+ Therefore, to delete a Producer configuration, the associated information in the database must be deleted (this can be accomplished using the configuration portlet as shown in <xref linkend="sect-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet" />).
</para>
<para>
The associated information in <filename>wsrp-consumers-config.xml</filename> (if such information exists) must also be removed, otherwise the producer will be re-created the next time the WSRP is launched.
@@ -664,7 +695,7 @@
Therefore at times it may be necessary to modify the registration that sets the service agreement between a consumer and a producer.
</para>
<para>
- For example; the producer requiring an email that was configured in <xref linkend="sect-Reference_Guide-Configuring_a_Remote_Producer-Using_the_Configuration_Portlet" />. In that case the producer was requiring registration and required a value to be provided for the <literal>email</literal> property.
+ For example; the producer requiring an email that was configured in <xref linkend="sect-Reference_Guide-Configuring_a_Remote_Producer-The_Configuration_Portlet" />. In that case the producer was requiring registration and required a value to be provided for the <literal>email</literal> property.
</para>
<para>
To update the email address that was provided, the remote producer must be informed that some registration data has been modified.
15 years, 5 months
gatein SVN: r5047 - in epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules: Advanced/JCR and 1 other directories.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-11-11 21:40:21 -0500 (Thu, 11 Nov 2010)
New Revision: 5047
Modified:
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml
Log:
Porting updates from 5.1 branch docs, just in case
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml 2010-11-11 18:25:34 UTC (rev 5046)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR/jdbc-data-container-config.xml 2010-11-12 02:40:21 UTC (rev 5047)
@@ -232,7 +232,7 @@
For example, in <application>mysql</application> it is necessary to add a parameter for the JDBC driver to the JDBC URL protocol. For instance: <code>jdbc:mysql://exoua.dnsalias.net/portal?characterEncoding=utf8</code>
</para>
<para>
- There are pre-configured configuration files for HSQLDB. These files are stored in the <filename>/conf/portal</filename> and <filename>/conf/standalone</filename> folders of the <filename>exo.jcr.component.core-XXX.XXX.jar</filename> jar-file or source-distribution of the eXo JCR implementation.
+ While HSQL is not supported in production, there are pre-configured configuration files stored in the <filename>/conf/portal</filename> and <filename>/conf/standalone</filename> folders of the <filename>exo.jcr.component.core-XXX.XXX.jar</filename> jar-file or source-distribution of the eXo JCR implementation. <emphasis role="bold">These files are included primarily for development and/or familiarization purposes.</emphasis>
</para>
<para>
The configuration files are located in service jars <filename>/conf/portal/configuration.xml</filename> (eXo services including JCR Repository Service) and <filename>exo-jcr-config.xml</filename> (repositories configuration) by default.
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml 2010-11-11 18:25:34 UTC (rev 5046)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/Advanced/JCR.xml 2010-11-12 02:40:21 UTC (rev 5047)
@@ -6,17 +6,26 @@
<chapter id="chap-Reference_Guide-eXo_JCR">
<title>eXo JCR</title>
<xi:include href="JCR/intro.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="JCR/configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="JCR/configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!--
<xi:include href="JCR/jdbc-data-container-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="JCR/external-value-storages.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
+ <xi:include href="JCR/external-value-storages.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/search-configuration.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/multilanguage-support.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="JCR/configuration-persister.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!-- cluster configs --><xi:include href="JCR/cluster-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!--
+ <xi:include href="JCR/configuration-persister.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
+ <!--
+ <xi:include href="JCR/cluster-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
<xi:include href="JCR/jbosscache-configuration-templates.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/lock-manager-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/query-handler-config.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="JCR/jbossts-transaction-service.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <!--
<xi:include href="JCR/transaction-manager-lookup.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <!-- statistics configs --><xi:include href="JCR/statistics.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ -->
+ <!--
+ <xi:include href="JCR/statistics.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2010-11-11 18:25:34 UTC (rev 5046)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/SSO.xml 2010-11-12 02:40:21 UTC (rev 5047)
@@ -785,11 +785,6 @@
</step>
<step>
<para>
- Add the JBoss Negotiation binary by copying <filename><replaceable>PORTAL_SSO</replaceable>/spnego/jboss-negotiation-2.0.3.GA.jar</filename> to <filename>jboss-as/server/<replaceable>PROFILE</replaceable>/lib</filename>.
- </para>
- </step>
- <step>
- <para>
Add the Gatein SSO module binaries by adding <filename><replaceable>PORTAL_SSO</replaceable>/spnego/gatein.ear/lib/sso-agent.jar</filename> and <filename><replaceable>PORTAL_SSO</replaceable>/spnego/gatein.ear/lib/spnego-<replaceable>VERSION</replaceable>-epp-GA.jar</filename> to <filename>deploy/gatein.ear/lib</filename>.
</para>
</step>
15 years, 5 months
gatein SVN: r5046 - in epp/portal/branches/EPP_5_1_Branch: component/wsrp and 17 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-11 13:25:34 -0500 (Thu, 11 Nov 2010)
New Revision: 5046
Added:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Removed:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Modified:
epp/portal/branches/EPP_5_1_Branch/.classpath
epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
epp/portal/branches/EPP_5_1_Branch/pom.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
epp/portal/branches/EPP_5_1_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
Log:
JBEPP-613: Update WSRP
Modified: epp/portal/branches/EPP_5_1_Branch/.classpath
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/.classpath 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/.classpath 2010-11-11 18:25:34 UTC (rev 5046)
@@ -83,6 +83,7 @@
<classpathentry excluding="**" kind="src" output="examples/portlets/struts-jpetstore/target/classes" path="examples/portlets/struts-jpetstore/src/main/resources"/>
<classpathentry kind="src" output="examples/portlets/struts-jpetstore/target/test-classes" path="examples/portlets/struts-jpetstore/src/test/java"/>
<classpathentry excluding="**" kind="src" output="examples/portlets/struts-jpetstore/target/test-classes" path="examples/portlets/struts-jpetstore/src/test/resources"/>
+ <classpathentry kind="src" output="starter/war/target/classes" path="starter/war/src/main/java"/>
<classpathentry kind="src" output="testsuite/selenium-snifftests/target/classes" path="testsuite/selenium-snifftests/src/main/java"/>
<classpathentry kind="src" output="testsuite/webuibasedsamples/target/classes" path="testsuite/webuibasedsamples/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -103,6 +103,10 @@
<groupId>org.chromattic</groupId>
<artifactId>chromattic.spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wci</groupId>
+ <artifactId>wci-wci</artifactId>
+ </dependency>
<!-- Required to process Chromattic annotations -->
<dependency>
@@ -118,8 +122,10 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.gatein.wci</groupId>
- <artifactId>wci-wci</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
</dependency>
</dependencies>
Deleted: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,214 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.data.PageKey;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-import org.gatein.common.util.ParameterValidation;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Page;
-import org.gatein.mop.api.workspace.Site;
-import org.gatein.mop.api.workspace.Workspace;
-import org.gatein.mop.api.workspace.ui.UIComponent;
-import org.gatein.mop.api.workspace.ui.UIContainer;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-import org.gatein.pc.api.PortletContext;
-import org.gatein.pc.api.PortletStateType;
-import org.gatein.pc.api.StatefulPortletContext;
-import org.gatein.wsrp.api.context.ConsumerStructureProvider;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class MOPConsumerStructureProvider implements ConsumerStructureProvider
-{
- private final POMSessionManager pomManager;
- private Map<String, PageInfo> pageInfos;
- private Map<String, String> windowIdToUUIDs;
-
- public MOPConsumerStructureProvider(ExoContainer container)
- {
- pomManager = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- windowIdToUUIDs = new HashMap<String, String>();
- }
-
- public List<String> getPageIdentifiers()
- {
- if (pageInfos == null)
- {
- POMSession session = pomManager.getSession();
- Workspace workspace = session.getWorkspace();
- Collection<Site> sites = workspace.getSites(ObjectType.PORTAL_SITE);
-
- pageInfos = new HashMap<String, PageInfo>();
- for (Site site : sites)
- {
- Page page = site.getRootPage().getChild("pages");
- if (page != null)
- {
- processPage(page, true);
- }
- }
- }
-
- LinkedList<String> identifiers = new LinkedList<String>(pageInfos.keySet());
- Collections.sort(identifiers);
- return identifiers;
- }
-
- private void processPage(Page page, boolean ignoreCurrent)
- {
- if (!ignoreCurrent)
- {
- Described described = page.adapt(Described.class);
- PageInfo pageInfo = new PageInfo(page.getObjectId());
- pageInfos.put(described.getName(), pageInfo);
- UIContainer container = page.getRootComponent();
- processContainer(container, pageInfo);
- }
-
- Collection<Page> children = page.getChildren();
- if (ParameterValidation.existsAndIsNotEmpty(children))
- {
- for (Page child : children)
- {
- processPage(child, false);
- }
- }
- }
-
- public List<String> getWindowIdentifiersFor(String pageId)
- {
- PageInfo pageInfo = pageInfos.get(pageId);
- ParameterValidation.throwIllegalArgExceptionIfNull(pageInfo, "PageInfo for " + pageId);
-
- return pageInfo.getChildrenWindows();
- }
-
- private void processContainer(UIContainer container, PageInfo pageInfo)
- {
- List<UIComponent> components = container.getComponents();
- for (UIComponent component : components)
- {
- ObjectType<? extends UIComponent> type = component.getObjectType();
- if (ObjectType.WINDOW.equals(type))
- {
- Described described = component.adapt(Described.class);
- String name = described.getName();
- windowIdToUUIDs.put(name, component.getObjectId());
- pageInfo.addWindow(name);
- }
- else if (ObjectType.CONTAINER.equals(type))
- {
- processContainer((UIContainer)component, pageInfo);
- }
- else
- {
- // ignore
- }
- }
- }
-
- public void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId)
- {
- String uuid = windowIdToUUIDs.get(windowId);
- ParameterValidation.throwIllegalArgExceptionIfNull(uuid, "UUID for " + windowId);
-
- // get the window
- POMSession session = pomManager.getSession();
- UIWindow window = session.findObjectById(ObjectType.WINDOW, uuid);
-
- // construct the new customization state
- WSRP wsrp = new WSRP();
- String portletId = portletContext.getId();
- wsrp.setPortletId(portletId);
- if (portletContext instanceof StatefulPortletContext)
- {
- StatefulPortletContext context = (StatefulPortletContext)portletContext;
- if (PortletStateType.OPAQUE.equals(context.getType()))
- {
- wsrp.setState((byte[])context.getState());
- }
- else
- {
- throw new IllegalArgumentException("Don't know how to deal with state: " + context.getState());
- }
- }
-
- // destroy existing customization as otherwise re-customizing will fail
- Customization<?> customization = window.getCustomization();
- customization.destroy();
-
- // and re-customize
- window.customize(WSRP.CONTENT_TYPE, portletId, wsrp);
-
- // mark page for cache invalidation otherwise DataCache will use the previous customization id when trying to set
- // the portlet state in UIPortlet.setState and will not find it resulting in an error
- Page page = window.getPage();
- session.scheduleForEviction(new PageKey("portal", page.getSite().getName(), page.getName()));
-
- // save
- session.close(true);
- }
-
- private static class PageInfo
- {
- private String uuid;
- private List<String> childrenWindows;
-
- private PageInfo(String uuid)
- {
- this.uuid = uuid;
- childrenWindows = new LinkedList<String>();
- }
-
- public String getUUID()
- {
- return uuid;
- }
-
- public List<String> getChildrenWindows()
- {
- return childrenWindows;
- }
-
- public void addWindow(String windowName)
- {
- childrenWindows.add(windowName);
- }
- }
-}
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -27,7 +27,9 @@
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.pc.ExoKernelIntegration;
+import org.exoplatform.portal.pom.config.POMSessionManager;
import org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator;
import org.exoplatform.services.listener.ListenerService;
import org.gatein.common.logging.Logger;
@@ -47,6 +49,9 @@
import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
import org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
import org.gatein.portal.wsrp.state.producer.state.JCRPortletStatePersistenceManager;
+import org.gatein.portal.wsrp.structure.MOPConsumerStructureProvider;
+import org.gatein.portal.wsrp.structure.MOPPortalStructureAccess;
+import org.gatein.portal.wsrp.structure.PortalStructureAccess;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
@@ -267,20 +272,28 @@
// add our Session event listener to the ListenerService for use in org.exoplatform.web.GenericHttpListener
ListenerService listenerService = (ListenerService)container.getComponentInstanceOfType(ListenerService.class);
SessionEventListenerAndBroadcaster sessionEventBroadcaster = new SessionEventListenerAndBroadcaster();
- sessionEventBroadcaster.setName("org.exoplatform.web.GenericHttpListener.sessionCreated");
- listenerService.addListener(sessionEventBroadcaster);
- sessionEventBroadcaster.setName("org.exoplatform.web.GenericHttpListener.sessionDestroyed");
- listenerService.addListener(sessionEventBroadcaster);
+ // events from org.exoplatform.web.GenericHttpListener
+ listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionCreated", sessionEventBroadcaster);
+ listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionDestroyed", sessionEventBroadcaster);
+
try
{
consumerRegistry = new JCRConsumerRegistry(container);
consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
+ // create ConsumerStructureProvider and register it to listen to page events
+ POMSessionManager sessionManager = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ PortalStructureAccess structureAccess = new MOPPortalStructureAccess(sessionManager);
+ MOPConsumerStructureProvider structureprovider = new MOPConsumerStructureProvider(structureAccess);
+ listenerService.addListener(DataStorage.PAGE_CREATED, structureprovider);
+ listenerService.addListener(DataStorage.PAGE_REMOVED, structureprovider);
+ listenerService.addListener(DataStorage.PAGE_UPDATED, structureprovider);
+
// migration service
MigrationService migrationService = new JCRMigrationService(container);
- migrationService.setStructureProvider(new MOPConsumerStructureProvider(container));
+ migrationService.setStructureProvider(structureprovider);
consumerRegistry.setMigrationService(migrationService);
consumerRegistry.start();
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,28 +1,28 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.portal.wsrp.state;
-import EDU.oswego.cs.dl.util.concurrent.FJTask;
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticBuilder;
import org.chromattic.api.ChromatticSession;
@@ -59,6 +59,8 @@
private String workspaceName;
private Map<Class, Class<? extends BaseMapping>> modelToMapping;
+ private ThreadLocal<ChromatticSession> sessionHolder = new ThreadLocal<ChromatticSession>();
+
public JCRPersister(ExoContainer container, String workspaceName)
{
this.workspaceName = workspaceName;
@@ -87,7 +89,7 @@
if (BaseMapping.class.isAssignableFrom(mappingClass))
{
Type[] interfaces = mappingClass.getGenericInterfaces();
- if(ParameterValidation.existsAndIsNotEmpty(interfaces))
+ if (ParameterValidation.existsAndIsNotEmpty(interfaces))
{
Class type = (Class)((ParameterizedType)interfaces[0]).getActualTypeArguments()[0];
modelToMapping.put(type, mappingClass);
@@ -101,28 +103,41 @@
public ChromatticSession getSession()
{
- return chrome.openSession();
+ if (sessionHolder.get() == null)
+ {
+ ChromatticSession session = chrome.openSession();
+ sessionHolder.set(session);
+ return session;
+ }
+ else
+ {
+ return sessionHolder.get();
+ }
}
- public void closeSession(ChromatticSession session, boolean save)
+ public void closeSession(boolean save)
{
+ ChromatticSession session = getSession();
if (save)
{
- session.save();
+ synchronized (this)
+ {
+ session.save();
+ }
}
session.close();
}
- public void save(ChromatticSession session)
+ public synchronized void save()
{
- session.save();
+ getSession().save();
}
public <T> boolean delete(T toDelete, StoresByPathManager<T> manager)
{
Class<? extends Object> modelClass = toDelete.getClass();
Class<? extends BaseMapping> baseMappingClass = modelToMapping.get(modelClass);
- if(baseMappingClass == null)
+ if (baseMappingClass == null)
{
throw new IllegalArgumentException("Cannot find a mapping class for " + modelClass.getName());
}
@@ -134,12 +149,12 @@
if (old != null)
{
session.remove(old);
- closeSession(session, true);
+ closeSession(true);
return true;
}
else
{
- closeSession(session, false);
+ closeSession(false);
return false;
}
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -49,7 +49,7 @@
*/
public class JCRConsumerRegistry extends AbstractConsumerRegistry implements StoresByPathManager<ProducerInfo>
{
-// private NewJCRPersister persister;
+ // private NewJCRPersister persister;
private JCRPersister persister;
private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
@@ -78,12 +78,12 @@
info.setKey(key);
pim.initFrom(info);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); // todo: fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
}
@@ -113,7 +113,7 @@
String newId = producerInfo.getId();
pim.initFrom(producerInfo);
- persister.closeSession(session, true);
+ persister.closeSession(true);
// if the consumer's id has changed, return the old one so that state can be updated
return (oldId.equals(newId)) ? null : oldId;
@@ -127,7 +127,7 @@
List<ProducerInfoMapping> mappings = producerInfosMapping.getProducerInfos();
- persister.closeSession(session, true);
+ persister.closeSession(true);
return new MappingToProducerInfoIterator(mappings.iterator());
}
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -85,7 +85,7 @@
exportInfos.add(eim.toModel(null));
}
- persister.closeSession(session, false);
+ persister.closeSession(false);
exportInfosCount = exportInfos.size();
@@ -95,7 +95,7 @@
private ExportInfosMapping getExportInfosMapping(ChromatticSession session)
{
ExportInfosMapping exportInfosMapping = session.findByPath(ExportInfosMapping.class, ExportInfosMapping.NODE_NAME);
- if(exportInfosMapping == null)
+ if (exportInfosMapping == null)
{
exportInfosMapping = session.insert(ExportInfosMapping.class, ExportInfosMapping.NODE_NAME);
exportInfosCount = 0;
@@ -110,7 +110,7 @@
ExportInfoMapping eim = session.findByPath(ExportInfoMapping.class, getPathFor(exportTime));
- if(eim != null)
+ if (eim != null)
{
return eim.toModel(null);
}
@@ -126,7 +126,7 @@
ExportInfoMapping eim = session.findByPath(ExportInfoMapping.class, getChildPath(info));
long exportTime = info.getExportTime();
- if(eim != null)
+ if (eim != null)
{
throw new IllegalArgumentException("An ExportInfo with export time "
+ exportTime + " already exists!");
@@ -139,7 +139,7 @@
session.persist(exportInfosMapping, exportInfo, exportTimeAsString);
exportInfo.initFrom(info);
- persister.closeSession(session, true);
+ persister.closeSession(true);
exportInfosCount++;
}
}
@@ -159,7 +159,7 @@
public boolean isAvailableExportInfosEmpty()
{
- if(exportInfosCount == -1)
+ if (exportInfosCount == -1)
{
ChromatticSession session = persister.getSession();
ExportInfosMapping mappings = getExportInfosMapping(session);
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -47,7 +47,7 @@
private static String PRODUCER_CONFIGURATION_PATH = ProducerConfigurationMapping.NODE_NAME;
private InputStream defaultConfigurationIS;
-// private NewJCRPersister persister;
+ // private NewJCRPersister persister;
private JCRPersister persister;
public JCRProducerConfigurationService(ExoContainer container) throws Exception
@@ -96,7 +96,7 @@
}
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
public void saveConfiguration() throws Exception
@@ -110,6 +110,6 @@
}
pcm.initFrom(configuration);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
}
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.portal.wsrp.state.producer.registrations;
@@ -51,7 +52,7 @@
*/
public class JCRRegistrationPersistenceManager extends RegistrationPersistenceManagerImpl
{
-// private NewJCRPersister persister;
+ // private NewJCRPersister persister;
private JCRPersister persister;
private ConsumersAndGroupsMapping mappings;
@@ -73,7 +74,7 @@
{
mappings = session.insert(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
}
- persister.save(session); // needed right now as the session must still be open to iterate over nodes
+ persister.save(); // needed right now as the session must still be open to iterate over nodes
for (ConsumerGroupMapping cgm : mappings.getConsumerGroups())
{
@@ -92,7 +93,7 @@
}
}
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
@Override
@@ -115,12 +116,12 @@
RegistrationMapping rm = cm.createAndAddRegistrationMappingFrom(null);
registration = newRegistrationSPI(consumer, registrationProperties, rm.getPersistentKey());
rm.initFrom(registration);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); // todo fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
return registration;
@@ -138,7 +139,7 @@
{
ChromatticSession session = persister.getSession();
session.remove(session.findById(clazz, id));
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
@Override
@@ -154,12 +155,12 @@
mappings.getConsumers().add(cm);
cm.initFrom(consumer);
consumer.setPersistentKey(cm.getPersistentKey());
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); // todo: fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
return consumer;
@@ -175,34 +176,34 @@
{
ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
cm.initFrom(consumer);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); // todo: fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
return consumerSPI;
}
-
+
protected RegistrationSPI internalSaveChangesTo(Registration registration)
{
RegistrationSPI registrationSPI = super.internalSaveChangesTo(registration);
-
+
ChromatticSession session = persister.getSession();
try
{
RegistrationMapping cm = session.findById(RegistrationMapping.class, registration.getPersistentKey());
cm.initFrom(registration);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); //todo: fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
-
+
return registrationSPI;
}
@@ -234,12 +235,12 @@
mappings.getConsumerGroups().add(cgm);
group.setPersistentKey(cgm.getPersistentKey());
cgm.initFrom(group);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
catch (Exception e)
{
e.printStackTrace(); // todo: fix me
- persister.closeSession(session, false);
+ persister.closeSession(false);
}
return group;
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/state/JCRPortletStatePersistenceManager.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -83,7 +83,7 @@
PortletStateMapping psm = pscm.getState();
psm.setProperties(propertyMap);
- persister.closeSession(session, true);
+ persister.closeSession(true);
}
@@ -103,7 +103,7 @@
context = pscm.toPortletStateContext();
}
- persister.closeSession(session, false);
+ persister.closeSession(false);
return context;
}
@@ -127,7 +127,7 @@
psm.setPortletID(pscm.getPortletId());
psm.setProperties(propertyMap);
- persister.closeSession(session, true);
+ persister.closeSession(true);
return pscm.getPersistentKey();
}
@@ -150,7 +150,7 @@
result = pscm.toPortletStateContext();
}
- persister.closeSession(session, true);
+ persister.closeSession(true);
return result;
}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure (from rev 4924, portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure)
Deleted: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java 2010-11-03 20:48:19 UTC (rev 4924)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,283 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.structure;
-
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-import org.exoplatform.services.listener.Event;
-import org.exoplatform.services.listener.Listener;
-import org.gatein.common.util.ParameterValidation;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Page;
-import org.gatein.mop.api.workspace.ui.UIComponent;
-import org.gatein.mop.api.workspace.ui.UIContainer;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-import org.gatein.pc.api.PortletContext;
-import org.gatein.pc.api.PortletStateType;
-import org.gatein.pc.api.StatefulPortletContext;
-import org.gatein.wsrp.api.context.ConsumerStructureProvider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class MOPConsumerStructureProvider extends Listener<DataStorage, org.exoplatform.portal.config.model.Page> implements ConsumerStructureProvider
-{
- private final PortalStructureAccess structureAccess;
- private Map<String, PageInfo> pageInfos;
- private boolean pagesHaveBeenInitialized;
-
- public MOPConsumerStructureProvider(PortalStructureAccess structureAccess)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(structureAccess, "PortalStructureAccess");
-
- this.structureAccess = structureAccess;
- pageInfos = new HashMap<String, PageInfo>();
- }
-
- public List<String> getPageIdentifiers()
- {
- if (!pagesHaveBeenInitialized)
- {
- // initialize page information
- Collection<Page> pages = structureAccess.getPages();
- for (Page page : pages)
- {
- addPage(page);
- }
-
- pagesHaveBeenInitialized = true;
- }
-
- LinkedList<String> identifiers = new LinkedList<String>(pageInfos.keySet());
- Collections.sort(identifiers);
- return identifiers;
- }
-
- private void addPage(Page page)
- {
- Described described = page.adapt(Described.class);
- PageInfo pageInfo = new PageInfo(page.getObjectId(), described.getName());
- pageInfos.put(pageInfo.getName(), pageInfo);
- UIContainer container = page.getRootComponent();
- processContainer(container, pageInfo);
-
- Collection<Page> children = page.getChildren();
- if (ParameterValidation.existsAndIsNotEmpty(children))
- {
- for (Page child : children)
- {
- addPage(child);
- }
- }
- }
-
- public List<String> getWindowIdentifiersFor(String pageId)
- {
- PageInfo pageInfo = pageInfos.get(pageId);
- ParameterValidation.throwIllegalArgExceptionIfNull(pageInfo, "PageInfo for " + pageId);
-
- return pageInfo.getChildrenWindows();
- }
-
- private void processContainer(UIContainer container, PageInfo pageInfo)
- {
- if (container != null)
- {
- List<UIComponent> components = container.getComponents();
- for (UIComponent component : components)
- {
- ObjectType<? extends UIComponent> type = component.getObjectType();
- if (ObjectType.WINDOW.equals(type))
- {
- Described described = component.adapt(Described.class);
- String name = described.getName();
-
- pageInfo.addWindow(name, component.getObjectId());
- }
- else if (ObjectType.CONTAINER.equals(type))
- {
- processContainer((UIContainer)component, pageInfo);
- }
- else
- {
- // ignore
- }
- }
- }
- }
-
- public void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId, String exportedPortletHandle)
- {
- PageInfo pageInfo = pageInfos.get(pageId);
- String uuid = pageInfo.getWindowUUID(windowId);
- ParameterValidation.throwIllegalArgExceptionIfNull(uuid, "UUID for " + windowId);
-
- // get the window
- UIWindow window = structureAccess.getWindowFrom(uuid);
-
- // construct the new customization state
- WSRP wsrp = new WSRP();
- String portletId = portletContext.getId();
- wsrp.setPortletId(portletId);
- if (portletContext instanceof StatefulPortletContext)
- {
- StatefulPortletContext context = (StatefulPortletContext)portletContext;
- if (PortletStateType.OPAQUE.equals(context.getType()))
- {
- wsrp.setState((byte[])context.getState());
- }
- else
- {
- throw new IllegalArgumentException("Don't know how to deal with state: " + context.getState());
- }
- }
-
- // destroy existing customization as otherwise re-customizing will fail
- Customization<?> customization = window.getCustomization();
- customization.destroy();
-
- // and re-customize
- window.customize(WSRP.CONTENT_TYPE, portletId, wsrp);
-
- // Change the window's name so that it's less confusing to users
- Described described = window.adapt(Described.class);
- String newName = exportedPortletHandle + " (remote)";
- described.setName(newName); // should be the same as ApplicationRegistryService.REMOTE_DISPLAY_NAME_SUFFIX
-
- // update window mappings
- pageInfo.updateWindowName(windowId, newName);
-
- structureAccess.saveChangesTo(window);
- }
-
- @Override
- public void onEvent(Event<DataStorage, org.exoplatform.portal.config.model.Page> event) throws Exception
- {
- String eventName = event.getEventName();
-
- // get the MOP page from the event data
- org.exoplatform.portal.config.model.Page portalPage = event.getData();
- Page page = structureAccess.getPageFrom(portalPage);
-
- if (page != null)
- {
- if (DataStorage.PAGE_CREATED.equals(eventName))
- {
- // add information for new page
- addPage(page);
- }
- else if (DataStorage.PAGE_REMOVED.equals(eventName))
- {
- removePage(page);
- }
- else if (DataStorage.PAGE_UPDATED.equals(eventName))
- {
- removePage(page);
- addPage(page);
- }
- }
- }
-
- private void removePage(Page page)
- {
- Described described = page.adapt(Described.class);
- String name = described.getName();
-
- PageInfo pageInfo = pageInfos.get(name);
- if (pageInfo != null)
- {
- // remove page info
- pageInfos.remove(name);
- }
- }
-
- private static class PageInfo
- {
- private final String uuid;
- private final Map<String, String> childrenWindows = new HashMap<String, String>();
- private final String name;
-
- private PageInfo(String uuid, String name)
- {
- this.uuid = uuid;
- this.name = name;
- }
-
- public String getUUID()
- {
- return uuid;
- }
-
- public List<String> getChildrenWindows()
- {
- return new ArrayList<String>(childrenWindows.keySet());
- }
-
- public void addWindow(String windowName, String uuid)
- {
- // add suffix in case we have several windows with the same name in the page
- if (childrenWindows.containsKey(windowName))
- {
- if (windowName.endsWith("|"))
- {
- windowName += "|";
- }
- else
- {
- windowName += windowName + " |";
- }
- }
-
- childrenWindows.put(windowName, uuid);
- }
-
- public void updateWindowName(String oldWindowName, String newWindowName)
- {
- String windowUUID = getWindowUUID(oldWindowName);
- childrenWindows.remove(oldWindowName);
- childrenWindows.put(newWindowName, windowUUID);
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getWindowUUID(String windowId)
- {
- return childrenWindows.get(windowId);
- }
- }
-}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java (from rev 4924, portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProvider.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,308 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.structure;
+
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.exoplatform.services.listener.Event;
+import org.exoplatform.services.listener.Listener;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Page;
+import org.gatein.mop.api.workspace.ui.UIComponent;
+import org.gatein.mop.api.workspace.ui.UIContainer;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.StatefulPortletContext;
+import org.gatein.wsrp.api.context.ConsumerStructureProvider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MOPConsumerStructureProvider extends Listener<DataStorage, org.exoplatform.portal.config.model.Page> implements ConsumerStructureProvider
+{
+ private final PortalStructureAccess structureAccess;
+ private Map<String, PageInfo> pageInfos;
+ private boolean pagesHaveBeenInitialized;
+
+ public MOPConsumerStructureProvider(PortalStructureAccess structureAccess)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(structureAccess, "PortalStructureAccess");
+
+ this.structureAccess = structureAccess;
+ pageInfos = new HashMap<String, PageInfo>();
+ }
+
+ public List<String> getPageIdentifiers()
+ {
+ if (!pagesHaveBeenInitialized)
+ {
+ // initialize page information
+ Collection<Page> pages = structureAccess.getPages();
+ for (Page page : pages)
+ {
+ addPage(page);
+ }
+
+ pagesHaveBeenInitialized = true;
+ }
+
+ LinkedList<String> identifiers = new LinkedList<String>(pageInfos.keySet());
+ Collections.sort(identifiers);
+ return identifiers;
+ }
+
+ private void addPage(Page page)
+ {
+ Described described = page.adapt(Described.class);
+ PageInfo pageInfo = new PageInfo(page.getObjectId(), described.getName(), page.getName());
+ pageInfos.put(pageInfo.getName(), pageInfo);
+ UIContainer container = page.getRootComponent();
+ processContainer(container, pageInfo);
+
+ Collection<Page> children = page.getChildren();
+ if (ParameterValidation.existsAndIsNotEmpty(children))
+ {
+ for (Page child : children)
+ {
+ addPage(child);
+ }
+ }
+ }
+
+ public List<String> getWindowIdentifiersFor(String pageId)
+ {
+ PageInfo pageInfo = pageInfos.get(pageId);
+ if (pageInfo == null)
+ {
+ throw new IllegalArgumentException("Page '" + pageId + "' does not exist.");
+ }
+
+ return pageInfo.getChildrenWindows();
+ }
+
+ private void processContainer(UIContainer container, PageInfo pageInfo)
+ {
+ if (container != null)
+ {
+ List<UIComponent> components = container.getComponents();
+ for (UIComponent component : components)
+ {
+ ObjectType<? extends UIComponent> type = component.getObjectType();
+ if (ObjectType.WINDOW.equals(type))
+ {
+ Described described = component.adapt(Described.class);
+ String name = described.getName();
+
+ pageInfo.addWindow(name, component.getObjectId());
+ }
+ else if (ObjectType.CONTAINER.equals(type))
+ {
+ processContainer((UIContainer)component, pageInfo);
+ }
+ else
+ {
+ // ignore
+ }
+ }
+ }
+ }
+
+ public void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId, String exportedPortletHandle)
+ {
+ PageInfo pageInfo = pageInfos.get(pageId);
+ String uuid = pageInfo.getWindowUUID(windowId);
+ ParameterValidation.throwIllegalArgExceptionIfNull(uuid, "UUID for " + windowId);
+
+ // get the window
+ UIWindow window = structureAccess.getWindowFrom(uuid);
+
+ // construct the new customization state
+ WSRP wsrp = new WSRP();
+ String portletId = portletContext.getId();
+ wsrp.setPortletId(portletId);
+ if (portletContext instanceof StatefulPortletContext)
+ {
+ StatefulPortletContext context = (StatefulPortletContext)portletContext;
+ if (PortletStateType.OPAQUE.equals(context.getType()))
+ {
+ wsrp.setState((byte[])context.getState());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Don't know how to deal with state: " + context.getState());
+ }
+ }
+
+ // destroy existing customization as otherwise re-customizing will fail
+ Customization<?> customization = window.getCustomization();
+ customization.destroy();
+
+ // and re-customize
+ window.customize(WSRP.CONTENT_TYPE, portletId, wsrp);
+
+ // Change the window's name so that it's less confusing to users
+ Described described = window.adapt(Described.class);
+ String newName = exportedPortletHandle + " (remote)";
+ described.setName(newName); // should be the same as ApplicationRegistryService.REMOTE_DISPLAY_NAME_SUFFIX
+
+ // update window mappings
+ pageInfo.updateWindowName(windowId, newName);
+
+ structureAccess.saveChangesTo(window);
+ }
+
+ @Override
+ public void onEvent(Event<DataStorage, org.exoplatform.portal.config.model.Page> event) throws Exception
+ {
+ String eventName = event.getEventName();
+
+ // get the MOP page from the event data
+ org.exoplatform.portal.config.model.Page portalPage = event.getData();
+ Page page = structureAccess.getPageFrom(portalPage);
+
+ if (page == null && DataStorage.PAGE_REMOVED.equals(eventName))
+ {
+ // if we try to remove a page, when we get this event, the page has already been removed from JCR
+ // so we need to work around that fact by retrieving the corresponding PageInfo from the portal page title
+ // which should match the Described name and check that it matches the internal name before removing it
+ removePage(portalPage.getTitle(), portalPage.getName());
+
+ return;
+ }
+
+ if (page != null)
+ {
+ if (DataStorage.PAGE_CREATED.equals(eventName))
+ {
+ // add information for new page
+ addPage(page);
+ }
+ else if (DataStorage.PAGE_UPDATED.equals(eventName))
+ {
+ removePage(page);
+ addPage(page);
+ }
+ }
+ }
+
+ private void removePage(Page page)
+ {
+ Described described = page.adapt(Described.class);
+ String name = described.getName();
+
+ removePage(name, page.getName());
+ }
+
+ private void removePage(String name, String internalName)
+ {
+ PageInfo pageInfo = pageInfos.get(name);
+ if (pageInfo != null && internalName.equals(pageInfo.getInternalName()))
+ {
+ // remove page info
+ pageInfos.remove(name);
+ }
+ }
+
+ private static class PageInfo
+ {
+ private final String uuid;
+ private final Map<String, String> childrenWindows = new HashMap<String, String>();
+
+ /** Name as provided by Described */
+ private final String name;
+
+ /** Name as automatically generated */
+ private final String internalName;
+
+ private PageInfo(String uuid, String name, String internalName)
+ {
+ this.uuid = uuid;
+ this.name = name;
+ this.internalName = internalName;
+ }
+
+ public String getUUID()
+ {
+ return uuid;
+ }
+
+ public String getInternalName()
+ {
+ return internalName;
+ }
+
+ public List<String> getChildrenWindows()
+ {
+ return new ArrayList<String>(childrenWindows.keySet());
+ }
+
+ public void addWindow(String windowName, String uuid)
+ {
+ // add suffix in case we have several windows with the same name in the page
+ if (childrenWindows.containsKey(windowName))
+ {
+ if (windowName.endsWith("|"))
+ {
+ windowName += "|";
+ }
+ else
+ {
+ windowName += windowName + " |";
+ }
+ }
+
+ childrenWindows.put(windowName, uuid);
+ }
+
+ public void updateWindowName(String oldWindowName, String newWindowName)
+ {
+ String windowUUID = getWindowUUID(oldWindowName);
+ childrenWindows.remove(oldWindowName);
+ childrenWindows.put(newWindowName, windowUUID);
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getWindowUUID(String windowId)
+ {
+ return childrenWindows.get(windowId);
+ }
+ }
+}
Deleted: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java 2010-11-03 20:48:19 UTC (rev 4924)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,111 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.structure;
-
-import org.exoplatform.portal.pom.config.POMSession;
-import org.exoplatform.portal.pom.config.POMSessionManager;
-import org.exoplatform.portal.pom.data.Mapper;
-import org.exoplatform.portal.pom.data.PageKey;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Page;
-import org.gatein.mop.api.workspace.Site;
-import org.gatein.mop.api.workspace.Workspace;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class MOPPortalStructureAccess implements PortalStructureAccess
-{
- private static final String PAGES_CHILD_NAME = "pages";
- private final POMSessionManager pomManager;
-
- public MOPPortalStructureAccess(POMSessionManager pomManager)
- {
- this.pomManager = pomManager;
- }
-
- public Collection<Page> getPages()
- {
- POMSession session = pomManager.getSession();
- Workspace workspace = session.getWorkspace();
- Collection<Site> sites = workspace.getSites(ObjectType.PORTAL_SITE);
-
- List<Page> pages = new ArrayList<Page>(sites.size() * 10);
-
- for (Site site : sites)
- {
- Page pagesRoot = getPagesFrom(site);
- if (pagesRoot != null)
- {
- Collection<Page> children = pagesRoot.getChildren();
- for (Page child : children)
- {
- pages.add(child);
- }
- }
- }
-
- return pages;
- }
-
- public UIWindow getWindowFrom(String uuid)
- {
- POMSession session = pomManager.getSession();
- return session.findObjectById(ObjectType.WINDOW, uuid);
- }
-
- public void saveChangesTo(UIWindow window)
- {
- POMSession session = pomManager.getSession();
-
- // mark page for cache invalidation otherwise DataCache will use the previous customization id when trying to set
- // the portlet state in UIPortlet.setState and will not find it resulting in an error
- Page page = window.getPage();
- session.scheduleForEviction(new PageKey("portal", page.getSite().getName(), page.getName()));
-
- // save
- session.close(true);
- }
-
- public Page getPageFrom(org.exoplatform.portal.config.model.Page portalPage)
- {
- POMSession session = pomManager.getSession();
- Site site = session.getWorkspace().getSite(Mapper.parseSiteType(portalPage.getOwnerType()), portalPage.getOwnerId());
- return getPagesFrom(site).getChild(portalPage.getName());
- }
-
- private Page getPagesFrom(Site site)
- {
- // a site contains a root page with templates and pages
- // more info at http://code.google.com/p/chromattic/wiki/MOPUseCases
-
- return site.getRootPage().getChild(PAGES_CHILD_NAME);
- }
-}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java (from rev 4924, portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/MOPPortalStructureAccess.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.structure;
+
+import org.exoplatform.portal.pom.config.POMSession;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.PageKey;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Page;
+import org.gatein.mop.api.workspace.Site;
+import org.gatein.mop.api.workspace.Workspace;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MOPPortalStructureAccess implements PortalStructureAccess
+{
+ private static final String PAGES_CHILD_NAME = "pages";
+ private final POMSessionManager pomManager;
+
+ public MOPPortalStructureAccess(POMSessionManager pomManager)
+ {
+ this.pomManager = pomManager;
+ }
+
+ public Collection<Page> getPages()
+ {
+ POMSession session = pomManager.getSession();
+ Workspace workspace = session.getWorkspace();
+ Collection<Site> sites = workspace.getSites(ObjectType.PORTAL_SITE);
+
+ List<Page> pages = new ArrayList<Page>(sites.size() * 10);
+
+ for (Site site : sites)
+ {
+ Page pagesRoot = getPagesFrom(site);
+ if (pagesRoot != null)
+ {
+ Collection<Page> children = pagesRoot.getChildren();
+ for (Page child : children)
+ {
+ pages.add(child);
+ }
+ }
+ }
+
+ return pages;
+ }
+
+ public UIWindow getWindowFrom(String uuid)
+ {
+ POMSession session = pomManager.getSession();
+ return session.findObjectById(ObjectType.WINDOW, uuid);
+ }
+
+ public void saveChangesTo(UIWindow window)
+ {
+ POMSession session = pomManager.getSession();
+
+ // mark page for cache invalidation otherwise DataCache will use the previous customization id when trying to set
+ // the portlet state in UIPortlet.setState and will not find it resulting in an error
+ Page page = window.getPage();
+ session.scheduleForEviction(new PageKey("portal", page.getSite().getName(), page.getName()));
+
+ // save
+ session.close(true);
+ }
+
+ public Page getPageFrom(org.exoplatform.portal.config.model.Page portalPage)
+ {
+ POMSession session = pomManager.getSession();
+ Site site = session.getWorkspace().getSite(Mapper.parseSiteType(portalPage.getOwnerType()), portalPage.getOwnerId());
+ return getPagesFrom(site).getChild(portalPage.getName());
+ }
+
+ private Page getPagesFrom(Site site)
+ {
+ // a site contains a root page with templates and pages
+ // more info at http://code.google.com/p/chromattic/wiki/MOPUseCases
+
+ return site.getRootPage().getChild(PAGES_CHILD_NAME);
+ }
+}
Deleted: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java 2010-11-03 20:48:19 UTC (rev 4924)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,44 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.structure;
-
-import org.gatein.mop.api.workspace.Page;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface PortalStructureAccess
-{
- Collection<Page> getPages();
-
- UIWindow getWindowFrom(String uuid);
-
- void saveChangesTo(UIWindow window);
-
- Page getPageFrom(org.exoplatform.portal.config.model.Page portalPage);
-}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java (from rev 4924, portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/structure/PortalStructureAccess.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.structure;
+
+import org.gatein.mop.api.workspace.Page;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface PortalStructureAccess
+{
+ Collection<Page> getPages();
+
+ UIWindow getWindowFrom(String uuid);
+
+ void saveChangesTo(UIWindow window);
+
+ Page getPageFrom(org.exoplatform.portal.config.model.Page portalPage);
+}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure (from rev 4924, portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure)
Deleted: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java
===================================================================
--- portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java 2010-11-03 20:48:19 UTC (rev 4924)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,289 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.structure;
-
-import junit.framework.TestCase;
-import org.exoplatform.portal.config.DataStorage;
-import org.exoplatform.portal.mop.Described;
-import org.exoplatform.portal.pom.spi.wsrp.WSRP;
-import org.exoplatform.services.listener.Event;
-import org.gatein.mop.api.content.Customization;
-import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Page;
-import org.gatein.mop.api.workspace.ui.UIComponent;
-import org.gatein.mop.api.workspace.ui.UIContainer;
-import org.gatein.mop.api.workspace.ui.UIWindow;
-import org.gatein.pc.api.PortletContext;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Mockito.*;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class MOPConsumerStructureProviderTestCase extends TestCase
-{
- private MOPConsumerStructureProvider provider;
- private PortalStructureAccess structureAccess;
- private Page page1;
-
- public void testGetPageIdentifiers()
- {
- List<String> pageIdentifiers = provider.getPageIdentifiers();
- assertEquals(5, pageIdentifiers.size());
- assertTrue(pageIdentifiers.contains("page1"));
- assertTrue(pageIdentifiers.contains("page11"));
- assertTrue(pageIdentifiers.contains("page12"));
- assertTrue(pageIdentifiers.contains("page2"));
- assertTrue(pageIdentifiers.contains("page21"));
- }
-
- public void testGetWindowIdentifiersForInexistingPage()
- {
- List<String> windows = provider.getWindowIdentifiersFor("inexisting");
- assertTrue(windows.isEmpty());
- }
-
- public void testGetWindowIdentifiersFor()
- {
- checkWindows("page1", "window11", "window12");
- checkWindows("page2");
- checkWindows("page11", "window111", "window112");
- checkWindows("page12", "window121");
- checkWindows("page21", "window211");
- }
-
- public void testAssignPortletToWindow()
- {
- String newCustomizationId = "new";
- String newWindowName = "portlet";
- provider.assignPortletToWindow(PortletContext.createPortletContext(newCustomizationId), "window11", "page1", newWindowName);
- verify(structureAccess).getWindowFrom(getIdFor("window11"));
-
- UIWindow window11 = structureAccess.getWindowFrom(getIdFor("window11"));
- verify(structureAccess).saveChangesTo(window11);
-
- Described described = window11.adapt(Described.class);
- verify(described).setName(newWindowName + " (remote)");
-
- WSRP state = new WSRP();
- state.setPortletId(newCustomizationId);
- verify(window11).customize(WSRP.CONTENT_TYPE, newCustomizationId, state);
-
- Customization<?> customization = window11.getCustomization();
- assertEquals(WSRP.CONTENT_TYPE, customization.getType());
- }
-
- public void testPageCreationEvent() throws Exception
- {
- Page foo = createPage("foo", new String[]{"foo1"}, new String[]{"windowfoo1"});
- Page foo1 = foo.getChild("foo1");
- addWindows(foo1, "windowfoo11");
- org.exoplatform.portal.config.model.Page portalPage = mock(org.exoplatform.portal.config.model.Page.class);
- when(structureAccess.getPageFrom(portalPage)).thenReturn(foo);
-
- int pageNumber = provider.getPageIdentifiers().size();
-
- provider.onEvent(new Event<DataStorage, org.exoplatform.portal.config.model.Page>(DataStorage.PAGE_CREATED, null, portalPage));
-
- List<String> identifiers = provider.getPageIdentifiers();
- assertEquals(pageNumber + 2, identifiers.size());
- assertTrue(identifiers.contains("foo"));
- assertTrue(identifiers.contains("foo1"));
-
- checkWindows("foo", "windowfoo1");
- checkWindows("foo1", "windowfoo11");
-
- assertEquals(foo1.getRootComponent().get("windowfoo11"), structureAccess.getWindowFrom(getIdFor("windowfoo11")));
- }
-
- public void testPageDeletionEvent() throws Exception
- {
- org.exoplatform.portal.config.model.Page portalPage = mock(org.exoplatform.portal.config.model.Page.class);
- when(structureAccess.getPageFrom(portalPage)).thenReturn(page1);
-
- int pageNumber = provider.getPageIdentifiers().size();
-
- provider.onEvent(new Event<DataStorage, org.exoplatform.portal.config.model.Page>(DataStorage.PAGE_REMOVED, null, portalPage));
-
- List<String> identifiers = provider.getPageIdentifiers();
- assertEquals(pageNumber - 3, identifiers.size());
- assertFalse(identifiers.contains("page1"));
- assertFalse(identifiers.contains("page11"));
- assertFalse(identifiers.contains("page12"));
-
- assertNull(structureAccess.getWindowFrom(getIdFor("window11")));
- assertNull(structureAccess.getWindowFrom(getIdFor("window12")));
- assertNull(structureAccess.getWindowFrom(getIdFor("window111")));
- assertNull(structureAccess.getWindowFrom(getIdFor("window112")));
- assertNull(structureAccess.getWindowFrom(getIdFor("window121")));
- }
-
- public void testPageUpdatedEvent() throws Exception
- {
- // todo!
- }
-
- @Override
- protected void setUp() throws Exception
- {
- structureAccess = mock(PortalStructureAccess.class);
-
- page1 = createPage("page1", new String[]{"page11", "page12"}, new String[]{"window11", "window12"});
- Page page2 = createPage("page2", new String[]{"page21"}, null);
-
- Page page11 = page1.getChild("page11");
- addWindows(page11, "window111", "window112");
-
- Page page12 = page1.getChild("page12");
- addWindows(page12, "window121");
-
- Page page21 = page2.getChild("page21");
- addWindows(page21, "window211");
-
- ArrayList<Page> pages = new ArrayList<Page>();
- pages.add(page1);
- pages.add(page11);
- pages.add(page12);
- pages.add(page2);
- pages.add(page21);
- when(structureAccess.getPages()).thenReturn(pages);
-
- provider = new MOPConsumerStructureProvider(structureAccess);
-
- // needed to initialize state
- provider.getPageIdentifiers();
- }
-
- private void checkWindows(final String pageName, String... windowNames)
- {
- List<String> windows = provider.getWindowIdentifiersFor(pageName);
-
- if (windowNames != null)
- {
- assertEquals(windowNames.length, windows.size());
- for (String windowName : windowNames)
- {
- assertTrue(windows.contains(windowName));
- }
- }
- }
-
- private Page createPage(String name, String[] childrenPages, String[] windowNames)
- {
- Page page = mock(Page.class);
-
- when(page.getName()).thenThrow(new RuntimeException("Page.getName returns the internal name, not the human readable one"));
-
- // mock call to adapt
- Described described = mock(Described.class);
- when(described.getName()).thenReturn(name);
-
- when(page.adapt(Described.class)).thenReturn(described);
-
- if (childrenPages != null)
- {
- List<Page> children = new ArrayList<Page>(childrenPages.length);
- for (String pageId : childrenPages)
- {
- Page childPage = createPage(pageId, null, null);
- when(page.getChild(pageId)).thenReturn(childPage);
- children.add(childPage);
- }
-
- when(page.getChildren()).thenReturn(children);
- }
-
- addWindows(page, windowNames);
-
- return page;
- }
-
- private void addWindows(Page page, String... windowNames)
- {
- if (windowNames != null)
- {
- // mock page container
- UIContainer root = mock(UIContainer.class);
- when(page.getRootComponent()).thenReturn(root);
-
- // for each provided window name, create a mock UIWindow...
- List<UIComponent> children = new ArrayList<UIComponent>(windowNames.length);
- for (String windowName : windowNames)
- {
- UIWindow window = mock(UIWindow.class);
- when(window.getName()).thenThrow(new RuntimeException("Window.getName returns the internal name, not the human readable one"));
- when(window.getObjectId()).thenReturn(getIdFor(windowName));
-
- // need to use thenAnswer instead of thenReturn here because it doesn't play well with generics
- when(window.getObjectType()).thenAnswer(new Answer<Object>()
- {
- public Object answer(InvocationOnMock invocationOnMock) throws Throwable
- {
- return ObjectType.WINDOW;
- }
- });
-
- // mock call to adapt
- Described described = mock(Described.class);
- when(described.getName()).thenReturn(windowName);
-
- when(window.adapt(Described.class)).thenReturn(described);
-
- // mock Customization
- final Customization<WSRP> customization = mock(Customization.class);
- when(customization.getType()).thenReturn(WSRP.CONTENT_TYPE);
- when(window.getCustomization()).thenAnswer(new Answer<Object>()
- {
- public Object answer(InvocationOnMock invocationOnMock) throws Throwable
- {
- return customization;
- }
- });
-
- // add it to the list of windows for this page
- children.add(window);
-
- // make sure that we return the window when we ask for it from its uuid
- when(structureAccess.getWindowFrom(getIdFor(windowName))).thenReturn(window);
-
- // make sure that we return the window if we ask the root component for it
- when(root.get(windowName)).thenReturn(window);
- }
-
- // the container should return the list of windows when asked for its components
- when(root.getComponents()).thenReturn(children);
- }
- }
-
- private String getIdFor(String windowName)
- {
- return windowName + "Id";
- }
-}
Copied: epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java (from rev 4924, portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/test/java/org/gatein/portal/wsrp/structure/MOPConsumerStructureProviderTestCase.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,302 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.structure;
+
+import junit.framework.TestCase;
+import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.exoplatform.services.listener.Event;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Page;
+import org.gatein.mop.api.workspace.ui.UIComponent;
+import org.gatein.mop.api.workspace.ui.UIContainer;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+import org.gatein.pc.api.PortletContext;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.mockito.Mockito.*;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MOPConsumerStructureProviderTestCase extends TestCase
+{
+ private MOPConsumerStructureProvider provider;
+ private PortalStructureAccess structureAccess;
+ private Page page1;
+
+ public void testGetPageIdentifiers()
+ {
+ List<String> pageIdentifiers = provider.getPageIdentifiers();
+ assertEquals(5, pageIdentifiers.size());
+ assertTrue(pageIdentifiers.contains("page1"));
+ assertTrue(pageIdentifiers.contains("page11"));
+ assertTrue(pageIdentifiers.contains("page12"));
+ assertTrue(pageIdentifiers.contains("page2"));
+ assertTrue(pageIdentifiers.contains("page21"));
+ }
+
+ public void testGetWindowIdentifiersForInexistingPage()
+ {
+ try
+ {
+ provider.getWindowIdentifiersFor("inexisting");
+ fail("Cannot retrieve windows for an inexistent page");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testGetWindowIdentifiersFor()
+ {
+ checkWindows("page1", "window11", "window12");
+ checkWindows("page2");
+ checkWindows("page11", "window111", "window112");
+ checkWindows("page12", "window121");
+ checkWindows("page21", "window211");
+ }
+
+ public void testAssignPortletToWindow()
+ {
+ String newCustomizationId = "new";
+ String newWindowName = "portlet";
+ provider.assignPortletToWindow(PortletContext.createPortletContext(newCustomizationId), "window11", "page1", newWindowName);
+ verify(structureAccess).getWindowFrom(getIdFor("window11"));
+
+ UIWindow window11 = structureAccess.getWindowFrom(getIdFor("window11"));
+ verify(structureAccess).saveChangesTo(window11);
+
+ Described described = window11.adapt(Described.class);
+ verify(described).setName(newWindowName + " (remote)");
+
+ WSRP state = new WSRP();
+ state.setPortletId(newCustomizationId);
+ verify(window11).customize(WSRP.CONTENT_TYPE, newCustomizationId, state);
+
+ Customization<?> customization = window11.getCustomization();
+ assertEquals(WSRP.CONTENT_TYPE, customization.getType());
+ }
+
+ public void testPageCreationEvent() throws Exception
+ {
+ Page foo = createPage("foo", new String[]{"foo1"}, new String[]{"windowfoo1"});
+ Page foo1 = foo.getChild("foo1");
+ addWindows(foo1, "windowfoo11");
+ org.exoplatform.portal.config.model.Page portalPage = mock(org.exoplatform.portal.config.model.Page.class);
+ when(structureAccess.getPageFrom(portalPage)).thenReturn(foo);
+
+ int pageNumber = provider.getPageIdentifiers().size();
+
+ provider.onEvent(new Event<DataStorage, org.exoplatform.portal.config.model.Page>(DataStorage.PAGE_CREATED, null, portalPage));
+
+ List<String> identifiers = provider.getPageIdentifiers();
+ assertEquals(pageNumber + 2, identifiers.size());
+ assertTrue(identifiers.contains("foo"));
+ assertTrue(identifiers.contains("foo1"));
+
+ checkWindows("foo", "windowfoo1");
+ checkWindows("foo1", "windowfoo11");
+
+ assertEquals(foo1.getRootComponent().get("windowfoo11"), structureAccess.getWindowFrom(getIdFor("windowfoo11")));
+ }
+
+ public void testPageDeletionEvent() throws Exception
+ {
+ String pageToRemove = "page1";
+
+ org.exoplatform.portal.config.model.Page portalPage = mock(org.exoplatform.portal.config.model.Page.class);
+ when(portalPage.getName()).thenReturn(createInternalNameFrom(pageToRemove));
+ when(portalPage.getTitle()).thenReturn(pageToRemove);
+
+ // on delete, we actually get the event after the page has been removed from JCR so we don't have an actual page
+ when(structureAccess.getPageFrom(portalPage)).thenReturn(null);
+
+ int pageNumber = provider.getPageIdentifiers().size();
+
+ provider.onEvent(new Event<DataStorage, org.exoplatform.portal.config.model.Page>(DataStorage.PAGE_REMOVED, null, portalPage));
+
+ List<String> identifiers = provider.getPageIdentifiers();
+ assertEquals(pageNumber - 1, identifiers.size());
+ // deleting a page doesn't delete its children, see GTNPORTAL-1630
+ assertFalse(identifiers.contains(pageToRemove));
+ assertTrue(identifiers.contains("page11"));
+ assertTrue(identifiers.contains("page12"));
+ }
+
+ public void testPageUpdatedEvent() throws Exception
+ {
+ // todo!
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ structureAccess = mock(PortalStructureAccess.class);
+
+ page1 = createPage("page1", new String[]{"page11", "page12"}, new String[]{"window11", "window12"});
+ Page page2 = createPage("page2", new String[]{"page21"}, null);
+
+ Page page11 = page1.getChild("page11");
+ addWindows(page11, "window111", "window112");
+
+ Page page12 = page1.getChild("page12");
+ addWindows(page12, "window121");
+
+ Page page21 = page2.getChild("page21");
+ addWindows(page21, "window211");
+
+ ArrayList<Page> pages = new ArrayList<Page>();
+ pages.add(page1);
+ pages.add(page11);
+ pages.add(page12);
+ pages.add(page2);
+ pages.add(page21);
+ when(structureAccess.getPages()).thenReturn(pages);
+
+ provider = new MOPConsumerStructureProvider(structureAccess);
+
+ // needed to initialize state
+ provider.getPageIdentifiers();
+ }
+
+ private void checkWindows(final String pageName, String... windowNames)
+ {
+ List<String> windows = provider.getWindowIdentifiersFor(pageName);
+
+ if (windowNames != null)
+ {
+ assertEquals(windowNames.length, windows.size());
+ for (String windowName : windowNames)
+ {
+ assertTrue(windows.contains(windowName));
+ }
+ }
+ }
+
+ private Page createPage(String name, String[] childrenPages, String[] windowNames)
+ {
+ Page page = mock(Page.class);
+
+ when(page.getName()).thenReturn(createInternalNameFrom(name));
+
+ // mock call to adapt
+ Described described = mock(Described.class);
+ when(described.getName()).thenReturn(name);
+
+ when(page.adapt(Described.class)).thenReturn(described);
+
+ if (childrenPages != null)
+ {
+ List<Page> children = new ArrayList<Page>(childrenPages.length);
+ for (String pageId : childrenPages)
+ {
+ Page childPage = createPage(pageId, null, null);
+ when(page.getChild(pageId)).thenReturn(childPage);
+ children.add(childPage);
+ }
+
+ when(page.getChildren()).thenReturn(children);
+ }
+
+ addWindows(page, windowNames);
+
+ return page;
+ }
+
+ private String createInternalNameFrom(String name)
+ {
+ return name + "internal";
+ }
+
+ private void addWindows(Page page, String... windowNames)
+ {
+ if (windowNames != null)
+ {
+ // mock page container
+ UIContainer root = mock(UIContainer.class);
+ when(page.getRootComponent()).thenReturn(root);
+
+ // for each provided window name, create a mock UIWindow...
+ List<UIComponent> children = new ArrayList<UIComponent>(windowNames.length);
+ for (String windowName : windowNames)
+ {
+ UIWindow window = mock(UIWindow.class);
+ when(window.getName()).thenThrow(new RuntimeException("Window.getName returns the internal name, not the human readable one"));
+ when(window.getObjectId()).thenReturn(getIdFor(windowName));
+
+ // need to use thenAnswer instead of thenReturn here because it doesn't play well with generics
+ when(window.getObjectType()).thenAnswer(new Answer<Object>()
+ {
+ public Object answer(InvocationOnMock invocationOnMock) throws Throwable
+ {
+ return ObjectType.WINDOW;
+ }
+ });
+
+ // mock call to adapt
+ Described described = mock(Described.class);
+ when(described.getName()).thenReturn(windowName);
+
+ when(window.adapt(Described.class)).thenReturn(described);
+
+ // mock Customization
+ final Customization<WSRP> customization = mock(Customization.class);
+ when(customization.getType()).thenReturn(WSRP.CONTENT_TYPE);
+ when(window.getCustomization()).thenAnswer(new Answer<Object>()
+ {
+ public Object answer(InvocationOnMock invocationOnMock) throws Throwable
+ {
+ return customization;
+ }
+ });
+
+ // add it to the list of windows for this page
+ children.add(window);
+
+ // make sure that we return the window when we ask for it from its uuid
+ when(structureAccess.getWindowFrom(getIdFor(windowName))).thenReturn(window);
+
+ // make sure that we return the window if we ask the root component for it
+ when(root.get(windowName)).thenReturn(window);
+ }
+
+ // the container should return the list of windows when asked for its components
+ when(root.getComponents()).thenReturn(children);
+ }
+ }
+
+ private String getIdFor(String windowName)
+ {
+ return windowName + "Id";
+ }
+}
Modified: epp/portal/branches/EPP_5_1_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-CR02</org.gatein.pc.version>
<org.picketlink.idm>1.1.7.CR01</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-Beta05</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.0-CR02</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal)
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group)
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform)
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators)
Deleted: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml 2010-10-27 15:39:51 UTC (rev 4863)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
-<node-navigation
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
- <priority>2</priority>
-
- <page-nodes>
- <!-- TODO: enable when the extension mechanism can handle child nodes properly -->
-<!-- <node>
- <uri>administration</uri>
- <name>administration</name>
- <label>#{administration.title}</label> -->
- <node>
- <!-- <uri>administration/wsrpConfiguration</uri> -->
- <uri>wsrpConfiguration</uri>
- <name>wsrpConfiguration</name>
- <!-- TODO: add a proper i18n label here -->
- <label>WSRP</label>
- <page-reference>group::/platform/administrators::wsrpConfiguration</page-reference>
- </node>
-<!-- </node> -->
- </page-nodes>
-</node-navigation>
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/navigation.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<node-navigation
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
+ <priority>2</priority>
+
+ <page-nodes>
+ <!-- TODO: enable when the extension mechanism can handle child nodes properly -->
+<!-- <node>
+ <uri>administration</uri>
+ <name>administration</name>
+ <label>#{administration.title}</label> -->
+ <node>
+ <!-- <uri>administration/wsrpConfiguration</uri> -->
+ <uri>wsrpConfiguration</uri>
+ <name>wsrpConfiguration</name>
+ <!-- TODO: add a proper i18n label here -->
+ <label>WSRP</label>
+ <page-reference>group::/platform/administrators::wsrpConfiguration</page-reference>
+ </node>
+<!-- </node> -->
+ </page-nodes>
+</node-navigation>
Deleted: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2010-10-27 15:39:51 UTC (rev 4863)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
-<page-set
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
- xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
-
- <page>
- <name>wsrpConfiguration</name>
- <title>WSRP Admin</title>
- <access-permissions>manager:/platform/administrators</access-permissions>
- <edit-permission>manager:/platform/administrators</edit-permission>
- <portlet-application>
- <portlet>
- <application-ref>wsrp-admin-gui</application-ref>
- <portlet-ref>WSRPConfigurationPortlet</portlet-ref>
- </portlet>
- <title>WSRP Admin</title>
- <access-permissions>manager:/platform/administrators</access-permissions>
- <show-info-bar>false</show-info-bar>
- </portlet-application>
- </page>
-
-</page-set>
Copied: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml (from rev 4863, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml (rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<page-set
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0 http://www.gatein.org/xml/ns/gatein_objects_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_0">
+
+ <page>
+ <name>wsrpConfiguration</name>
+ <title>WSRP Admin</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <edit-permission>manager:/platform/administrators</edit-permission>
+ <portlet-application>
+ <portlet>
+ <application-ref>wsrp-admin-gui</application-ref>
+ <portlet-ref>WSRPConfigurationPortlet</portlet-ref>
+ </portlet>
+ <title>WSRP Admin</title>
+ <access-permissions>manager:/platform/administrators</access-permissions>
+ <show-info-bar>false</show-info-bar>
+ </portlet-application>
+ </page>
+
+</page-set>
Modified: epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2010-11-11 18:25:34 UTC (rev 5046)
@@ -44,6 +44,41 @@
</init-params>
</component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.portal.config.UserPortalConfigService</target-component>
+ <component-plugin>
+ <!-- The name of the plugin -->
+ <name>new.portal.config.user.listener</name>
+ <!-- The name of the method to call on the UserPortalConfigService in order to register the NewPortalConfigs -->
+ <set-method>initListener</set-method>
+ <!-- The full qualified name of the NewPortalConfigListener -->
+ <type>org.exoplatform.portal.config.NewPortalConfigListener</type>
+ <description>this listener init the portal configuration</description>
+ <init-params>
+ <object-param>
+ <name>group.configuration</name>
+ <description>description</description>
+ <object type="org.exoplatform.portal.config.NewPortalConfig">
+ <field name="predefinedOwner">
+ <collection type="java.util.HashSet">
+ <value>
+ <string>platform/administrators</string>
+ </value>
+ </collection>
+ </field>
+ <field name="ownerType">
+ <string>group</string>
+ </field>
+ <field name="templateLocation">
+ <string>war:/conf/wsrp/portal</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
<!--<external-component-plugins>
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
<component-plugin>
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -60,6 +60,7 @@
private static final String QMARK = "?";
private static final String EQ = "=";
private static final String AMP = "&";
+ private static final String XMLAMP = "&";
public ExoPortletInvocationContext(PortalRequestContext portalRequestContext, UIPortlet portlet)
{
@@ -95,6 +96,12 @@
public String renderURL(ContainerURL containerURL, URLFormat format)
{
+ boolean wantEscapeXML = false;
+ if (format != null && format.getWantEscapeXML() != null)
+ {
+ wantEscapeXML = format.getWantEscapeXML();
+ }
+
// todo: shouldn't we be using URLFormat to decide on the path to use at the beginning of the URL?
StringBuilder baseURL = new StringBuilder(this.portalRequestURI).append(QMARK)
.append(PortalRequestContext.UI_COMPONENT_ID).append(EQ).append(this.portletId);
@@ -119,30 +126,30 @@
if (!type.equals(Constants.PORTAL_RENDER))
{
- appendParameter(baseURL, Constants.TYPE_PARAMETER, type);
+ appendParameter(baseURL, Constants.TYPE_PARAMETER, type, wantEscapeXML);
}
if (format != null && format.getWantSecure() != null)
{
- appendParameter(baseURL, Constants.SECURE_PARAMETER, format.getWantSecure().toString());
+ appendParameter(baseURL, Constants.SECURE_PARAMETER, format.getWantSecure().toString(), wantEscapeXML);
}
StateString navigationalState = containerURL.getNavigationalState();
if (navigationalState != null && !navigationalState.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME, navigationalState.getStringValue());
+ appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME, navigationalState.getStringValue(), wantEscapeXML);
}
WindowState windowState = containerURL.getWindowState();
if (windowState != null)
{
- appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString());
+ appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString(), wantEscapeXML);
}
Mode mode = containerURL.getMode();
if (mode != null)
{
- appendParameter(baseURL, Constants.PORTLET_MODE_PARAMETER, mode.toString());
+ appendParameter(baseURL, Constants.PORTLET_MODE_PARAMETER, mode.toString(), wantEscapeXML);
}
if (containerURL instanceof ActionURL)
@@ -152,25 +159,25 @@
StateString state = actionURL.getInteractionState();
if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, INTERACTION_STATE_PARAM_NAME, state.getStringValue());
+ appendParameter(baseURL, INTERACTION_STATE_PARAM_NAME, state.getStringValue(), wantEscapeXML);
}
}
else if (containerURL instanceof ResourceURL)
{
ResourceURL resourceURL = (ResourceURL)containerURL;
- appendParameter(baseURL, Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId());
+ appendParameter(baseURL, Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId(), wantEscapeXML);
CacheLevel cachability = resourceURL.getCacheability();
if (cachability != null)
{
- appendParameter(baseURL, Constants.CACHELEVEL_PARAMETER, cachability.name());
+ appendParameter(baseURL, Constants.CACHELEVEL_PARAMETER, cachability.name(), wantEscapeXML);
}
StateString resourceState = resourceURL.getResourceState();
if (resourceState != null && !resourceState.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, RESOURCE_STATE_PARAM_NAME, resourceState.getStringValue());
+ appendParameter(baseURL, RESOURCE_STATE_PARAM_NAME, resourceState.getStringValue(), wantEscapeXML);
}
}
else
@@ -187,12 +194,12 @@
{
for (String value : values)
{
- appendParameter(baseURL, key, value);
+ appendParameter(baseURL, key, value, wantEscapeXML);
}
}
else
{
- appendParameter(baseURL, "removePP", key);
+ appendParameter(baseURL, "removePP", key, wantEscapeXML);
}
}
}
@@ -201,11 +208,18 @@
return baseURL.toString();
}
- private void appendParameter(StringBuilder builder, String name, String value)
+ private void appendParameter(StringBuilder builder, String name, String value, boolean wantEscapeXML)
{
if (value != null)
{
- builder.append(AMP).append(name).append(EQ).append(value);
+ if (wantEscapeXML)
+ {
+ builder.append(XMLAMP).append(name).append(EQ).append(value);
+ }
+ else
+ {
+ builder.append(AMP).append(name).append(EQ).append(value);
+ }
}
}
}
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -118,6 +118,8 @@
private static final String WSRP_PREFER_OPERATION = "wsrp-preferOperation";
private static final String WSRP_REQUIRES_REWRITE = "wsrp-requiresRewrite";
private static final String WSRP_NAVIGATIONAL_VALUES = "wsrp-navigationalValues";
+ private static final AbstractPortalContext PORTAL_CONTEXT = new AbstractPortalContext(Collections.singletonMap(
+ "javax.portlet.markup.head.element.support", "true"));
/** . */
private String storageId;
@@ -863,8 +865,7 @@
//TODO: ExoUserContext impl not tested
invocation.setUserContext(new ExoUserContext(servletRequest, userProfile));
invocation.setWindowContext(new AbstractWindowContext(storageName));
- invocation.setPortalContext(new AbstractPortalContext(Collections.singletonMap(
- "javax.portlet.markup.head.element.support", "true")));
+ invocation.setPortalContext(PORTAL_CONTEXT);
invocation.setSecurityContext(new AbstractSecurityContext(servletRequest));
//
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -388,7 +388,19 @@
if (portletResponse instanceof ErrorResponse)
{
ErrorResponse errorResponse = (ErrorResponse)portletResponse;
- throw (Exception)errorResponse.getCause();
+ if (errorResponse.getCause() != null)
+ {
+ throw (Exception)errorResponse.getCause();
+ }
+ else if (errorResponse.getMessage() != null)
+ {
+ throw new Exception("Received an error response with message : " + errorResponse.getMessage());
+ }
+ else
+ {
+ throw new Exception("Received an error response.");
+ }
+
}
else
{
Modified: epp/portal/branches/EPP_5_1_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-11-11 16:24:41 UTC (rev 5045)
+++ epp/portal/branches/EPP_5_1_Branch/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-11-11 18:25:34 UTC (rev 5046)
@@ -58,7 +58,7 @@
protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
- String baseUrl = getBaseURL().replaceAll("&", AMP);
+ String baseUrl = getBaseURL();
builder.append(baseUrl).append(AMP).append(UIComponent.UICOMPONENT).append(EQUALS).append(
targetComponent.getId());
15 years, 5 months