gatein SVN: r4645 - in portal/branches/branch-GTNPORTAL-1537: server/tomcat/patch/src/main/tomcat/conf and 1 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-10-12 21:41:23 -0400 (Tue, 12 Oct 2010)
New Revision: 4645
Added:
portal/branches/branch-GTNPORTAL-1537/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml
Modified:
portal/branches/branch-GTNPORTAL-1537/server/tomcat/patch/src/main/tomcat/conf/server.xml
portal/branches/branch-GTNPORTAL-1537/web/rest/src/main/webapp/WEB-INF/web.xml
Log:
GTNPORTAL-1550 Add session listeners to rest.war to free memory
Added: portal/branches/branch-GTNPORTAL-1537/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml (rev 0)
+++ portal/branches/branch-GTNPORTAL-1537/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml 2010-10-13 01:41:23 UTC (rev 4645)
@@ -0,0 +1,168 @@
+<Server>
+
+ <!-- Optional listener which ensures correct init and shutdown of APR,
+ and provides information if it is not installed -->
+ <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener" />
+
+ <Service name="jboss.web">
+
+ <!-- A HTTP/1.1 Connector on port 8080 -->
+ <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
+ connectionTimeout="20000" redirectPort="8443" />
+
+ <!-- Add this option to the connector to avoid problems with
+ .NET clients that don't implement HTTP/1.1 correctly
+ restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
+ -->
+
+ <!-- A AJP 1.3 Connector on port 8009 -->
+ <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
+ redirectPort="8443" />
+
+ <!-- SSL/TLS Connector configuration using the admin devl guide keystore
+ <Connector protocol="HTTP/1.1" SSLEnabled="true"
+ port="8443" address="${jboss.bind.address}"
+ scheme="https" secure="true" clientAuth="false"
+ keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
+ keystorePass="rmi+ssl" sslProtocol = "TLS" />
+ -->
+
+ <Engine name="jboss.web" defaultHost="localhost">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm className="org.jboss.web.tomcat.security.JBossWebRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. See the
+ "jboss-web-clusteredsso-beans.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see non-clustered valve above
+
+ cacheConfig Name of the CacheManager service configuration
+ to use for the clustered SSO cache. See
+ deploy/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml
+ Default is "clustered-sso".
+
+ treeCacheName Deprecated. Use "cacheConfig".
+ JMX ObjectName of the JBoss Cache MBean used to
+ support credential caching and replication across
+ the cluster. Only used if no cache can be located
+ from the CacheManager service using the "cacheConfig"
+ attribute (or its default value). If not set, the
+ default is "jboss.cache:service=TomcatClusteringCache"
+
+ maxEmptyLife The maximum number of seconds an SSO with no
+ active sessions will be usable by a request
+
+ processExpiresInterval The minimum number of seconds between
+ efforts by the valve to find and invalidate
+ SSO's that have exceeded their 'maxEmptyLife'.
+ Does not imply effort will be spent on such
+ cleanup every 'processExpiresInterval'.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+
+ <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
+ cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
+ transactionManagerObjectName="jboss:service=TransactionManager" />
+
+ </Host>
+ </Engine>
+
+ </Service>
+
+</Server>
Modified: portal/branches/branch-GTNPORTAL-1537/server/tomcat/patch/src/main/tomcat/conf/server.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/server/tomcat/patch/src/main/tomcat/conf/server.xml 2010-10-12 15:30:14 UTC (rev 4644)
+++ portal/branches/branch-GTNPORTAL-1537/server/tomcat/patch/src/main/tomcat/conf/server.xml 2010-10-13 01:41:23 UTC (rev 4645)
@@ -121,9 +121,7 @@
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
- <!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
- -->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
Modified: portal/branches/branch-GTNPORTAL-1537/web/rest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/rest/src/main/webapp/WEB-INF/web.xml 2010-10-12 15:30:14 UTC (rev 4644)
+++ portal/branches/branch-GTNPORTAL-1537/web/rest/src/main/webapp/WEB-INF/web.xml 2010-10-13 01:41:23 UTC (rev 4645)
@@ -56,7 +56,17 @@
<filter-name>RestEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-
+
+ <!-- ================================================================== -->
+ <!-- LISTENER -->
+ <!-- ================================================================== -->
+ <listener>
+ <listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+ </listener>
+
<servlet>
<servlet-name>RestServer</servlet-name>
<description>eXo - Platform REST Server</description>
@@ -74,6 +84,10 @@
<url-pattern>/*</url-pattern>
</servlet-mapping>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
<security-constraint>
<web-resource-collection>
<web-resource-name>rest</web-resource-name>
14 years, 3 months
gatein SVN: r4644 - in portal/trunk: component/wsrp/src/main/java/org/gatein/portal/wsrp and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-12 11:30:14 -0400 (Tue, 12 Oct 2010)
New Revision: 4644
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
portal/trunk/pom.xml
Log:
- Register WSRPProducer with ExoKernelIntegration-provided PortletApplicationRegistry so that it can react to ManagedObjectEvents.
- Fixed missed renaming of MOPPortalStructureProvider.
- Upgraded to WSRP 2.0.0-Beta02-SNAPSHOT.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-10-12 14:50:06 UTC (rev 4643)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-10-12 15:30:14 UTC (rev 4644)
@@ -27,6 +27,7 @@
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.portal.pc.ExoKernelIntegration;
import org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator;
import org.exoplatform.services.listener.ListenerService;
import org.gatein.common.logging.Logger;
@@ -85,11 +86,12 @@
private ConsumerRegistry consumerRegistry;
private ExoContainer container;
+ private final ExoKernelIntegration exoKernelIntegration;
private final boolean bypass;
private static final String WSRP_ADMIN_GUI_CONTEXT_PATH = "/wsrp-admin-gui";
public WSRPServiceIntegration(ExoContainerContext context, InitParams params, ConfigurationManager configurationManager,
- org.exoplatform.portal.pc.ExoKernelIntegration pc, NodeHierarchyCreator nhc) throws Exception
+ ExoKernelIntegration pc, NodeHierarchyCreator nhc) throws Exception
{
// IMPORTANT: even though PC ExoKernelIntegration and NodeHierarchyCreator is not used anywhere in the code, it's still needed for pico
// to properly make sure that this service is started after the PC one. Yes, Pico is crap. :/
@@ -114,6 +116,8 @@
container = context.getContainer();
+ exoKernelIntegration = pc;
+
bypass = false;
}
else
@@ -124,6 +128,7 @@
producerConfigLocation = null;
consumersConfigLocation = null;
configurationIS = null;
+ exoKernelIntegration = null;
bypass = true;
}
}
@@ -212,6 +217,7 @@
producer.setPortletInvoker(wsrpPortletInvoker);
producer.setRegistrationManager(registrationManager);
producer.setConfigurationService(producerConfigurationService);
+ exoKernelIntegration.getPortletApplicationRegistry().addListener(producer);
producer.start();
}
@@ -238,7 +244,7 @@
// migration service
MigrationService migrationService = new JCRMigrationService(container);
- migrationService.setStructureProvider(new MOPPortalStructureProvider(container));
+ migrationService.setStructureProvider(new MOPConsumerStructureProvider(container));
consumerRegistry.setMigrationService(migrationService);
consumerRegistry.start();
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-10-12 14:50:06 UTC (rev 4643)
+++ portal/trunk/pom.xml 2010-10-12 15:30:14 UTC (rev 4644)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-Beta05</org.gatein.pc.version>
<org.picketlink.idm>1.1.6.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-Beta01</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.0-Beta02-SNAPSHOT</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>
14 years, 3 months
gatein SVN: r4643 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-12 10:50:06 -0400 (Tue, 12 Oct 2010)
New Revision: 4643
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java
Removed:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
Log:
- Renamed to be more conform to interface name.
Copied: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java (from rev 4617, portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java)
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java (rev 0)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPConsumerStructureProvider.java 2010-10-12 14:50:06 UTC (rev 4643)
@@ -0,0 +1,214 @@
+/*
+ * 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);
+ }
+ }
+}
Deleted: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java 2010-10-12 14:49:04 UTC (rev 4642)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java 2010-10-12 14:50:06 UTC (rev 4643)
@@ -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 MOPPortalStructureProvider implements ConsumerStructureProvider
-{
- private final POMSessionManager pomManager;
- private Map<String, PageInfo> pageInfos;
- private Map<String, String> windowIdToUUIDs;
-
- public MOPPortalStructureProvider(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);
- }
- }
-}
14 years, 3 months
gatein SVN: r4642 - portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-12 10:49:04 -0400 (Tue, 12 Oct 2010)
New Revision: 4642
Modified:
portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
Log:
- Expose PortletApplicationDeployer so that we can register the WSRPProducer as a listener of ManagedObjectEvents. Needed for GTNWSRP-45.
Modified: portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
--- portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2010-10-12 14:47:35 UTC (rev 4641)
+++ portal/trunk/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2010-10-12 14:49:04 UTC (rev 4642)
@@ -159,4 +159,9 @@
portletApplicationRegistry.stop();
}
}
+
+ public PortletApplicationDeployer getPortletApplicationRegistry()
+ {
+ return portletApplicationRegistry;
+ }
}
14 years, 3 months
gatein SVN: r4641 - in portal/branches/navcontroller: component/web/controller/src/main/java/org/exoplatform/web and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-10-12 10:47:35 -0400 (Tue, 12 Oct 2010)
New Revision: 4641
Added:
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml
Removed:
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/router.xml
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/conf/portal/configuration.xml
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java
Log:
added configuration of router and a proto router (activated via profile)
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/conf/portal/configuration.xml 2010-10-12 14:46:26 UTC (rev 4640)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/conf/portal/configuration.xml 2010-10-12 14:47:35 UTC (rev 4641)
@@ -22,11 +22,21 @@
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
<component>
<type>org.exoplatform.web.WebAppController</type>
+ <init-params>
+ <value-param>
+ <name>router.config</name>
+ <value>war:/conf/default-router.xml</value>
+ </value-param>
+ <value-param profiles="proto-router-1">
+ <name>router.config</name>
+ <value>war:/conf/proto-router-1.xml</value>
+ </value-param>
+ </init-params>
</component>
</configuration>
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java 2010-10-12 14:46:26 UTC (rev 4640)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/WebAppController.java 2010-10-12 14:47:35 UTC (rev 4641)
@@ -23,6 +23,8 @@
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.web.application.Application;
import org.exoplatform.web.controller.QualifiedName;
import org.exoplatform.web.controller.metadata.DescriptorBuilder;
@@ -77,12 +79,22 @@
* PortalController servlet (controller.register(new PortalRequestHandler())) also add the
* CommandHandler object that will listen for the incoming /command path in the URL
*
- * @throws Exception
+ * @throws Exception any exception
*/
- public WebAppController(ConfigurationManager configurationManager) throws Exception
+ public WebAppController(InitParams params, ConfigurationManager configurationManager) throws Exception
{
+
+ // Get router config
+ ValueParam routerConfig = params.getValueParam("router.config");
+ if (routerConfig == null)
+ {
+ throw new IllegalArgumentException("No router param defined");
+ }
+ String routerConfigPath = routerConfig.getValue();
+
+
// Read configuration (a bit hardcoded for now)
- URL routerURL = configurationManager.getResource("war:/conf/router.xml");
+ URL routerURL = configurationManager.getResource(routerConfigPath);
XMLStreamReader routerReader = XMLInputFactory.newInstance().createXMLStreamReader(routerURL.openStream());
RouterDescriptor routerDesc = new DescriptorBuilder().build(routerReader);
Copied: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml (from rev 4634, portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/router.xml)
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml (rev 0)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml 2010-10-12 14:47:35 UTC (rev 4641)
@@ -0,0 +1,45 @@
+<router
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_router_1_0 http://www.gatein.org/xml/ns/gatein_router_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_router_1_0">
+
+ <route path="/">
+
+ <!-- Use the portal handler -->
+ <param name="{gtn}handler" value="portal"/>
+
+ <!-- Webui parameters -->
+ <request-param name="{gtn}componentid" matchName="portal:componentId" required="false"/>
+ <request-param name="{gtn}action" matchName="portal:action" required="false"/>
+ <request-param name="{gtn}objectid" matchName="objectId" required="false"/>
+
+ <!-- Map the sitemap navigation on the /foo path -->
+<!--
+ <route path="/foo">
+ <param name="{gtn}access" value="public"/>
+ <param name="{gtn}sitename" value="classic"/>
+ <param name="{gtn}path" value="/sitemap"/>
+ </route>
+-->
+
+ <!-- The public access -->
+ <route path="/public/{{gtn}sitename}{{gtn}path:.*}">
+ <param name="{gtn}access" value="public"/>
+ </route>
+
+ <!-- The private access -->
+ <route path="/private/{{gtn}sitename}{{gtn}path:.*}">
+ <param name="{gtn}access" value="private"/>
+ </route>
+
+ </route>
+
+ <route path="/upload">
+ <param name="{gtn}handler" value="upload"/>
+ </route>
+
+ <route path="/download">
+ <param name="{gtn}handler" value="download"/>
+ </route>
+
+</router>
\ No newline at end of file
Added: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml (rev 0)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml 2010-10-12 14:47:35 UTC (rev 4641)
@@ -0,0 +1,38 @@
+<router
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_router_1_0 http://www.gatein.org/xml/ns/gatein_router_1_0"
+ xmlns="http://www.gatein.org/xml/ns/gatein_router_1_0">
+
+ <!-- A modified version of the default router that uses .html paths -->
+
+ <route path="/">
+
+ <!-- Use the portal handler -->
+ <param name="{gtn}handler" value="portal"/>
+
+ <!-- Webui parameters -->
+ <request-param name="{gtn}componentid" matchName="portal:componentId" required="false"/>
+ <request-param name="{gtn}action" matchName="portal:action" required="false"/>
+ <request-param name="{gtn}objectid" matchName="objectId" required="false"/>
+
+ <!-- The public access -->
+ <route path="/public/{{gtn}sitename}{{gtn}path:.*}.html">
+ <param name="{gtn}access" value="public"/>
+ </route>
+
+ <!-- The private access -->
+ <route path="/private/{{gtn}sitename}{{gtn}path:.*}.html">
+ <param name="{gtn}access" value="private"/>
+ </route>
+
+ </route>
+
+ <route path="/upload">
+ <param name="{gtn}handler" value="upload"/>
+ </route>
+
+ <route path="/download">
+ <param name="{gtn}handler" value="download"/>
+ </route>
+
+</router>
\ No newline at end of file
Deleted: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/router.xml
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/router.xml 2010-10-12 14:46:26 UTC (rev 4640)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/router.xml 2010-10-12 14:47:35 UTC (rev 4641)
@@ -1,43 +0,0 @@
-<router
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_router_1_0 http://www.gatein.org/xml/ns/gatein_router_1_0"
- xmlns="http://www.gatein.org/xml/ns/gatein_router_1_0">
-
- <route path="/">
-
- <!-- Use the portal handler -->
- <param name="{gtn}handler" value="portal"/>
-
- <!-- Webui parameters -->
- <request-param name="{gtn}componentid" matchName="portal:componentId" required="false"/>
- <request-param name="{gtn}action" matchName="portal:action" required="false"/>
- <request-param name="{gtn}objectid" matchName="objectId" required="false"/>
-
- <!-- Map the sitemap navigation on the /foo path -->
- <route path="/foo">
- <param name="{gtn}access" value="public"/>
- <param name="{gtn}sitename" value="classic"/>
- <param name="{gtn}path" value="/sitemap"/>
- </route>
-
- <!-- The public access -->
- <route path="/public/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}access" value="public"/>
- </route>
-
- <!-- The private access -->
- <route path="/private/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}access" value="private"/>
- </route>
-
- </route>
-
- <route path="/upload">
- <param name="{gtn}handler" value="upload"/>
- </route>
-
- <route path="/download">
- <param name="{gtn}handler" value="download"/>
- </route>
-
-</router>
\ No newline at end of file
14 years, 3 months
gatein SVN: r4640 - in components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer: handlers and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-12 10:46:26 -0400 (Tue, 12 Oct 2010)
New Revision: 4640
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
Log:
- GTNWSRP-45: Make ServiceDescriptionHandler extend ManagedObjectRegistryEventListener so that they can react to portlet deploy/undeploy events to
update the ServiceDescription cache. WSRPProducer also extends the interface so we can register it without polluting clients which already know about
the producer but not ServiceDescriptionHandler and then delegate event handling to that last one.
- Only skeletton code in ServiceDescriptionHandler so far.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-10-12 14:07:09 UTC (rev 4639)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducer.java 2010-10-12 14:46:26 UTC (rev 4640)
@@ -25,6 +25,7 @@
import org.gatein.exports.ExportManager;
import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.api.context.ProducerContext;
import org.gatein.wsrp.producer.config.ProducerConfigurationChangeListener;
@@ -35,7 +36,7 @@
* @version $Revision: 12020 $
* @since 2.4
*/
-public interface WSRPProducer extends ProducerConfigurationChangeListener
+public interface WSRPProducer extends ProducerConfigurationChangeListener, ManagedObjectRegistryEventListener
{
/**
* Retrieves the RegistrationManager used by this WSRPProducer.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-10-12 14:07:09 UTC (rev 4639)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-10-12 14:46:26 UTC (rev 4640)
@@ -30,6 +30,7 @@
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.info.RuntimeOptionInfo;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationLocal;
import org.gatein.registration.RegistrationManager;
@@ -564,4 +565,9 @@
{
return portletManagementHandler;
}
+
+ public void onEvent(ManagedObjectRegistryEvent event)
+ {
+ serviceDescriptionHandler.onEvent(event);
+ }
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java 2010-10-12 14:07:09 UTC (rev 4639)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/ServiceDescriptionHandler.java 2010-10-12 14:46:26 UTC (rev 4640)
@@ -38,6 +38,13 @@
import org.gatein.pc.api.info.PortletInfo;
import org.gatein.pc.api.info.SecurityInfo;
import org.gatein.pc.api.info.WindowStateInfo;
+import org.gatein.pc.portlet.container.managed.LifeCycleStatus;
+import org.gatein.pc.portlet.container.managed.ManagedObject;
+import org.gatein.pc.portlet.container.managed.ManagedObjectEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectLifeCycleEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEventListener;
+import org.gatein.pc.portlet.container.managed.ManagedPortletContainer;
import org.gatein.registration.Registration;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
@@ -79,7 +86,7 @@
* @version $Revision: 12017 $
* @since 2.4
*/
-public class ServiceDescriptionHandler extends ServiceHandler implements ServiceDescriptionInterface
+public class ServiceDescriptionHandler extends ServiceHandler implements ServiceDescriptionInterface, ManagedObjectRegistryEventListener
{
// JBPORTAL-1220: force call to initCookie... Required so that BEA version < 9.2 will behave properly as a Consumer
private static final CookieProtocol BEA_8_CONSUMER_FIX = CookieProtocol.PER_USER;
@@ -172,8 +179,11 @@
*/
static PortletDescription getPortletDescription(Portlet portlet, List<String> desiredLocales, ServiceDescriptionInfo sdi)
{
- org.gatein.pc.api.PortletContext context = portlet.getContext();
- PortletInfo info = portlet.getInfo();
+ return getPortletDescription(portlet.getContext(), portlet.getInfo(), desiredLocales, sdi);
+ }
+
+ private static PortletDescription getPortletDescription(org.gatein.pc.api.PortletContext context, PortletInfo info, List<String> desiredLocales, ServiceDescriptionInfo sdi)
+ {
String handle = context.getId();
if (log.isDebugEnabled())
{
@@ -317,6 +327,40 @@
return desc;
}
+ public void onEvent(ManagedObjectRegistryEvent event)
+ {
+ if (event instanceof ManagedObjectEvent)
+ {
+ ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
+ ManagedObject managedObject = managedObjectEvent.getManagedObject();
+
+ if (managedObject instanceof ManagedPortletContainer)
+ {
+ ManagedPortletContainer portletContainer = (ManagedPortletContainer)managedObject;
+ String applicationId = portletContainer.getManagedPortletApplication().getId();
+ String containerId = portletContainer.getId();
+ // need PC 2.2.0-Beta06 API support
+// org.gatein.pc.api.PortletContext pc = org.gatein.pc.api.PortletContext.createPortletContext(applicationId, containerId);
+
+ // todo: GTNWSRP-45: implement refreshing of ServiceDescriptionInfo
+ if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
+ {
+ ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
+ LifeCycleStatus status = lifeCycleEvent.getStatus();
+ if (LifeCycleStatus.STARTED.equals(status))
+ {
+ // todo: add portlet description for newly started portlet container
+// getPortletDescription(pc, portletContainer.getInfo(), )
+ }
+ else
+ {
+ // todo: remore portlet description for stopped portlet container
+ }
+ }
+ }
+ }
+ }
+
private static List<String> getLocaleNamesFrom(Collection<Locale> locales)
{
if (locales == null || locales.isEmpty())
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-10-12 14:07:09 UTC (rev 4639)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/v1/WSRP1Producer.java 2010-10-12 14:46:26 UTC (rev 4640)
@@ -25,6 +25,7 @@
import org.gatein.exports.ExportManager;
import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.portlet.container.managed.ManagedObjectRegistryEvent;
import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.api.context.ProducerContext;
import org.gatein.wsrp.producer.ProducerHolder;
@@ -787,4 +788,9 @@
throw WSRP1ExceptionFactory.createWSException(V1OperationFailed.class, "Not supported", operationNotSupported);
}
}
+
+ public void onEvent(ManagedObjectRegistryEvent event)
+ {
+ producer.onEvent(event);
+ }
}
14 years, 3 months
gatein SVN: r4639 - in components/pc/trunk: portlet/src/main/java/org/gatein/pc/portlet/container and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-12 10:07:09 -0400 (Tue, 12 Oct 2010)
New Revision: 4639
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
Log:
- GTNPC-33: Created PortletContext.create(String portletApplicationId, String portletContainerId) method to encapsulate portlet context creation logic.
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-10-12 12:03:15 UTC (rev 4638)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletContext.java 2010-10-12 14:07:09 UTC (rev 4639)
@@ -132,7 +132,7 @@
/**
* Create a PortletContext based on given id and required state: this method will fail if state is not valid. Use
- * this method instead of {@link #createPortletContext(String,byte[])} for cases when a state is expected and the
+ * this method instead of {@link #createPortletContext(String, byte[])} for cases when a state is expected and the
* creation of the PortletContext should fail if no state was given.
*
* @param id the portlet id
@@ -147,7 +147,7 @@
public static PortletContext createPortletContext(String portletId)
{
- return createPortletContext(portletId, null);
+ return createPortletContext(portletId, (byte[])null);
}
public String getApplicationName()
@@ -159,4 +159,9 @@
{
return portletName;
}
+
+ public static PortletContext createPortletContext(String portletApplicationId, String containerId)
+ {
+ return PortletContext.createPortletContext(portletApplicationId + SEPARATOR + containerId);
+ }
}
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-10-12 12:03:15 UTC (rev 4638)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/container/ContainerPortletInvoker.java 2010-10-12 14:07:09 UTC (rev 4639)
@@ -206,8 +206,7 @@
public PortletImpl(PortletContainer container)
{
this.container = container;
- this.context = PortletContext.createPortletContext(container.getPortletApplication().getId() + "." + container.getId());
- //this.context = PortletContext.createPortletContext(container.getPortletApplication().getId().substring(1) + "/" + container.getId());
+ this.context = PortletContext.createPortletContext(container.getPortletApplication().getId(), container.getId());
}
public PortletContext getContext()
14 years, 3 months
gatein SVN: r4638 - in portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main: webapp/WEB-INF and 1 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-10-12 08:03:15 -0400 (Tue, 12 Oct 2010)
New Revision: 4638
Modified:
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
GTNPORTAL-1517 Always keep old search result in after search user in User management
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-10-12 12:03:15 UTC (rev 4638)
@@ -110,26 +110,23 @@
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
UIApplication uiApp = context.getUIApplication();
String username = getUIStringInput(USERNAME).getValue();
- User user = service.getUserHandler().findUserByName(username);
- String oldEmail = user.getEmail();
+ User user = service.getUserHandler().findUserByName(username);
if (user == null)
{
uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null, ApplicationMessage.WARNING));
UIUserInfo userInfo = getParent();
if (userInfo != null)
{
- UIUserManagement userManagement = userInfo.getParent();
- UIListUsers listUser = userManagement.getChild(UIListUsers.class);
UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
userInfo.setRenderSibling(UIListUsers.class);
- listUser.search(new Query());
accountInput.reset();
userProfile.reset();
context.setProcessRender(true);
}
return false;
}
+ String oldEmail = user.getEmail();
invokeSetBindingField(user);
if (isChangePassword())
{
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2010-10-12 12:03:15 UTC (rev 4638)
@@ -91,7 +91,6 @@
grid_.configure(USER_NAME, USER_BEAN_FIELD, USER_ACTION);
grid_.getUIPageIterator().setId("UIListUsersIterator");
grid_.getUIPageIterator().setParent(this);
- search(new Query());
}
/**
@@ -117,18 +116,12 @@
public String getUserSelected()
{
return userSelected_;
- }
+ }
public void search(Query query) throws Exception
{
lastQuery_ = query;
- grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));
- UIPageIterator pageIterator = grid_.getUIPageIterator();
- if (pageIterator.getAvailable() == 0)
- {
- UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
- uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
- }
+ grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));
}
public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
@@ -137,29 +130,33 @@
UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
String name = input.getValue();
- if (name == null || name.equals(""))
+ if (name != null && !name.equals(""))
{
- search(new Query());
- return;
- }
- if (name.indexOf("*") < 0)
+ if (name.indexOf("*") < 0)
+ {
+ if (name.charAt(0) != '*')
+ name = "*" + name;
+ if (name.charAt(name.length() - 1) != '*')
+ name += "*";
+ }
+ name = name.replace('?', '_');
+ String selectBoxValue = select.getValue();
+ if (selectBoxValue.equals(USER_NAME))
+ query.setUserName(name);
+ if (selectBoxValue.equals(LAST_NAME))
+ query.setLastName(name);
+ if (selectBoxValue.equals(FIRST_NAME))
+ query.setFirstName(name);
+ if (selectBoxValue.equals(EMAIL))
+ query.setEmail(name);
+ }
+ search(query);
+
+ if (getChild(UIGrid.class).getUIPageIterator().getAvailable() == 0)
{
- if (name.charAt(0) != '*')
- name = "*" + name;
- if (name.charAt(name.length() - 1) != '*')
- name += "*";
+ UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
}
- name = name.replace('?', '_');
- String selectBoxValue = select.getValue();
- if (selectBoxValue.equals(USER_NAME))
- query.setUserName(name);
- if (selectBoxValue.equals(LAST_NAME))
- query.setLastName(name);
- if (selectBoxValue.equals(FIRST_NAME))
- query.setFirstName(name);
- if (selectBoxValue.equals(EMAIL))
- query.setEmail(name);
- search(query);
}
@SuppressWarnings("unused")
@@ -176,7 +173,9 @@
OrganizationService service = uiListUsers.getApplicationComponent(OrganizationService.class);
if (service.getUserHandler().findUserByName(username) == null)
{
- uiListUsers.search(new Query());
+ UIApplication uiApplication = event.getRequestContext().getUIApplication();
+ uiApplication.addMessage(new ApplicationMessage("UIListUsers.msg.user-is-deleted",
+ null, ApplicationMessage.WARNING));
return;
}
uiListUsers.setRendered(false);
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2010-10-12 12:03:15 UTC (rev 4638)
@@ -70,8 +70,10 @@
{
public void execute(Event<UIOrganizationPortlet> event) throws Exception
{
- UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
- uiListUsers.search(new Query());
+ //Actually we don't need to do anything here
+ //UIListUsers will have the lasteast data in it's processRender method
+// UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
+// uiListUsers.search(new Query());
}
}
}
\ No newline at end of file
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-10-12 12:03:15 UTC (rev 4638)
@@ -143,12 +143,9 @@
Util.getPortalRequestContext().setFullRender(true);
}
- UIUserManagement userManagement = uiUserInfo.getParent();
- UIListUsers listUser = userManagement.getChild(UIListUsers.class);
UIAccountEditInputSet accountInput = uiUserInfo.getChild(UIAccountEditInputSet.class);
UIUserProfileInputSet userProfile = uiUserInfo.getChild(UIUserProfileInputSet.class);
uiUserInfo.setRenderSibling(UIListUsers.class);
- listUser.search(new Query());
accountInput.reset();
userProfile.reset();
event.getRequestContext().setProcessRender(true);
@@ -160,12 +157,9 @@
public void execute(Event<UIUserInfo> event) throws Exception
{
UIUserInfo userInfo = event.getSource();
- UIUserManagement userManagement = userInfo.getParent();
- UIListUsers listUser = userManagement.getChild(UIListUsers.class);
UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
userInfo.setRenderSibling(UIListUsers.class);
- listUser.search(new Query());
accountInput.reset();
userProfile.reset();
event.getRequestContext().setProcessRender(true);
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2010-10-12 12:03:15 UTC (rev 4638)
@@ -79,7 +79,8 @@
UIListUsers.label.option.lastName=#{word.lastName}
UIListUsers.label.option.email=#{word.email}
UIListUsers.msg.DeleteSuperUser={0} is Super User, it can not be deleted
-UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.msg.user-is-deleted=This user may be deleted.
UIListMembershipType.deleteMemberShip=Are you sure you want to delete this membership?
Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-10-12 12:03:15 UTC (rev 4638)
@@ -79,6 +79,9 @@
<short-title>Account Portlet</short-title>
<keywords>Administration</keywords>
</portlet-info>
+ <supported-publishing-event>
+ <name>NewAccountAdded</name>
+ </supported-publishing-event>
</portlet>
<portlet>
14 years, 3 months
gatein SVN: r4637 - portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-10-12 06:14:07 -0400 (Tue, 12 Oct 2010)
New Revision: 4637
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java
Log:
minor
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java 2010-10-12 10:11:29 UTC (rev 4636)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java 2010-10-12 10:14:07 UTC (rev 4637)
@@ -20,7 +20,8 @@
package org.exoplatform.web.controller;
/**
- * A qualified name that is a qualifier and a name.
+ * A qualified name that is a qualifier and a name. It can be seen as a simplified version of an XML QName
+ * that retains only the prefix (qualifier) and the local name (name) and leaves out the namespace.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -51,7 +52,7 @@
private final String name;
/**
- * Creates a qualified name with an empty qualifier.
+ * Creates a qualified name with an empty string qualifier.
*
* @param name the name
*/
@@ -128,6 +129,6 @@
@Override
public String toString()
{
- return "QName[prefix=" + qualifier + ",name=" + name + "]";
+ return "QualifiedName[prefix=" + qualifier + ",name=" + name + "]";
}
}
14 years, 3 months
gatein SVN: r4636 - portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-10-12 06:11:29 -0400 (Tue, 12 Oct 2010)
New Revision: 4636
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Router.java
Log:
javadoc
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-10-12 10:06:09 UTC (rev 4635)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-10-12 10:11:29 UTC (rev 4636)
@@ -20,16 +20,37 @@
package org.exoplatform.web.controller.router;
/**
+ * The render context provides callback when URL generation is performed by the {@link Router#render(java.util.Map)}
+ * method.
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
public interface RenderContext
{
- void appendPath(char s);
+ /**
+ * Append a char to the path.
+ *
+ * @param c the char to append
+ */
+ void appendPath(char c);
+ /**
+ * Append a string to the path.
+ *
+ * @param s the string to append.
+ */
void appendPath(String s);
+ /**
+ * Append a query parameter to the parameter set. Note that the query parameters are ordered
+ * and the sequence of call to this method should be honoured when an URL is generated. Note also that
+ * the same parameter name can be used multiple times.
+ *
+ * @param parameterName the parameter name
+ * @param paramaterValue the parameter value
+ */
void appendQueryParameter(String parameterName, String paramaterValue);
}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Router.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Router.java 2010-10-12 10:06:09 UTC (rev 4635)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Router.java 2010-10-12 10:11:29 UTC (rev 4636)
@@ -28,6 +28,8 @@
import java.util.Map;
/**
+ * The router takes care of mapping a request to a a map.
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
14 years, 3 months