gatein SVN: r922 - in portal/trunk: web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIMaskWorkspace and 1 other directory.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2009-12-04 03:14:40 -0500 (Fri, 04 Dec 2009)
New Revision: 922
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIMaskWorkspace/Stylesheet.css
Log:
PLF-26:Error displaying in add group navigation form with Default and Vista skin
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-12-04 06:53:15 UTC (rev 921)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-12-04 08:14:40 UTC (rev 922)
@@ -26,6 +26,7 @@
.UIManagement .ManagementBlock {
background: #f8f8f8 url('background/BgEvenRow.gif') repeat-x left top;
margin-bottom: 1px;
+ _width: 97%;
}
.UIManagement .EvenRow {
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIMaskWorkspace/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIMaskWorkspace/Stylesheet.css 2009-12-04 06:53:15 UTC (rev 921)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIMaskWorkspace/Stylesheet.css 2009-12-04 08:14:40 UTC (rev 922)
@@ -38,12 +38,12 @@
}
.UIMaskWorkspace .MiddleLeftDecorator {
- background: url('background/MiddleMaskWorkspace.png') repeat-y left;
+ background: url('background/MiddleMaskWorkspace.png') repeat-y left top;
padding: 0px 0px 0px 10px;
}
.UIMaskWorkspace .MiddleRightDecorator {
- background: url('background/MiddleMaskWorkspace.png') repeat-y right;
+ background: url('background/MiddleMaskWorkspace.png') repeat-y right top;
padding: 0px 11px 0px 0px;
}
15 years
gatein SVN: r921 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-12-04 01:53:15 -0500 (Fri, 04 Dec 2009)
New Revision: 921
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-341: Unknown error when click portal properties in edit layout of group
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-04 04:57:46 UTC (rev 920)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-04 06:53:15 UTC (rev 921)
@@ -283,16 +283,29 @@
{
UIComponent temp = null;
UIPortal uiPortal = null;
+ String portalOwner = null;
UIEditInlineWorkspace uiEditWS = event.getSource().getAncestorOfType(UIEditInlineWorkspace.class);
temp = uiEditWS.getUIComponent();
if(temp != null && (temp instanceof UIPortal))
+ {
uiPortal = (UIPortal)temp;
+ if(uiPortal.getOwnerType().equals(PortalConfig.PORTAL_TYPE))
+ {
+ portalOwner = uiPortal.getOwner();
+ }
+ else
+ portalOwner = Util.getPortalRequestContext().getPortalOwner();
+ }
else
+ {
uiPortal = Util.getUIPortal();
+ portalOwner = Util.getPortalRequestContext().getPortalOwner();
+ }
+
UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
- portalForm.setPortalOwner(uiPortal.getOwner());
+ portalForm.setPortalOwner(portalOwner);
portalForm.setBindingBean();
if(PortalConfig.USER_TYPE.equals(uiPortal.getOwnerType())){
portalForm.removeChildById("PermissionSetting");
15 years
gatein SVN: r920 - in portal/trunk: web/portal/src/main/webapp/groovy/webui/core and 1 other directories.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-12-03 23:57:46 -0500 (Thu, 03 Dec 2009)
New Revision: 920
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
Log:
GTNPORTAL-335: Can't select sub-page on menu item in special case
re-fix this issue
Modified: portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
===================================================================
--- portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04 02:33:50 UTC (rev 919)
+++ portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04 04:57:46 UTC (rev 920)
@@ -81,15 +81,7 @@
}
UIBreadcumbs uiBreadCumbs = getChild(UIBreadcumbs.class);
uiBreadCumbs.setPath(paths);
- }
-
- public boolean isUseAjax()
- {
- PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- PortletRequest prequest = context.getRequest();
- PortletPreferences prefers = prequest.getPreferences();
- return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
- }
+ }
@Override
public void renderChildren() throws Exception
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04 02:33:50 UTC (rev 919)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04 04:57:46 UTC (rev 920)
@@ -1,7 +1,6 @@
<%
import java.util.List;
import org.exoplatform.portal.webui.util.Util;
- import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.portal.application.PortalRequestContext;
List list = uicomponent.getPath();
@@ -9,10 +8,8 @@
PortalRequestContext pcontext = Util.getPortalRequestContext();
def String portalURI = pcontext.getPortalURI();
-
- UIPortletApplication breadcumbsPortlet = uicomponent.getParent();
-
- def useAJAX = breadcumbsPortlet.isUseAjax();
+
+ def useAJAX = uicomponent.isUseAjax();
%>
<div class="UIBreadcumbs">
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2009-12-04 02:33:50 UTC (rev 919)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIBreadcumbs.java 2009-12-04 04:57:46 UTC (rev 920)
@@ -19,6 +19,8 @@
package org.exoplatform.webui.core;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIBreadcumbs.SelectPathActionListener;
@@ -29,6 +31,9 @@
import java.util.ArrayList;
import java.util.List;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+
/**
* Represents a breadcrumbs component.
*
@@ -100,6 +105,18 @@
{
styleBread = style;
}
+
+ public boolean isUseAjax()
+ {
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ if(context instanceof PortletRequestContext)
+ {
+ PortletRequest prequest = ((PortletRequestContext)context).getRequest();
+ PortletPreferences prefers = prequest.getPreferences();
+ return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
+ }
+ return true;
+ }
static public class SelectPathActionListener extends EventListener<UIBreadcumbs>
{
15 years
gatein SVN: r919 - in portal/trunk: portlet/web/src/main/webapp/WEB-INF and 1 other directories.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-12-03 21:33:50 -0500 (Thu, 03 Dec 2009)
New Revision: 919
Modified:
portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
Log:
GTNPORTAL-335: Can't select sub-page on menu item in special case
Modified: portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java
===================================================================
--- portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-03 22:53:18 UTC (rev 918)
+++ portal/trunk/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UIBreadcumbsPortlet.java 2009-12-04 02:33:50 UTC (rev 919)
@@ -82,6 +82,14 @@
UIBreadcumbs uiBreadCumbs = getChild(UIBreadcumbs.class);
uiBreadCumbs.setPath(paths);
}
+
+ public boolean isUseAjax()
+ {
+ PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
+ PortletRequest prequest = context.getRequest();
+ PortletPreferences prefers = prequest.getPreferences();
+ return Boolean.valueOf(prefers.getValue("useAJAX", "true"));
+ }
@Override
public void renderChildren() throws Exception
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-03 22:53:18 UTC (rev 918)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-04 02:33:50 UTC (rev 919)
@@ -150,7 +150,12 @@
</portlet-info>
<portlet-preferences>
- <preference>
+ <preference>
+ <name>useAJAX</name>
+ <value>false</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
<name>template</name>
<value>system:/groovy/webui/core/UIBreadcumbs.gtmpl</value>
<read-only>false</read-only>
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-03 22:53:18 UTC (rev 918)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIBreadcumbs.gtmpl 2009-12-04 02:33:50 UTC (rev 919)
@@ -1,8 +1,18 @@
<%
import java.util.List;
+ import org.exoplatform.portal.webui.util.Util;
+ import org.exoplatform.webui.core.UIPortletApplication;
+ import org.exoplatform.portal.application.PortalRequestContext;
List list = uicomponent.getPath();
def styleBread = uicomponent.getBreadcumbsStyle();
+
+ PortalRequestContext pcontext = Util.getPortalRequestContext();
+ def String portalURI = pcontext.getPortalURI();
+
+ UIPortletApplication breadcumbsPortlet = uicomponent.getParent();
+
+ def useAJAX = breadcumbsPortlet.isUseAjax();
%>
<div class="UIBreadcumbs">
@@ -13,8 +23,12 @@
<%if(list.size() > 0) {
String note = "LeftBlock";
for(i in 0 .. list.size()-1) {
- localPath = list.get(i);
- String actionLink = uicomponent.event("SelectPath", localPath.getId());
+ localPath = list.get(i);
+ String actionLink
+ if(useAJAX)
+ actionLink = uicomponent.event("SelectPath", localPath.getId());
+ else
+ actionLink = portalURI + localPath.getId();
if(i == list.size()-1) note = "Selected";
%>
<a href="<%=(localPath.getId() == null) ? "#" : actionLink%>" class="$note">$localPath.label</a>
15 years
gatein SVN: r918 - in components/wsrp/trunk/producer/src: main/java/org/gatein/registration/impl and 4 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-03 17:53:18 -0500 (Thu, 03 Dec 2009)
New Revision: 918
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/ConsumerGroup.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerGroupImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerGroupSPI.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerSPI.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java
Log:
- Renamed Registration.getId to getPersistentKey to be consistent and avoid confusion with Consumer.getId
- Added factory methods on RegistrationPersistenceManagerImpl to allow retrieval of new objects without triggering creation of associations and persistence.
- Fixed improper RegistrationContext in RegistrationHandler (which should have been using Registration.getRegistrationHandle instead of getPersistentKey)
and added associated test case. Note that the case would have passed before but it was just an implementation coincidence.
- Added persistent key concept on both ConsumerSPI and ConsumerGroupSPI to be able to deal with persistence better.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Consumer.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -90,4 +90,11 @@
String getConsumerAgent();
void setConsumerAgent(String consumerAgent) throws IllegalArgumentException, IllegalStateException;
+
+ /**
+ * Retrieves this Consumer's internal persistent key which would correspond to a primary key in a database.
+ *
+ * @return
+ */
+ String getPersistentKey();
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/ConsumerGroup.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/ConsumerGroup.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/ConsumerGroup.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -43,6 +43,13 @@
String getName();
/**
+ * Return this ConsumerGroup's persistent identifier.
+ *
+ * @return this ConsumerGroup's persistent identifier
+ */
+ String getPersistentKey();
+
+ /**
* Return a collection of associated consumers.
*
* @return the consumer collection
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -42,7 +42,7 @@
*
* @return this Registration's internal identifier.
*/
- String getId();
+ String getPersistentKey();
/**
* Sets the handle for this Registration.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerGroupImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerGroupImpl.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerGroupImpl.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -40,7 +40,7 @@
*/
public class ConsumerGroupImpl implements ConsumerGroupSPI
{
-
+ private String key;
private String name;
private Map<String, Consumer> consumers;
private RegistrationStatus status;
@@ -68,7 +68,16 @@
return name;
}
+ public String getPersistentKey()
+ {
+ return key;
+ }
+ public void setPersistentKey(String id)
+ {
+ this.key = id;
+ }
+
public boolean equals(Object o)
{
if (this == o)
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerImpl.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/ConsumerImpl.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -53,6 +53,7 @@
private RegistrationStatus status;
private ConsumerGroup group;
private ConsumerCapabilities capabilities;
+ private String key;
private ConsumerImpl()
@@ -124,6 +125,11 @@
}
}
+ public String getPersistentKey()
+ {
+ return key;
+ }
+
public ConsumerCapabilities getCapabilities()
{
return capabilities;
@@ -162,6 +168,11 @@
registrations.add(registration);
}
+ public void setPersistentKey(String key)
+ {
+ this.key = key;
+ }
+
public void removeRegistration(RegistrationSPI registration) throws RegistrationException
{
ParameterValidation.throwIllegalArgExceptionIfNull(registration, "Registration");
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -42,24 +42,24 @@
public class RegistrationImpl implements RegistrationSPI
{
- private final String id;
+ private final String key;
private ConsumerSPI consumer;
private RegistrationStatus status;
private Map<QName, Object> properties;
private String registrationHandle;
- public RegistrationImpl(String id, ConsumerSPI consumer, RegistrationStatus status, Map properties)
+ public RegistrationImpl(String key, ConsumerSPI consumer, RegistrationStatus status, Map properties)
{
- this.id = id;
+ this.key = key;
this.consumer = consumer;
this.status = status;
this.properties = new HashMap<QName, Object>(properties);
}
- public String getId()
+ public String getPersistentKey()
{
- return id;
+ return key;
}
public void setRegistrationHandle(String handle)
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationManagerImpl.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -28,13 +28,13 @@
import org.gatein.registration.ConsumerGroup;
import org.gatein.registration.InvalidConsumerDataException;
import org.gatein.registration.NoSuchRegistrationException;
-import org.gatein.wsrp.registration.PropertyDescription;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationException;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.RegistrationStatus;
+import org.gatein.wsrp.registration.PropertyDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -97,7 +97,7 @@
Registration registration = persistenceManager.addRegistrationFor(identity, registrationProperties);
// let the policy decide what the handle should be
- String handle = policy.createRegistrationHandleFor(registration.getId());
+ String handle = policy.createRegistrationHandleFor(registration.getPersistentKey());
registration.setRegistrationHandle(handle);
return registration;
@@ -236,7 +236,7 @@
registration.setStatus(RegistrationStatus.INVALID); // just in case...
// registration.clearAssociatedState(); // todo: do we need to clear associated state?
- persistenceManager.removeRegistration(registration.getId());
+ persistenceManager.removeRegistration(registration.getPersistentKey());
}
public ConsumerGroup getConsumerGroup(String groupName) throws RegistrationException
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationPersistenceManagerImpl.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -90,7 +90,7 @@
@Override
protected void internalAddRegistration(RegistrationSPI registration)
{
- registrations.put(registration.getId(), registration);
+ registrations.put(registration.getPersistentKey(), registration);
}
@Override
@@ -102,9 +102,14 @@
@Override
protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map registrationProperties)
{
- return new RegistrationImpl("" + lastRegistrationId++, consumer, RegistrationStatus.PENDING, registrationProperties);
+ return newRegistrationSPI(consumer, registrationProperties, "" + lastRegistrationId++);
}
+ public RegistrationSPI newRegistrationSPI(ConsumerSPI consumer, Map registrationProperties, String registrationKey)
+ {
+ return new RegistrationImpl(registrationKey, consumer, RegistrationStatus.PENDING, registrationProperties);
+ }
+
@Override
protected void internalAddConsumer(ConsumerSPI consumer)
{
@@ -120,6 +125,11 @@
@Override
protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
{
+ return newConsumerSPI(consumerId, consumerName);
+ }
+
+ public ConsumerSPI newConsumerSPI(String consumerId, String consumerName)
+ {
return new ConsumerImpl(consumerId, consumerName);
}
@@ -138,6 +148,11 @@
@Override
protected ConsumerGroupSPI internalCreateConsumerGroup(String name)
{
+ return newConsumerGroupSPI(name);
+ }
+
+ public ConsumerGroupSPI newConsumerGroupSPI(String name)
+ {
return new ConsumerGroupImpl(name);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerGroupSPI.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerGroupSPI.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerGroupSPI.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -30,4 +30,6 @@
*/
public interface ConsumerGroupSPI extends ConsumerGroup
{
+
+ void setPersistentKey(String id);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerSPI.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerSPI.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/spi/ConsumerSPI.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -34,4 +34,6 @@
void removeRegistration(RegistrationSPI registration) throws RegistrationException;
void addRegistration(RegistrationSPI registration);
+
+ void setPersistentKey(String key);
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RegistrationHandler.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -23,9 +23,9 @@
package org.gatein.wsrp.producer;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.WindowState;
-import org.gatein.common.util.ParameterValidation;
import org.gatein.registration.Consumer;
import org.gatein.registration.ConsumerCapabilities;
import org.gatein.registration.NoSuchRegistrationException;
@@ -99,7 +99,7 @@
msg, e);
}
- RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registration.getId());
+ RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registration.getRegistrationHandle());
log.debug("Registration completed without error.");
return registrationContext;
}
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -302,7 +302,7 @@
consumer = getManager().getConsumerById("Bar");
Registration reg1 = getManager().addRegistrationFor("Bar", registrationProperties);
assertNotNull(reg1);
- String regId = reg1.getId();
+ String regId = reg1.getPersistentKey();
assertNotNull(regId);
assertEquals(consumer, reg1.getConsumer());
Map expectedProps = new HashMap();
@@ -318,7 +318,7 @@
assertNotNull(registrations);
assertEquals(1, registrations.size());
Registration reg3 = (Registration)registrations.iterator().next();
- assertEquals(regId, reg3.getId());
+ assertEquals(regId, reg3.getPersistentKey());
assertEquals(consumer, reg3.getConsumer());
assertEquals(expectedProps, reg3.getProperties());
stopInteraction();
@@ -328,7 +328,7 @@
Registration reg2 = getManager().getRegistration(regId);
consumer = getManager().getConsumerById("Bar");
assertNotNull(reg2);
- assertEquals(regId, reg2.getId());
+ assertEquals(regId, reg2.getPersistentKey());
assertEquals(consumer, reg2.getConsumer());
assertEquals(expectedProps, reg2.getProperties());
stopInteraction();
@@ -373,7 +373,7 @@
Consumer consumer = getManager().createConsumer("Bar", "Bar");
group.addConsumer(consumer);
Registration reg = getManager().addRegistrationFor("Bar", registrationProperties);
- String regId = reg.getId();
+ String regId = reg.getPersistentKey();
getManager().removeRegistration(regId);
stopInteraction();
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/registration/RegistrationManagerTestCase.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -70,7 +70,7 @@
{
Registration registration = manager.addRegistrationTo("consumerName", registrationProperties, true);
assertNotNull(registration);
- assertNotNull(registration.getId());
+ assertNotNull(registration.getPersistentKey());
Consumer consumer = manager.getConsumerByIdentity("consumerName");
assertNotNull(consumer); // default policy: name == identity
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java 2009-12-03 13:12:31 UTC (rev 917)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/protocol/v1/RegistrationTestCase.java 2009-12-03 22:53:18 UTC (rev 918)
@@ -23,6 +23,9 @@
package org.gatein.wsrp.protocol.v1;
+import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationManager;
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
@@ -31,6 +34,7 @@
import org.oasis.wsrp.v1.GetMarkup;
import org.oasis.wsrp.v1.GetServiceDescription;
import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.MissingParameters;
import org.oasis.wsrp.v1.ModifyRegistration;
import org.oasis.wsrp.v1.OperationFailed;
import org.oasis.wsrp.v1.PropertyDescription;
@@ -93,6 +97,27 @@
registrationService.register(regData);
}
+ public void testRegistrationHandle() throws OperationFailed, MissingParameters, RegistrationException
+ {
+ // check that a registration handle was created
+ RegistrationContext rc = registerConsumer();
+ String registrationHandle = rc.getRegistrationHandle();
+ assertNotNull(registrationHandle);
+
+ // check that a registration was created with that handle
+ RegistrationManager registrationManager = producer.getRegistrationManager();
+ Registration registration = registrationManager.getRegistration(registrationHandle);
+ assertNotNull(registration);
+
+ // check that the registration was persisted...
+ String key = registration.getPersistentKey();
+ assertNotNull(key);
+
+ // ... and that the handle was created by the policy based on the registration key
+ String expectedHandle = registrationManager.getPolicy().createRegistrationHandleFor(key);
+ assertEquals(expectedHandle, registrationHandle);
+ }
+
public void testDeregister() throws Exception
{
// initiate registration
15 years
gatein SVN: r917 - portal/trunk/docs/reference-guide/en/modules/development.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-03 08:12:31 -0500 (Thu, 03 Dec 2009)
New Revision: 917
Modified:
portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
Log:
More doc
Modified: portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml 2009-12-03 11:26:41 UTC (rev 916)
+++ portal/trunk/docs/reference-guide/en/modules/development/Internationalization_Configuration.xml 2009-12-03 13:12:31 UTC (rev 917)
@@ -2,127 +2,150 @@
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>
<section id="sect-Reference_Guide-Internationalization_Configuration">
- <!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
- --><title>Internationalization Configuration</title>
+ <title>Internationalization Configuration</title>
<section id="sect-Reference_Guide-Internationalization_Configuration-Overview">
<title>Overview</title>
<para>
- All aspects of internationalization in GateIn products are covered. You should have a general knowledge of Internationalization in Java products. Sun created a <ulink url=" http://java:sun.com-docs-books-tutorial-i18n-TOC.html">good internationalization tutorial</ulink> .
+ All aspects of internationalization in GateIn products are covered. You should have a general knowledge of Internationalization in Java products. Sun created a <ulink url="http://java.sun.com/docs/books/tutorial/i18n/TOC.html">good internationalization tutorial</ulink> .
</para>
<section id="sect-Reference_Guide-Overview-Introduction">
<title>Introduction</title>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- typical locale file can be found in:
- </para>
- </listitem>
- <listitem>
- <para>
- .../WEB-INF/classes/locale/navigation/group/organization/management/executive-board
- </para>
- </listitem>
- </orderedlist>
+ <para>All embedded applications contains property files for various languages. They are packaged with the portlets applications in a WEB-INF/classes/locale/ directory.</para>
<para>
You should notice that
- </para>
+ </para>
<itemizedlist>
<listitem>
<para>
- the file is located in the <emphasis role="bold">classes</emphasis> folder of your WEB-INF, this way they are loaded by the ClassLoader.
+ the files are located in the <literal>classes</literal> folder of your WEB-INF, this way they are loaded by the ClassLoader.
</para>
</listitem>
<listitem>
<para>
- all resource files are in the subfolder <emphasis role="bold">locale</emphasis> .
+ all resource files are in a subfolder named <literal>locale</literal>
</para>
</listitem>
- <listitem>
- <para>
- resources for the <xref linkend="sect-Reference_Guide-Portal_Navigation_Configuration" /> are located in a <emphasis role="bold">navigation</emphasis> subfolder of locale.
- </para>
- </listitem>
- <listitem>
- <para>
- resources concerning the navigation of a group are in a <emphasis role="bold">navigation/group</emphasis> subfolder. The other possible navigations are <emphasis role="bold">user</emphasis> and <emphasis role="bold">portal</emphasis> .
- </para>
- </listitem>
</itemizedlist>
+ <para>For instance you will find the translations for the NavigationPortlet in <literal>web.war/WEB-INF/classes/locale/portlet/portal</literal></para>
+ <programlisting><![CDATA[NavigationPortlet_de.properties
+NavigationPortlet_en.properties
+NavigationPortlet_es.properties
+NavigationPortlet_fr.properties
+NavigationPortlet_nl.properties
+NavigationPortlet_ru.properties
+NavigationPortlet_uk.properties
+NavigationPortlet_ar.xml
+]]></programlisting>
+ <para>Inside those file we find typical <literal>key=value</literal> Java EE properties. For example the French one:</para>
+ <programlisting><![CDATA[javax.portlet.title=Portlet Navigation]]></programlisting>
<para>
- Furthermore there are properties files in portal sub-folder, they form together the <emphasis role="bold">portal resource bundle</emphasis> .:<!-- <ulink url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-sr...">::/WEB-INF/classes/locale/portal></ulink> -->
+ Furthermore there are properties files in the portal itself. They form together the <emphasis role="bold">portal resource bundle</emphasis>.
+ From a portlet you can then access translations from the portlet itself or shared at the portal level, both are aggregated when you need them.
</para>
+ <note>
+ <title>Translation in XML format</title>
+ <para>
+ 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. 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 (and fix) a translation in XML instead of having to decode and encode the property file.
+ </para>
+ <para>
+ More information are available here: <xref linkend="sect-Reference_Guide-XML_Resources_Bundles" />
+ </para>
+ </note>
+ </section>
+ <section id="sect-Reference_Guide-I18N-Locale-Configuration">
+ <title>Locales configuration</title>
+ <para>
+ Various languages are available in the shipped portal, one may want to add or remove languages.
+ This configuration will define the list of languages in the "Change Language" section of the portal that the user can pick from.
+ </para>
<para>
- The <emphasis>executive-board</emphasis> en.properties{code:none}{code} The keys (example: ~~organization.newstaff~~) can have any name but must not contain spaces. The values (~~New Staff~~) contain the translation to the language of the resource file. The suffix "en" means in this case "English".
+ In the <filename>02portal.war:/WEB-INF/conf/common/common-configuration.xml</filename> file of your installation you can find the following section:
</para>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- info("There are also resource bundles in XML format <xref linkend="sect-Reference_Guide-XML_Resources_Bundles" /> which are a proprietary format of GateIn Platform.")
- </para>
- </listitem>
- </orderedlist>
- <para>
- 1 LocalesConfig
- </para>
- <!-- <ulink url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-sr...">/WEB-INF/conf/common/common-configuration.xml"</ulink> -->
- <para>
- In the <filename>/WEB-INF/conf/common/common-configuration.xml</filename> file of your installation you find:
- </para>
-<programlisting> <component>
- <key>org.exoplatform.services.resources.LocaleConfigService</key>
- <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
- <init-params>
- <value-param>
- <name>locale.config.file</name>
- <value>war:/conf/common/locales-config.xml</value>
- </value-param>
- </init-params>
- </component>
-</programlisting>
+<programlisting role="XML"><![CDATA[<component>
+ <key>org.exoplatform.services.resources.LocaleConfigService</key>
+ <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>war:/conf/common/locales-config.xml</value>
+ </value-param>
+ </init-params>
+</component>]]></programlisting>
<para>
- The configuration points to the locale configuration file like this one<ulink type="http" url="http://fisheye.exoplatform.org-browse-projects-portal-trunk-web-portal-sr..." />
+ The configuration points to the locale configuration file such as the following one located in <filename>02portal.war:/WEB-INF/conf/common/locales-config.xml</filename>:
</para>
-
-<programlisting>{code:xml} <locale-config> <locale>ar</locale> <output-encoding>UTF-8</output-encoding> <input-encoding>UTF-8</input-encoding> <description>Default configuration for the Arabic locale</description> <orientation>rt</orientation> </locale-config> {code}
-</programlisting>
+<programlistingco>
+ <areaspec>
+ <area id="i18n.locales.configuration.locale" coords='4' />
+ <area id="i18n.locales.configuration.output-encoding" coords='5' />
+ <area id="i18n.locales.configuration.input-encoding" coords='6' />
+ <area id="i18n.locales.configuration.description" coords='7' />
+ <area id="i18n.locales.configuration.orientation" coords='22' />
+ </areaspec>
+<programlisting role="XML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<locales-config>
+ <locale-config>
+ <locale>en</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for english locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>fr</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the french locale</description>
+ </locale-config>
+
+ <locale-config>
+ <locale>ar</locale>
+ <output-encoding>UTF-8</output-encoding>
+ <input-encoding>UTF-8</input-encoding>
+ <description>Default configuration for the arabic locale</description>
+ <orientation>rt</orientation>
+ </locale-config>
+</locales-config>
+]]></programlisting>
+<calloutlist>
+ <callout arearefs="i18n.locales.configuration.locale">
+ <para>
+ <emphasis>locale</emphasis>
+ The locale has to be defined such as defined here <ulink type="http" url="http://ftp.ics.uci.edu-pub-ietf-http-related-iso639.txt" />, in this example "ar" is Arabic.
+ </para>
+ </callout>
+ <callout arearefs="i18n.locales.configuration.output-encoding">
+ <para>
+ <emphasis>output-encoding</emphasis>
+ Encoding It's highly recommended to always use <emphasis role="bold">UTF-8</emphasis>.
+ </para>
+ </callout>
+ <callout arearefs="i18n.locales.configuration.input-encoding">
+ <para>
+ <emphasis>input-encoding</emphasis>
+ In the java implementation, the encoding parameters will be used for the request response stream. The input-encoding parameter will be used for request setCharacterEncoding(..).
+ </para>
+ </callout>
+ <callout arearefs="i18n.locales.configuration.description">
+ <para>
+ <emphasis>description</emphasis>
+ Description for the language
+ </para>
+ </callout>
+ <callout arearefs="i18n.locales.configuration.orientation">
+ <para>
+ <emphasis>description</emphasis>
+ The default orientation of text and images is Left-To-Right.
+ GateIn supports <emphasis role="bold">Right-To-Left</emphasis> orientation. Therefore you can define the orientation to use as explained in <xref linkend="sect-Reference_Guide-RTL_Right_To_Left_Framework"/>.
+ </para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+
<para>
- The locale has to be defined using <ulink type="http" url="http://ftp.ics.uci.edu-pub-ietf-http-related-iso639.txt" />, in this example "ar" is Arabic.
- </para>
- <para>
- This configuration defines also the list of languages in the "Change Language" section of the portal.
- </para>
- <para>
- 1.1 Encoding It's highly recommended to always use <emphasis role="bold">UTF-8</emphasis>. You should also encode all property files in UTF-8.
- </para>
- <para>
- In the java implementation, the encoding parameters will be used for the request response stream. The input-encoding parameter will be used for request setCharacterEncoding(..).
- </para>
- <para>
- 1.1 Orientation The default orientation of text and images is Left-To-Right. As you know GateIn support <emphasis role="bold">Right-To-Left</emphasis> orientation. Therefore for Arabic you define
- </para>
- <para>
- <orientation>rt</orientation>
- </para>
- <para>
1 ResourceBundleService
</para>
<para>
Modified: portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml 2009-12-03 11:26:41 UTC (rev 916)
+++ portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml 2009-12-03 13:12:31 UTC (rev 917)
@@ -117,8 +117,7 @@
<servlet-mapping>
<servlet-name>TomcatGateInServlet</servlet-name>
<url-pattern>/tomcatgateinservlet</url-pattern>
-</servlet-mapping>
-]]></programlisting>
+</servlet-mapping>]]></programlisting>
<para>
With this in mind it's possible to filter on the CommandServlet by
@@ -157,8 +156,7 @@
{
}
-}
-]]></programlisting>
+}]]></programlisting>
<para>
The Java EE web application configuration file (web.xml) of the portlet on which we want to
know the time to serve a portlet request. As mentioned above nothing specific to GateIn needs to be included,
@@ -181,8 +179,7 @@
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
-</web-app>
-]]></programlisting>
+</web-app>]]></programlisting>
<para>
<note>
<title>INCLUDE dispatcher</title>
15 years
gatein SVN: r916 - portal/trunk/docs/reference-guide/en/modules/development.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-03 06:26:41 -0500 (Thu, 03 Dec 2009)
New Revision: 916
Modified:
portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
Log:
Explained added Servlet.
Used programlisting role="..." for prettification
Modified: portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml
===================================================================
--- portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml 2009-12-03 09:20:07 UTC (rev 915)
+++ portal/trunk/docs/reference-guide/en/modules/development/Portal_Lifecycle.xml 2009-12-03 11:26:41 UTC (rev 916)
@@ -21,11 +21,11 @@
WAR that we call a portlet application.
</para>
<para>
- GateIn doesn't require any particular setup in most common scenario and the
- web.xml file can remain empty. During deployment,
- GateIn will automatically and transparently inject a listener and a servlet
- filter to be able to interact with the portlet application.
- This feature is dependent on the underlying servlet container and will
+ GateIn doesn't require any particular setup for your portlet in most common scenario and the
+ web.xml file can remain without any GateIn specific configuration. During deployment,
+ GateIn will automatically and transparently inject a servlet
+ into the portlet application to be able to interact with it.
+ This feature is dependent on the underlying servlet container but will
work out of the box on the proposed bundles.
</para>
</section>
@@ -95,13 +95,102 @@
</programlisting>
-->
<section>
- <title>The Servlet</title>
+ <title>The Command Servlet</title>
<para>
The servlet is the main entry point for incoming requests, it
also includes some interesting init code when the portal is launched.
- This servlet (org.gatein.wci.command.CommandServlet) is automatically
- added during deployment.
+ This servlet (<literal>org.gatein.wci.command.CommandServlet</literal>) is automatically
+ added during deployment and mapped to <literal>/tomcatgateinservlet</literal>.
</para>
+ <para>
+ In other words, this is equivalent to adding the following into web.xml (But this is for
+ information only, the servlet is already configured)
+ </para>
+
+<programlisting role="XML"><![CDATA[
+<servlet>
+ <servlet-name>TomcatGateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.command.CommandServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+</servlet>
+
+<servlet-mapping>
+ <servlet-name>TomcatGateInServlet</servlet-name>
+ <url-pattern>/tomcatgateinservlet</url-pattern>
+</servlet-mapping>
+]]></programlisting>
+
+ <para>
+ With this in mind it's possible to filter on the CommandServlet by
+ filtering on the URL pattern used by the Servlet mapping. As an example
+ below we will create a servlet filter that calculates the time of
+ execution of a portlet request.
+ </para>
+ <para>The filter class: </para>
+<programlisting role="JAVA"><![CDATA[
+package org.example;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+public class MyFilter implements javax.servlet.Filter {
+
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException
+ {
+ long beforeTime = System.currentTimeMillis();
+ chain.doFilter(request, response);
+ long afterTime = System.currentTimeMillis();
+ System.out.println("Time to execute the portlet request (in ms): " + (afterTime - beforeTime));
+ }
+
+ public void init(FilterConfig config) throws ServletException
+ {
+ }
+
+ public void destroy()
+ {
+ }
+
+}
+]]></programlisting>
+ <para>
+ The Java EE web application configuration file (web.xml) of the portlet on which we want to
+ know the time to serve a portlet request. As mentioned above nothing specific to GateIn needs to be included,
+ only the URL pattern to set has to be known.
+ </para>
+<programlisting role="XML"><![CDATA[
+<?xml version="1.0"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.5">
+
+ <filter>
+ <filter-name>MyFilter</filter-name>
+ <filter-class>org.example.MyFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>MyFilter</filter-name>
+ <url-pattern>/tomcatgateinservlet</url-pattern>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+</web-app>
+]]></programlisting>
+ <para>
+ <note>
+ <title>INCLUDE dispatcher</title>
+ <para>Here it's important to set INCLUDE as dispatcher as the portal will always hit
+ the CommandServlet through a request dispatcher. Without this, the filter will not be
+ triggered, unless direct access to a resource (such as an image).</para>
+ </note>
+ </para>
</section>
<!--
<para>
15 years
gatein SVN: r915 - portal/branches/EPP_5_0_0_ER01_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr.
by do-not-reply@jboss.org
Author: mpodolin
Date: 2009-12-03 04:20:07 -0500 (Thu, 03 Dec 2009)
New Revision: 915
Modified:
portal/branches/EPP_5_0_0_ER01_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
Fixed security domain name
Modified: portal/branches/EPP_5_0_0_ER01_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/branches/EPP_5_0_0_ER01_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-03 09:16:30 UTC (rev 914)
+++ portal/branches/EPP_5_0_0_ER01_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-03 09:20:07 UTC (rev 915)
@@ -22,7 +22,7 @@
<repository-service default-repository="repository">
<repositories>
<repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>exo-domain</security-domain>
+ <security-domain>gatein-domain</security-domain>
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
<workspaces>
15 years
gatein SVN: r914 - portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-03 04:16:30 -0500 (Thu, 03 Dec 2009)
New Revision: 914
Modified:
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
Log:
Fix API to make Eclipse happy. That class is actually never compiled by Maven (And then tests aren't used)
Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java 2009-12-03 04:29:18 UTC (rev 913)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java 2009-12-03 09:16:30 UTC (rev 914)
@@ -20,6 +20,7 @@
package org.exoplatform.application.registry;
import org.exoplatform.container.PortalContainer;
+import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.OrganizationService;
@@ -323,7 +324,7 @@
Application app = new Application();
app.setApplicationName(appName);
app.setDisplayName(appName);
- app.setType(appType);
+ app.setType(ApplicationType.getType(appType));
// app.setApplicationGroup(appGroup);
return app;
}
15 years