gatein SVN: r1032 - in portal/trunk: component/application-registry/src/main/java/conf and 19 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-16 23:39:43 -0500 (Wed, 16 Dec 2009)
New Revision: 1032
Added:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationListener.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationStatus.java
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/ModelDemarcation.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/MOPSessionLifeCycle.java
Modified:
portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/AbstractContext.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticManager.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SessionContext.java
portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/Synchronization.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java
portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java
portal/trunk/component/web/src/main/java/org/exoplatform/web/WebAppController.java
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml
Log:
GTNPORTAL-396 : Improve request life cycle management
GTNPORTAL-395 : Update to Chromattic 1.0.0-beta11
GTNPORTAL-394 : Update to JCR 1.12.0-Beta05
Modified: portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-17 04:39:43 UTC (rev 1032)
@@ -81,7 +81,7 @@
</propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
- <childNodeDefinition name="resources" defaultPrimaryType="nt:folder" autoCreated="true" mandatory="true"
+ <childNodeDefinition name="resources" defaultPrimaryType="nt:folder" autoCreated="false" mandatory="true"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>nt:folder</requiredPrimaryType>
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -154,7 +154,7 @@
}
finally
{
- lifeCycle.closeContext(context, true);
+ lifeCycle.closeContext(true);
}
}
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -24,6 +24,7 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
+import org.chromattic.ntdef.NTFolder;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -68,6 +69,9 @@
@Create
protected abstract RemoteGadgetData createRemoteData();
+ @Create
+ protected abstract NTFolder createFolder();
+
public boolean isLocal()
{
GadgetData data = getData();
@@ -83,6 +87,8 @@
{
LocalGadgetData localData = createLocalData();
setData(localData);
+ NTFolder resources = createFolder();
+ localData.setResources(resources);
}
}
else
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -57,6 +57,8 @@
@MappedBy("resources")
public abstract NTFolder getResources();
+ protected abstract void setResources(NTFolder resources);
+
private NTFile getGadgetContent() {
String fileName = getFileName();
NTFolder resources = getResources();
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -30,6 +30,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.config.POMSessionManager;
@@ -49,7 +50,6 @@
import java.util.Comparator;
import java.util.List;
import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
/**
* The fundamental reason that motives to use tasks is because of the JMX access that does not
@@ -119,31 +119,21 @@
final List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
//
-/*
- pomMGr.execute(new POMTask()
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ for (CategoryDefinition categoryDef : registry.getCategoryList())
{
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ ApplicationCategory category = load(categoryDef, appTypes);
+ categories.add(category);
+ }
- //
- for (CategoryDefinition categoryDef : registry.getCategoryList())
- {
- ApplicationCategory category = load(categoryDef, appTypes);
- categories.add(category);
- }
+ //
+ if (sortComparator != null)
+ {
+ Collections.sort(categories, sortComparator);
+ }
- //
- if (sortComparator != null)
- {
- Collections.sort(categories, sortComparator);
- }
-/*
- }
- });
-*/
-
//
return categories;
}
@@ -165,79 +155,46 @@
public ApplicationCategory getApplicationCategory(final String name) throws Exception
{
- final AtomicReference<ApplicationCategory> a = new AtomicReference<ApplicationCategory>();
+ ContentRegistry registry = getContentRegistry();
//
-/*
- pomMGr.execute(new POMTask()
+ CategoryDefinition categoryDef = registry.getCategory(name);
+ if (categoryDef != null)
{
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ ApplicationCategory applicationCategory = load(categoryDef);
+ return applicationCategory;
+ }
- //
- CategoryDefinition categoryDef = registry.getCategory(name);
- if (categoryDef != null)
- {
- ApplicationCategory applicationCategory = load(categoryDef);
- a.set(applicationCategory);
- }
-/*
- }
- });
-*/
-
//
- return a.get();
+ return null;
}
public void save(final ApplicationCategory category) throws Exception
{
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ ContentRegistry registry = getContentRegistry();
- //
- String categoryName = category.getName();
+ //
+ String categoryName = category.getName();
- //
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- categoryDef = registry.createCategory(categoryName);
- }
+ //
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ categoryDef = registry.createCategory(categoryName);
+ }
- //
- categoryDef.setDisplayName(category.getDisplayName());
- categoryDef.setCreationDate(category.getCreatedDate());
- categoryDef.setLastModificationDate(category.getModifiedDate());
- categoryDef.setDescription(category.getDescription());
- categoryDef.setAccessPermissions(category.getAccessPermissions());
- }
-/*
- });
+ //
+ categoryDef.setDisplayName(category.getDisplayName());
+ categoryDef.setCreationDate(category.getCreatedDate());
+ categoryDef.setLastModificationDate(category.getModifiedDate());
+ categoryDef.setDescription(category.getDescription());
+ categoryDef.setAccessPermissions(category.getAccessPermissions());
}
-*/
public void remove(final ApplicationCategory category) throws Exception
{
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
- registry.getCategoryMap().remove(category.getName());
-/*
- }
- });
-*/
+ ContentRegistry registry = getContentRegistry();
+ registry.getCategoryMap().remove(category.getName());
}
public List<Application> getApplications(ApplicationCategory category, ApplicationType<?>... appTypes) throws Exception
@@ -250,36 +207,20 @@
final Comparator<Application> sortComparator,
final ApplicationType<?>... appTypes) throws Exception
{
- final AtomicReference<List<Application>> ref = new AtomicReference<List<Application>>();
+ ContentRegistry registry = getContentRegistry();
//
-/*
- pomMGr.execute(new POMTask()
+ CategoryDefinition categoryDef = registry.getCategory(category.getName());
+ List<Application> applications = load(categoryDef, appTypes).getApplications();
+
+ //
+ if (sortComparator != null)
{
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ Collections.sort(applications, sortComparator);
+ }
- //
- CategoryDefinition categoryDef = registry.getCategory(category.getName());
- List<Application> applications = load(categoryDef, appTypes).getApplications();
-
- //
- if (sortComparator != null)
- {
- Collections.sort(applications, sortComparator);
- }
-
- //
- ref.set(applications);
-/*
- }
- });
-*/
-
//
- return ref.get();
+ return applications;
}
public List<Application> getAllApplications() throws Exception
@@ -305,115 +246,82 @@
public Application getApplication(final String category, final String name) throws Exception
{
- final AtomicReference<Application> ref = new AtomicReference<Application>();
+ ContentRegistry registry = getContentRegistry();
//
-/*
- pomMGr.execute(new POMTask()
+ CategoryDefinition categoryDef = registry.getCategory(category);
+ if (categoryDef != null)
{
- public void run(POMSession session) throws Exception
+ ContentDefinition contentDef = categoryDef.getContentMap().get(name);
+ if (contentDef != null)
{
-*/
- ContentRegistry registry = getContentRegistry();
-
- //
- CategoryDefinition categoryDef = registry.getCategory(category);
- if (categoryDef != null)
- {
- ContentDefinition contentDef = categoryDef.getContentMap().get(name);
- if (contentDef != null)
- {
- ref.set(load(contentDef));
- }
- }
-/*
+ return load(contentDef);
}
- });
-*/
+ }
//
- return ref.get();
+ return null;
}
public void save(final ApplicationCategory category, final Application application) throws Exception
{
-/*
- pomMGr.execute(new POMTask()
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = category.getName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
{
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ categoryDef = registry.createCategory(categoryName);
+ save(category, categoryDef);
+ }
- //
- String categoryName = category.getName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- categoryDef = registry.createCategory(categoryName);
- save(category, categoryDef);
- }
+ //
+ ContentDefinition contentDef = null;
+ CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
+ String applicationName = application.getApplicationName();
+ if (applicationCategoryDef != null)
+ {
+ contentDef = applicationCategoryDef.getContentMap().get(applicationName);
+ }
+ if (contentDef == null)
+ {
+ String contentId = application.getContentId();
+ ContentType<?> contentType = application.getType().getContentType();
+ String definitionName = application.getApplicationName();
+ contentDef = categoryDef.createContent(definitionName, contentType, contentId);
+ }
+ else
+ {
+ // A JCR move actually
+ categoryDef.getContentList().add(contentDef);
+ }
- //
- ContentDefinition contentDef = null;
- CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
- String applicationName = application.getApplicationName();
- if (applicationCategoryDef != null)
- {
- contentDef = applicationCategoryDef.getContentMap().get(applicationName);
- }
- if (contentDef == null)
- {
- String contentId = application.getContentId();
- ContentType<?> contentType = application.getType().getContentType();
- String definitionName = application.getApplicationName();
- contentDef = categoryDef.createContent(definitionName, contentType, contentId);
- }
- else
- {
- // A JCR move actually
- categoryDef.getContentList().add(contentDef);
- }
-
- // Update state
- save(application, contentDef);
-/*
- }
- });
-*/
+ // Update state
+ save(application, contentDef);
}
public void update(final Application application) throws Exception
{
-/*
- pomMGr.execute(new POMTask()
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ String categoryName = application.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
{
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ throw new IllegalStateException();
+ }
- //
- String categoryName = application.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
- {
- throw new IllegalStateException();
- }
+ //
+ ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
+ if (contentDef == null)
+ {
+ throw new IllegalStateException();
+ }
- //
- ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
- if (contentDef == null)
- {
- throw new IllegalStateException();
- }
-
- // Update state
- save(application, contentDef);
-/*
- }
- });
-*/
+ // Update state
+ save(application, contentDef);
}
public void remove(final Application app) throws Exception
@@ -424,181 +332,151 @@
}
//
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ ContentRegistry registry = getContentRegistry();
- //
- String categoryName = app.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ //
+ String categoryName = app.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
- //
- if (categoryDef != null)
- {
+ //
+ if (categoryDef != null)
+ {
- String contentName = app.getApplicationName();
- categoryDef.getContentMap().remove(contentName);
- }
-/*
- }
- });
-*/
+ String contentName = app.getApplicationName();
+ categoryDef.getContentMap().remove(contentName);
+ }
}
public void importExoGadgets() throws Exception
{
-/*
- pomMGr.execute(new POMTask()
- {
- public void run(POMSession session) throws Exception
- {
-*/
- ContentRegistry registry = getContentRegistry();
+ ContentRegistry registry = getContentRegistry();
- //
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
- List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
+ //
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
- //
- if (eXoGadgets != null)
- {
- ArrayList<String> permissions = new ArrayList<String>();
- permissions.add(UserACL.EVERYONE);
- String categoryName = "Gadgets";
+ //
+ if (eXoGadgets != null)
+ {
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add(UserACL.EVERYONE);
+ String categoryName = "Gadgets";
- //
- CategoryDefinition category = registry.getCategory(categoryName);
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- category.setDescription(categoryName);
- category.setAccessPermissions(permissions);
- }
+ //
+ CategoryDefinition category = registry.getCategory(categoryName);
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ category.setDescription(categoryName);
+ category.setAccessPermissions(permissions);
+ }
- //
- for (Gadget ele : eXoGadgets)
- {
- ContentDefinition app = category.getContentMap().get(ele.getName());
- if (app == null)
- {
- app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
- app.setDisplayName(ele.getTitle());
- app.setDescription(ele.getDescription());
- app.setAccessPermissions(permissions);
- }
- }
+ //
+ for (Gadget ele : eXoGadgets)
+ {
+ ContentDefinition app = category.getContentMap().get(ele.getName());
+ if (app == null)
+ {
+ app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
+ app.setDisplayName(ele.getTitle());
+ app.setDescription(ele.getDescription());
+ app.setAccessPermissions(permissions);
}
-/*
}
- });
-*/
+ }
}
public void importAllPortlets() throws Exception
{
-/*
- pomMGr.execute(new POMTask()
+ ContentRegistry registry = getContentRegistry();
+
+ //
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
+ Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
+
+ //
+ for (org.gatein.pc.api.Portlet portlet : portlets)
{
- public void run(POMSession session) throws Exception
+ PortletInfo info = portlet.getInfo();
+ String portletApplicationName = info.getApplicationName();
+ String portletName = info.getName();
+
+ // Need to sanitize portlet and application names in case they contain characters that would
+ // cause an improper Application name
+ portletApplicationName = portletApplicationName.replace('/', '_');
+ portletName = portletName.replace('/', '_');
+
+ LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
+
+ String[] categoryNames = null;
+ if (keywordsLS != null)
{
-*/
- ContentRegistry registry = getContentRegistry();
+ String keywords = keywordsLS.getDefaultString();
+ if (keywords != null && keywords.length() != 0)
+ {
+ categoryNames = keywords.split(",");
+ }
+ }
+ if (categoryNames == null || categoryNames.length == 0)
+ {
+ categoryNames = new String[]{portletApplicationName};
+ }
+
+ if (portlet.isRemote())
+ {
+ categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
+ }
+
+ //
+ for (String categoryName : categoryNames)
+ {
+ categoryName = categoryName.trim();
+
//
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
- Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
+ CategoryDefinition category = registry.getCategory(categoryName);
//
- for (org.gatein.pc.api.Portlet portlet : portlets)
+ if (category == null)
{
- PortletInfo info = portlet.getInfo();
- String portletApplicationName = info.getApplicationName();
- String portletName = info.getName();
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ }
- // Need to sanitize portlet and application names in case they contain characters that would
- // cause an improper Application name
- portletApplicationName = portletApplicationName.replace('/', '_');
- portletName = portletName.replace('/', '_');
+ //
+ ContentDefinition app = category.getContentMap().get(portletName);
+ if (app == null)
+ {
+ LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
+ LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
- LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
+ // julien: ????
+ // getLocalizedStringValue(descriptionLS, portletName);
- String[] categoryNames = null;
- if (keywordsLS != null)
+ ContentType<?> contentType;
+ String contentId;
+ if (portlet.isRemote())
{
- String keywords = keywordsLS.getDefaultString();
- if (keywords != null && keywords.length() != 0)
- {
- categoryNames = keywords.split(",");
- }
+ contentType = WSRP.CONTENT_TYPE;
+ contentId = portlet.getContext().getId();
}
-
- if (categoryNames == null || categoryNames.length == 0)
+ else
{
- categoryNames = new String[]{portletApplicationName};
+ contentType = Portlet.CONTENT_TYPE;
+ contentId = info.getApplicationName() + "/" + info.getName();
}
- if (portlet.isRemote())
- {
- categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
- }
//
- for (String categoryName : categoryNames)
- {
- categoryName = categoryName.trim();
-
- //
- CategoryDefinition category = registry.getCategory(categoryName);
-
- //
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- }
-
- //
- ContentDefinition app = category.getContentMap().get(portletName);
- if (app == null)
- {
- LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-
- // julien: ????
- // getLocalizedStringValue(descriptionLS, portletName);
-
- ContentType<?> contentType;
- String contentId;
- if (portlet.isRemote())
- {
- contentType = WSRP.CONTENT_TYPE;
- contentId = portlet.getContext().getId();
- }
- else
- {
- contentType = Portlet.CONTENT_TYPE;
- contentId = info.getApplicationName() + "/" + info.getName();
- }
-
-
- //
- app = category.createContent(portletName, contentType, contentId);
- app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
- app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
- }
- }
+ app = category.createContent(portletName, contentType, contentId);
+ app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
+ app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
}
-/*
}
- });
-*/
+ }
}
private boolean isApplicationType(Application app, ApplicationType<?>... appTypes)
@@ -724,9 +602,7 @@
{
if (plugins != null)
{
-// POMSession session = pomMGr.openSession();
-// SessionContext context = lifeCycle.openContext();
- manager.beginRequest();
+ RequestLifeCycle.begin(manager);
boolean save = false;
try
{
@@ -744,7 +620,8 @@
finally
{
// lifeCycle.closeContext(context, true);
- manager.endRequest(true);
+ manager.getSynchronization().setSave(save);
+ RequestLifeCycle.end();
}
}
}
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-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -77,15 +77,16 @@
{
PortalContainer portalContainer = PortalContainer.getInstance();
chromatticManager = (ChromatticManager)portalContainer.getComponentInstanceOfType(ChromatticManager.class);
- chromatticManager.beginRequest();
service_ = (ApplicationRegistryService)portalContainer.getComponentInstanceOfType(ApplicationRegistryService.class);
orgService = (OrganizationService)portalContainer.getComponentInstanceOfType(OrganizationService.class);
+ begin();
}
@Override
protected void tearDown() throws Exception
{
- chromatticManager.endRequest(false);
+ chromatticManager.getSynchronization().setSave(false);
+ end();
}
public void testApplicationCategory() throws Exception
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/AbstractContext.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/AbstractContext.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/AbstractContext.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -21,10 +21,12 @@
import org.chromattic.api.ChromatticSession;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
/**
- * An abstract implementation of the {@link org.exoplatform.commons.chromattic.SessionContext} interface.
+ * An abstract implementation of the {@link org.exoplatform.commons.chromattic.SessionContext} interface. The context
+ * owns the chromattic session.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -38,20 +40,24 @@
/** . */
private Map<String, Object> attributes;
- /** The related configurator. */
- private final ChromatticLifeCycle configurator;
+ /** The related life cycle. */
+ private final ChromatticLifeCycle lifeCycle;
- public AbstractContext(ChromatticLifeCycle configurator)
+ /** . */
+ private HashSet<SynchronizationListener> listeners;
+
+ AbstractContext(ChromatticLifeCycle lifeCycle)
{
- this.configurator = configurator;
+ this.lifeCycle = lifeCycle;
this.session = null;
+ this.listeners = null;
}
public final ChromatticSession getSession()
{
if (session == null)
{
- session = configurator.realChromattic.openSession();
+ session = lifeCycle.realChromattic.openSession();
}
return session;
}
@@ -83,6 +89,22 @@
public void close(boolean save)
{
+ if (listeners != null)
+ {
+ for (SynchronizationListener listener : listeners)
+ {
+ try
+ {
+ listener.beforeSynchronization();
+ }
+ catch (Exception e)
+ {
+ // to log
+ }
+ }
+ }
+
+ //
if (session != null)
{
if (save)
@@ -95,9 +117,39 @@
}
//
- configurator.currentContext.set(null);
+ if (listeners != null)
+ {
+ SynchronizationStatus status = save ? SynchronizationStatus.SAVED : SynchronizationStatus.DISCARDED;
+ for (SynchronizationListener listener : listeners)
+ {
+ try
+ {
+ listener.afterSynchronization(status);
+ }
+ catch (Exception e)
+ {
+ // to log
+ }
+ }
+ }
//
- configurator.onCloseSession(this);
+ lifeCycle.currentContext.set(null);
+
+ //
+ lifeCycle.onCloseSession(this);
}
+
+ public final void addSynchronizationListener(SynchronizationListener listener)
+ {
+ if (listener == null)
+ {
+ throw new NullPointerException();
+ }
+ if (listeners == null)
+ {
+ listeners = new HashSet<SynchronizationListener>();
+ }
+ listeners.add(listener);
+ }
}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -24,7 +24,6 @@
import org.exoplatform.container.xml.InitParams;
import java.util.List;
-import java.util.concurrent.Callable;
/**
* <p>The chromattic life cycle objets is a plugin that allow to bootstrap a chromattic builder and make
@@ -166,7 +165,7 @@
throw new IllegalStateException("A session is already opened.");
}
- //
+ // Attempt to get the synchronization
Synchronization sync = manager.getSynchronization();
//
@@ -215,12 +214,18 @@
return context;
}
- public final void closeContext(SessionContext context, boolean save)
+ public final void closeContext(boolean save)
{
- AbstractContext abstractContext = (AbstractContext)context;
+ AbstractContext context = (AbstractContext)getContext(true);
//
- ((AbstractContext)context).close(save);
+ if (context == null)
+ {
+ throw new IllegalStateException("No current context existing");
+ }
+
+ //
+ context.close(save);
}
protected void onOpenSession(SessionContext context)
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticManager.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticManager.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticManager.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -18,7 +18,9 @@
*/
package org.exoplatform.commons.chromattic;
+import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.services.jcr.RepositoryService;
import java.util.HashMap;
@@ -28,7 +30,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ChromatticManager
+public class ChromatticManager implements ComponentRequestLifecycle
{
/** . */
@@ -41,22 +43,19 @@
Map<String, ChromatticLifeCycle> lifeCycles = new HashMap<String, ChromatticLifeCycle>();
/** . */
- private static final ThreadLocal<Synchronization> currentSynchronization = new ThreadLocal<Synchronization>();
+ private final ThreadLocal<Synchronization> currentSynchronization = new ThreadLocal<Synchronization>();
public ChromatticManager(RepositoryService repositoryService) throws Exception {
this.repositoryService = repositoryService;
this.lifeCycleToWorkspaceMap = new HashMap<String, String>();
}
- static Synchronization getCurrentSynchronization() {
- return currentSynchronization.get();
- }
-
public ChromatticLifeCycle getLifeCycle(String lifeCycleName)
{
return lifeCycles.get(lifeCycleName);
}
+ // Called by kernel
public void addLifeCycle(ComponentPlugin plugin)
{
ChromatticLifeCycle lifeCycle = (ChromatticLifeCycle)plugin;
@@ -100,7 +99,7 @@
/**
* Ends the demarcation of a request.
*
- * @param save if state must be saved
+ * @param save to save the state
* @throws IllegalStateException if no request was started previously
*/
public void endRequest(boolean save) throws IllegalStateException
@@ -122,4 +121,16 @@
//
currentSynchronization.set(null);
}
+
+ public void startRequest(ExoContainer container)
+ {
+ beginRequest();
+ }
+
+ public void endRequest(ExoContainer container)
+ {
+ Synchronization sync = currentSynchronization.get();
+ boolean save = sync.isSave();
+ endRequest(save);
+ }
}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ContextualTask.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -46,7 +46,7 @@
}
finally
{
- lifeCycle.closeContext(context, true);
+ lifeCycle.closeContext(true);
}
}
else
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SessionContext.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SessionContext.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SessionContext.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -52,4 +52,11 @@
* @param payload the attachment payload
*/
void setAttachment(String name, Object payload);
+
+ /**
+ * Registers a synchronization listener.
+ *
+ * @param listener the listener
+ */
+ void addSynchronizationListener(SynchronizationListener listener);
}
Modified: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/Synchronization.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/Synchronization.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/Synchronization.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -28,7 +28,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-class Synchronization implements LoginContext
+public class Synchronization implements LoginContext
{
/** The sessions mapped by workspace name. */
@@ -37,6 +37,9 @@
/** . */
private final Map<String, GlobalContext> contexts = new HashMap<String, GlobalContext>();
+ /** . */
+ private boolean save = true;
+
/**
* Returns a specified global context by its name.
*
@@ -84,8 +87,8 @@
public void close(boolean save)
{
- // First close all sessions
- for (AbstractContext context : contexts.values())
+ // First save all global contexts (sessions)
+ for (GlobalContext context : contexts.values())
{
context.close(save);
}
@@ -96,4 +99,14 @@
session.logout();
}
}
+
+ public boolean isSave()
+ {
+ return save;
+ }
+
+ public void setSave(boolean save)
+ {
+ this.save = save;
+ }
}
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationListener.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationListener.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationListener.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.commons.chromattic;
+
+/**
+ * <p>Useful for being aware of the synchronization.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface SynchronizationListener
+{
+
+ /**
+ * Before synchronization occurs.
+ */
+ void beforeSynchronization();
+
+ /**
+ * Once synchronization occured.
+ *
+ * @param status the status of the synchronization
+ */
+ void afterSynchronization(SynchronizationStatus status);
+
+}
Added: portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationStatus.java
===================================================================
--- portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationStatus.java (rev 0)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/SynchronizationStatus.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.commons.chromattic;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public enum SynchronizationStatus
+{
+
+ DISCARDED, SAVED
+
+}
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -46,6 +46,10 @@
/** . */
private ChromatticManager chromatticManager;
+ public ChromatticIntegrationTestCase()
+ {
+ }
+
@Override
protected void setUp() throws Exception
{
@@ -54,12 +58,6 @@
testLF = chromatticManager.getLifeCycle("test");
}
- @Override
- protected void tearDown() throws Exception
- {
-
- }
-
public void testConfiguratorInitialized() throws Exception
{
assertNotNull(testLF);
@@ -132,7 +130,7 @@
}
finally
{
- testLF.closeContext(context, false);
+ testLF.closeContext(false);
}
// Assert JCR session was properly closed
@@ -142,7 +140,7 @@
public void testLocalRequestNoSessionAccess()
{
SessionContext context = testLF.openContext();
- testLF.closeContext(context, false);
+ testLF.closeContext(false);
}
public void testGlobalSession() throws Exception
@@ -150,6 +148,9 @@
Session jcrSession;
//
+ SynchronizationEventQueue queue = new SynchronizationEventQueue();
+
+ //
chromatticManager.beginRequest();
try
{
@@ -162,8 +163,12 @@
ChromatticSession session = chromattic.openSession();
// Now we should have a context
- assertNotNull(testLF.getContext(true));
+ SessionContext context = testLF.getContext(true);
+ assertNotNull(context);
+ // Register synchronzation with event queue
+ context.addSynchronizationListener(queue);
+
// Check how chromattic see the session
FooEntity foo = session.create(FooEntity.class);
assertEquals("portal-test", foo.getWorkspace());
@@ -177,12 +182,19 @@
// Closing chromattic session should not close the underlying JCR session
session.close();
assertTrue(jcrSession.isLive());
+
+ // Queue should be empty up to here
+ queue.assertEmpty();
}
finally
{
chromatticManager.endRequest(false);
}
+ //
+ queue.assertEvent(SynchronizationEvent.BEFORE);
+ queue.assertEvent(SynchronizationEvent.DISCARDED);
+
// Assert JCR session was properly closed
assertFalse(jcrSession.isLive());
}
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -21,6 +21,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.services.cache.CacheService;
@@ -114,15 +115,23 @@
try
{
// Wrap within transaction so all initializers can work
- idmService_.getIdentitySession().beginTransaction();
+// idmService_.getIdentitySession().beginTransaction();
+
+ RequestLifeCycle.begin(this);
+
super.start();
- idmService_.getIdentitySession().getTransaction().commit();
+// idmService_.getIdentitySession().getTransaction().commit();
+
}
catch (Exception e)
{
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
+ finally
+ {
+ RequestLifeCycle.end();
+ }
}
@@ -132,10 +141,13 @@
//toto
}
- /**
+/*
+ */
+/**
* Used to allow nested requests (as done by the authenticator during unit tests) and avoid
* to commit two times the same transaction.
- */
+ *//*
+
private ThreadLocal<AtomicInteger> currentRequestCount = new ThreadLocal<AtomicInteger>()
{
@Override
@@ -144,37 +156,30 @@
return new AtomicInteger();
}
};
+*/
public void startRequest(ExoContainer container)
{
- AtomicInteger count = currentRequestCount.get();
- if (count.getAndIncrement() == 0)
+ try
{
- try
- {
- idmService_.getIdentitySession().beginTransaction();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ idmService_.getIdentitySession().beginTransaction();
}
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
public void endRequest(ExoContainer container)
{
- AtomicInteger count = currentRequestCount.get();
- if (count.decrementAndGet() == 0)
+ try
{
- try
- {
- idmService_.getIdentitySession().getTransaction().commit();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ idmService_.getIdentitySession().getTransaction().commit();
}
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
public String getGtnGroupType()
Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.test.BasicTestCase;
import java.util.ArrayList;
@@ -92,7 +93,8 @@
mtHandler_ = service_.getMembershipTypeHandler();
membershipHandler_ = service_.getMembershipHandler();
- ((ComponentRequestLifecycle)service_).startRequest(manager);
+// ((ComponentRequestLifecycle)service_).startRequest(manager);
+ RequestLifeCycle.begin((ComponentRequestLifecycle)service_);
}
@@ -110,8 +112,8 @@
userHandler_.removeUser(userName, true);
}
- ((ComponentRequestLifecycle)service_).endRequest(manager);
-
+// ((ComponentRequestLifecycle)service_).endRequest(manager);
+ RequestLifeCycle.end();
}
public void testSimle() throws Exception
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -29,7 +29,6 @@
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.ModelDemarcation;
import org.exoplatform.portal.pom.data.DashboardData;
import org.exoplatform.portal.pom.data.ModelData;
import org.exoplatform.portal.pom.data.ModelDataStorage;
@@ -48,7 +47,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class DataStorageImpl implements DataStorage, ModelDemarcation
+public class DataStorageImpl implements DataStorage
{
/** . */
@@ -275,20 +274,4 @@
{
delegate.saveDashboard(dashboard.build());
}
-
- public void begin()
- {
- if (delegate instanceof ModelDemarcation)
- {
- ((ModelDemarcation)delegate).begin();
- }
- }
-
- public void end(boolean save)
- {
- if (delegate instanceof ModelDemarcation)
- {
- ((ModelDemarcation)delegate).end(save);
- }
- }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/GroupPortalConfigListener.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.config;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -40,111 +40,131 @@
public class GroupPortalConfigListener extends GroupEventListener
{
+ /** . */
+ private final UserPortalConfigService portalConfigService;
+
+ /** . */
+ private final DataStorage dataStorage;
+
+ /** . */
+ private final OrganizationService orgService;
+
+ public GroupPortalConfigListener(
+ UserPortalConfigService portalConfigService,
+ DataStorage dataStorage,
+ OrganizationService orgService)
+ {
+ this.portalConfigService = portalConfigService;
+ this.dataStorage = dataStorage;
+ this.orgService = orgService;
+ }
+
public void preDelete(Group group) throws Exception
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- UserPortalConfigService portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- String groupId = group.getId().trim();
+ RequestLifeCycle.begin(PortalContainer.getInstance());
+ try
+ {
+ String groupId = group.getId().trim();
- // Remove all descendant navigations
- removeGroupNavigation(group, portalConfigService);
-
- portalConfigService.removeUserPortalConfig(PortalConfig.GROUP_TYPE, groupId);
+ // Remove all descendant navigations
+ removeGroupNavigation(group, portalConfigService);
+
+ portalConfigService.removeUserPortalConfig(PortalConfig.GROUP_TYPE, groupId);
+ }
+ finally
+ {
+ RequestLifeCycle.end();
+ }
}
@Override
public void preSave(Group group, boolean isNew) throws Exception
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- /*
- * TODO Call start method on RegistryService to allow ecm, ultimate can
- * run with JDK6. This is uncommon behavior. We need find other way to fix
- * it I hope that this issues will be fixed when we use the lastest
- * version of PicoContainer Comment by Hoa Pham.
- */
- // RegistryService registryService = (RegistryService)container.getComponentInstanceOfType(RegistryService.class);
- // registryService.start();
- UserPortalConfigService portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- String groupId = group.getId();
+ RequestLifeCycle.begin(PortalContainer.getInstance());
- // Bug in hibernate org service implementation
- if (groupId == null)
+ try
{
- groupId = "/" + group.getGroupName();
- }
- // Bug in JCR org service implementation
- if ("/administrators".equals(groupId))
- {
- groupId = "/platform/administrators";
- }
- else if ("/users".equals(groupId))
- {
- groupId = "/platform/users";
- }
- else if ("/guests".equals(groupId))
- {
- groupId = "/platform/guests";
- }
- else if ("/management".equals(groupId))
- {
- groupId = "/organization/management";
- }
- else if ("/executive-board".equals(groupId))
- {
- groupId = "/organization/management/executive-board";
- }
- else if ("/human-resources".equals(groupId))
- {
- groupId = "/organization/management/human-resources";
- }
- else if ("/communication".equals(groupId))
- {
- groupId = "/organization/communication";
- }
- else if ("/marketing".equals(groupId))
- {
- groupId = "/organization/communication/marketing";
- }
- else if ("/press-and-media".equals(groupId))
- {
- groupId = "/organization/communication/press-and-media";
- }
- else if ("/operations".equals(groupId))
- {
- groupId = "/organization/operations";
- }
- else if ("/sales".equals(groupId))
- {
- groupId = "/organization/operations/sales";
- }
- else if ("/finances".equals(groupId))
- {
- groupId = "/organization/operations/finances";
- }
+ String groupId = group.getId();
- // Create the portal from the template
- portalConfigService.createUserPortalConfig(PortalConfig.GROUP_TYPE, groupId, "group");
+ // Bug in hibernate org service implementation
+ if (groupId == null)
+ {
+ groupId = "/" + group.getGroupName();
+ }
- // Need to insert the corresponding group site
- PortalConfig cfg = dataStorage.getPortalConfig(PortalConfig.GROUP_TYPE, groupId);
- if (cfg == null)
+ // Bug in JCR org service implementation
+ if ("/administrators".equals(groupId))
+ {
+ groupId = "/platform/administrators";
+ }
+ else if ("/users".equals(groupId))
+ {
+ groupId = "/platform/users";
+ }
+ else if ("/guests".equals(groupId))
+ {
+ groupId = "/platform/guests";
+ }
+ else if ("/management".equals(groupId))
+ {
+ groupId = "/organization/management";
+ }
+ else if ("/executive-board".equals(groupId))
+ {
+ groupId = "/organization/management/executive-board";
+ }
+ else if ("/human-resources".equals(groupId))
+ {
+ groupId = "/organization/management/human-resources";
+ }
+ else if ("/communication".equals(groupId))
+ {
+ groupId = "/organization/communication";
+ }
+ else if ("/marketing".equals(groupId))
+ {
+ groupId = "/organization/communication/marketing";
+ }
+ else if ("/press-and-media".equals(groupId))
+ {
+ groupId = "/organization/communication/press-and-media";
+ }
+ else if ("/operations".equals(groupId))
+ {
+ groupId = "/organization/operations";
+ }
+ else if ("/sales".equals(groupId))
+ {
+ groupId = "/organization/operations/sales";
+ }
+ else if ("/finances".equals(groupId))
+ {
+ groupId = "/organization/operations/finances";
+ }
+
+ // Create the portal from the template
+ portalConfigService.createUserPortalConfig(PortalConfig.GROUP_TYPE, groupId, "group");
+
+ // Need to insert the corresponding group site
+ PortalConfig cfg = dataStorage.getPortalConfig(PortalConfig.GROUP_TYPE, groupId);
+ if (cfg == null)
+ {
+ cfg = new PortalConfig(PortalConfig.GROUP_TYPE);
+ cfg.setPortalLayout(new Container());
+ cfg.setName(groupId);
+ dataStorage.create(cfg);
+ }
+
+ }
+ finally
{
- cfg = new PortalConfig(PortalConfig.GROUP_TYPE);
- cfg.setPortalLayout(new Container());
- cfg.setName(groupId);
- dataStorage.create(cfg);
+ RequestLifeCycle.end();
}
}
private void removeGroupNavigation(Group group, UserPortalConfigService portalConfigService) throws Exception
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- OrganizationService orgService =
- (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
GroupHandler groupHandler = orgService.getGroupHandler();
Collection<String> descendantGroups = getDescendantGroups(group, groupHandler);
PageNavigation navigation = null;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigListener.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -19,8 +19,8 @@
package org.exoplatform.portal.config;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
@@ -36,54 +36,69 @@
public class UserPortalConfigListener extends UserEventListener
{
+ /** . */
+ private final UserPortalConfigService portalConfigService;
+
+ /** . */
+ private final DataStorage dataStorage;
+
+ public UserPortalConfigListener(
+ UserPortalConfigService portalConfigService,
+ DataStorage dataStorage)
+ {
+ this.portalConfigService = portalConfigService;
+ this.dataStorage = dataStorage;
+ }
+
public void preDelete(User user) throws Exception
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- UserPortalConfigService portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- String userName = user.getUserName();
- portalConfigService.removeUserPortalConfig("user", userName);
+ RequestLifeCycle.begin(PortalContainer.getInstance());
+ try
+ {
+ String userName = user.getUserName();
+ portalConfigService.removeUserPortalConfig("user", userName);
+ }
+ finally
+ {
+ RequestLifeCycle.end();
+ }
}
public void preSave(User user, boolean isNew) throws Exception
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- /*
- * TODO Call start method on RegistryService to allow ecm, ultimate can run
- * with JDK6. This is uncommon behavior. We need find other way to fix it I
- * hope that this issues will be fixed when we use the lastest version of
- * PicoContainer Comment by Hoa Pham.
- */
- // RegistryService registryService = (RegistryService)container.getComponentInstanceOfType(RegistryService.class);
- // registryService.start();
- UserPortalConfigService portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
- DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- String userName = user.getUserName();
+ RequestLifeCycle.begin(PortalContainer.getInstance());
+ try
+ {
+ String userName = user.getUserName();
- // Create the portal from the template
- portalConfigService.createUserPortalConfig(PortalConfig.USER_TYPE, userName, "user");
+ // Create the portal from the template
+ portalConfigService.createUserPortalConfig(PortalConfig.USER_TYPE, userName, "user");
- // Need to insert the corresponding user site if needed
- PortalConfig cfg = dataStorage.getPortalConfig(PortalConfig.USER_TYPE, userName);
- if (cfg == null)
- {
- cfg = new PortalConfig(PortalConfig.USER_TYPE);
- cfg.setPortalLayout(new Container());
- cfg.setName(userName);
- dataStorage.create(cfg);
+ // Need to insert the corresponding user site if needed
+ PortalConfig cfg = dataStorage.getPortalConfig(PortalConfig.USER_TYPE, userName);
+ if (cfg == null)
+ {
+ cfg = new PortalConfig(PortalConfig.USER_TYPE);
+ cfg.setPortalLayout(new Container());
+ cfg.setName(userName);
+ dataStorage.create(cfg);
+ }
+
+ // Create a blank navigation if needed
+ PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName);
+ if (navigation == null)
+ {
+ PageNavigation pageNav = new PageNavigation();
+ pageNav.setOwnerType(PortalConfig.USER_TYPE);
+ pageNav.setOwnerId(userName);
+ pageNav.setPriority(5);
+ pageNav.setNodes(new ArrayList<PageNode>());
+ portalConfigService.create(pageNav);
+ }
}
-
- // Create a blank navigation if needed
- PageNavigation navigation = dataStorage.getPageNavigation(PortalConfig.USER_TYPE, userName);
- if (navigation == null)
+ finally
{
- PageNavigation pageNav = new PageNavigation();
- pageNav.setOwnerType(PortalConfig.USER_TYPE);
- pageNav.setOwnerId(userName);
- pageNav.setPriority(5);
- pageNav.setNodes(new ArrayList<PageNode>());
- portalConfigService.create(pageNav);
+ RequestLifeCycle.end();
}
}
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -19,8 +19,11 @@
package org.exoplatform.portal.config;
+import org.exoplatform.commons.chromattic.ChromatticManager;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentPlugin;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.pom.data.ModelChange;
@@ -30,7 +33,6 @@
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.config.ModelDemarcation;
import org.exoplatform.services.listener.ListenerService;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -77,13 +79,17 @@
private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
- public UserPortalConfigService(UserACL userACL, DataStorage storage,
- OrganizationService orgService, ListenerService listenerService) throws Exception
+ private ChromatticManager manager;
+
+ public UserPortalConfigService(
+ UserACL userACL, DataStorage storage,
+ OrganizationService orgService, ListenerService listenerService, ChromatticManager manager) throws Exception
{
this.storage_ = storage;
this.orgService_ = orgService;
this.listenerService = listenerService;
this.userACL_ = userACL;
+ this.manager = manager;
}
/**
@@ -636,29 +642,19 @@
return;
//
- if (storage_ instanceof ModelDemarcation)
- {
- ((ModelDemarcation)storage_).begin();
- }
+ RequestLifeCycle.begin(PortalContainer.getInstance());
+ //
newPortalConfigListener_.run();
}
catch (Exception e)
{
log.error("Could not import initial data", e);
- //
- if (storage_ instanceof ModelDemarcation)
- {
- ((ModelDemarcation)storage_).end(false);
- }
}
finally
{
- if (storage_ instanceof ModelDemarcation)
- {
- ((ModelDemarcation)storage_).end(true);
- }
+ RequestLifeCycle.end();
}
}
Deleted: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/ModelDemarcation.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/ModelDemarcation.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/ModelDemarcation.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -1,32 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.portal.pom.config;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public interface ModelDemarcation
-{
-
- void begin();
-
- void end(boolean save);
-
-}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -63,7 +63,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class POMDataStorage implements ModelDataStorage, ModelDemarcation
+public class POMDataStorage implements ModelDataStorage
{
/** . */
@@ -314,14 +314,4 @@
generateStorageName(container);
return container;
}
-
- public void begin()
- {
- manager.beginRequest();
- }
-
- public void end(boolean save)
- {
- manager.endRequest(true);
- }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -22,6 +22,8 @@
import org.chromattic.api.ChromatticSession;
import org.chromattic.api.UndeclaredRepositoryException;
import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.commons.chromattic.SynchronizationListener;
+import org.exoplatform.commons.chromattic.SynchronizationStatus;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.pom.data.Mapper;
import org.gatein.mop.api.Model;
@@ -54,6 +56,15 @@
{
/** . */
+ private static final Map<ObjectType<?>, Class> mapping = new HashMap<ObjectType<?>, Class>();
+
+ static
+ {
+ mapping.put(ObjectType.PAGE, PageImpl.class);
+ mapping.put(ObjectType.NAVIGATION, NavigationImpl.class);
+ }
+
+ /** . */
final POMSessionManager mgr;
/** . */
@@ -82,6 +93,10 @@
public POMSession(POMSessionManager mgr, MOPChromatticLifeCycle configurator, SessionContext context)
{
+ // Register for cache eviction
+ context.addSynchronizationListener(listener);
+
+ //
this.mgr = mgr;
this.isInTask = false;
this.markedForRollback = false;
@@ -326,13 +341,22 @@
return session.createQueryBuilder().from(mappedClass).<O> where(statement).get().objects();
}
- private static final Map<ObjectType<?>, Class> mapping = new HashMap<ObjectType<?>, Class>();
-
- static
+ private final SynchronizationListener listener = new SynchronizationListener()
{
- mapping.put(ObjectType.PAGE, PageImpl.class);
- mapping.put(ObjectType.NAVIGATION, NavigationImpl.class);
- }
+ public void beforeSynchronization()
+ {
+ }
+ public void afterSynchronization(SynchronizationStatus status)
+ {
+ if (status == SynchronizationStatus.SAVED && staleKeys != null)
+ {
+ for (Serializable key : staleKeys)
+ {
+ mgr.cache.remove(key);
+ }
+ }
+ }
+ };
public void execute(POMTask task) throws Exception
{
@@ -394,21 +418,13 @@
save();
}
+ // Close model
if (model != null)
{
model.close();
}
//
- configurator.closeContext(context, save & markedForRollback);
-
- //
- if (staleKeys != null)
- {
- for (Serializable key : staleKeys)
- {
- mgr.cache.remove(key);
- }
- }
+ configurator.closeContext(save & markedForRollback);
}
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -42,12 +42,6 @@
private MOPService pomService;
/** . */
- final String repositoryName = "repository";
-
- /** . */
- final String workspaceName = "portal-system";
-
- /** . */
final ExoCache<Serializable, Object> cache;
/** . */
@@ -132,8 +126,7 @@
}
/**
- * <p>Execute the task with a session. The method attempts first to get a current session and if no such session
- * is found then a session will be created for the scope of the method.</p>
+ * <p>Execute the task with a session.</p>
*
* @param task the task to execute
* @throws Exception any exception thrown by the task
@@ -141,24 +134,11 @@
public <T extends POMTask> T execute(T task) throws Exception
{
POMSession session = getSession();
- if (session == null)
- {
- session = openSession();
- try
- {
- executor.execute(session, task);
- }
- finally
- {
- session.close(true);
- }
- }
- else
- {
- executor.execute(session, task);
- }
//
+ executor.execute(session, task);
+
+ //
return task;
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -18,10 +18,12 @@
*/
package org.exoplatform.portal.config;
+import org.exoplatform.commons.chromattic.ChromatticManager;
import org.exoplatform.component.test.AbstractGateInTest;
import org.exoplatform.component.test.ConfigurationUnit;
import org.exoplatform.component.test.ConfiguredBy;
import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.container.PortalContainer;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -44,4 +46,29 @@
{
super(name);
}
+
+ @Override
+ protected void end()
+ {
+ end(false);
+ }
+
+ protected void end(boolean save)
+ {
+ PortalContainer container = getContainer();
+ ChromatticManager manager = (ChromatticManager)container.getComponentInstanceOfType(ChromatticManager.class);
+ manager.getSynchronization().setSave(save);
+ super.end();
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ //
+ }
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestCache.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -45,26 +45,21 @@
public void setUp() throws Exception
{
super.setUp();
- if (storage_ != null)
- return;
- PortalContainer container = PortalContainer.getInstance();
+ PortalContainer container = getContainer();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
- session = mgr.openSession();
}
- protected void tearDown() throws Exception
+ public void testDirtyWrite() throws Exception
{
- session.close();
- }
+ begin();
+ session = mgr.openSession();
- public void testDirtyWrite() throws Exception
- {
// Read
Page page = storage_.getPage("portal::test::test4");
assertEquals(null, page.getTitle());
- // Update
+ // Update and save
page.setTitle("foo");
storage_.save(page);
@@ -81,9 +76,11 @@
{
try
{
+ begin();
mgr.openSession();
storage_.getPage("portal::test::test4");
session.close();
+ end();
}
catch (Exception e)
{
@@ -102,12 +99,19 @@
Thread.sleep(1);
}
+ // Save the cache should be invalidated
+ session.close();
+ end(true);
+
// Reopen session with no modifications that use the cache
- session.close(true);
+ begin();
mgr.openSession();
//
page = storage_.getPage("portal::test::test4");
assertEquals("foo", page.getTitle());
+
+ //
+ end();
}
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestContentRegistry.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -42,8 +42,7 @@
public void setUp() throws Exception
{
super.setUp();
-
- //
+ begin();
PortalContainer container = PortalContainer.getInstance();
storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
@@ -53,8 +52,8 @@
protected void tearDown() throws Exception
{
session.close(false);
- session = null;
- storage = null;
+ end();
+ super.tearDown();
}
public void testFoo()
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -52,14 +52,19 @@
public class TestDataStorage extends AbstractPortalTest
{
+ /** . */
private final String testPortal = "testPortal";
+ /** . */
private final String testPage = "portal::classic::testPage";
+ /** . */
private final String testPortletPreferences = "portal#classic:/web/BannerPortlet/testPortletPreferences";
- DataStorage storage_;
+ /** . */
+ private DataStorage storage_;
+ /** . */
private POMSessionManager mgr;
/** . */
@@ -73,8 +78,7 @@
public void setUp() throws Exception
{
super.setUp();
- if (storage_ != null)
- return;
+ begin();
PortalContainer container = PortalContainer.getInstance();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
@@ -84,6 +88,8 @@
protected void tearDown() throws Exception
{
session.close();
+ end();
+ super.tearDown();
}
public void testCreatePortal() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestGadget.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -46,9 +46,8 @@
public void setUp() throws Exception
{
super.setUp();
- if (storage_ != null)
- return;
- PortalContainer container = PortalContainer.getInstance();
+ begin();
+ PortalContainer container = getContainer();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
@@ -57,6 +56,8 @@
protected void tearDown() throws Exception
{
session.close();
+ end();
+ super.tearDown();
}
public void testBilto() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestLoadedPOM.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -66,11 +66,9 @@
public void setUp() throws Exception
{
super.setUp();
-
- //
- PortalContainer container = PortalContainer.getInstance();
- portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ begin();
+ PortalContainer container = getContainer();
+ portalConfigService = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
@@ -78,9 +76,9 @@
protected void tearDown() throws Exception
{
- session.close(false);
- session = null;
- storage = null;
+ session.close();
+ end();
+ super.tearDown();
}
public void testLegacyGroupWithNormalizedName() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -21,12 +21,10 @@
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.services.organization.GroupHandler;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.test.BasicTestCase;
import java.util.Collection;
import java.util.List;
@@ -43,17 +41,17 @@
@Override
protected void setUp() throws Exception
{
- PortalContainer container = PortalContainer.getInstance();
+ super.setUp();
+ begin();
+ PortalContainer container = getContainer();
organizationService = (OrganizationService)container.getComponentInstance(OrganizationService.class);
- ((ComponentRequestLifecycle)organizationService).startRequest(container);
}
@Override
protected void tearDown() throws Exception
{
- PortalContainer container = PortalContainer.getInstance();
- organizationService = (OrganizationService)container.getComponentInstance(OrganizationService.class);
- ((ComponentRequestLifecycle)organizationService).endRequest(container);
+ end();
+ super.tearDown();
}
public void testFindGroups() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortalConfig.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -21,6 +21,7 @@
import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
@@ -53,21 +54,19 @@
public void setUp() throws Exception
{
super.setUp();
-
+ begin();
PortalContainer container = PortalContainer.getInstance();
org = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
- ((ComponentRequestLifecycle)org).startRequest(container);
}
protected void tearDown() throws Exception
{
session.close();
- storage = null;
- PortalContainer container = PortalContainer.getInstance();
- ((ComponentRequestLifecycle)org).endRequest(container);
+ end();
+ super.tearDown();
}
public void testSiteLayout() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestPortletPreferences.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -53,9 +53,8 @@
public void setUp() throws Exception
{
super.setUp();
- if (storage_ != null)
- return;
- PortalContainer container = PortalContainer.getInstance();
+ begin();
+ PortalContainer container = getContainer();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
@@ -63,8 +62,9 @@
protected void tearDown() throws Exception
{
- session.close(false);
- session = null;
+ session.close();
+ end();
+ super.tearDown();
}
public void testSiteScopedPreferences() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -66,11 +66,9 @@
public void setUp() throws Exception
{
super.setUp();
-
- //
- PortalContainer container = PortalContainer.getInstance();
- portalConfigService =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ begin();
+ PortalContainer container = getContainer();
+ portalConfigService = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
storage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
@@ -79,7 +77,8 @@
protected void tearDown() throws Exception
{
session.close();
- storage = null;
+ end();
+ super.tearDown();
}
public void testNavigation() throws Exception
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -54,6 +54,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -111,9 +112,8 @@
}
};
- PortalContainer container = PortalContainer.getInstance();
- userPortalConfigSer_ =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ PortalContainer container = getContainer();
+ userPortalConfigSer_ = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
authenticator = (Authenticator)container.getComponentInstanceOfType(Authenticator.class);
@@ -165,7 +165,7 @@
assertEquals("classic", portalCfg.getName());
assertNotNull(userPortalCfg.getNavigations());
Map<String, PageNavigation> navigations = toMap(userPortalCfg);
- assertEquals(5, navigations.size());
+ assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertTrue(navigations.containsKey("portal::classic"));
assertTrue(navigations.containsKey("group::/platform/administrators"));
assertTrue(navigations.containsKey("group::/organization/management/executive-board"));
@@ -189,7 +189,7 @@
assertEquals("classic", portalCfg.getName());
assertNotNull(userPortalCfg.getNavigations());
Map<String, PageNavigation> navigations = toMap(userPortalCfg);
- assertEquals(5, navigations.size());
+ assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertTrue(navigations.containsKey("portal::classic"));
assertTrue(navigations.containsKey("group::/platform/administrators"));
assertTrue(navigations.containsKey("group::/organization/management/executive-board"));
@@ -249,7 +249,7 @@
{
UserPortalConfig userPortalCfg = userPortalConfigSer_.getUserPortalConfig("classic", "root");
List<PageNavigation> navigations = userPortalCfg.getNavigations();
- assertEquals(5, navigations.size());
+ assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertEquals("classic", navigations.get(0).getOwnerId()); // 1
assertEquals("/platform/administrators", navigations.get(1).getOwnerId()); // 2
assertEquals("root", navigations.get(2).getOwnerId()); // 3
@@ -274,7 +274,7 @@
assertEquals("jazz", portalCfg.getName());
assertNotNull(userPortalCfg.getNavigations());
Map<String, PageNavigation> navigations = toMap(userPortalCfg);
- assertEquals(5, navigations.size());
+ assertEquals("expected to have 5 navigations instead of " + navigations, 5, navigations.size());
assertTrue(navigations.containsKey("portal::jazz"));
assertTrue(navigations.containsKey("group::/platform/administrators"));
assertTrue(navigations.containsKey("group::/organization/management/executive-board"));
@@ -565,6 +565,7 @@
}.execute(null);
}
+/*
public void testCreateMultipleNavigations(){
for(int i =0; i < 10; i++){
createNavigation(null, "group", "/platform/administrators" + i);
@@ -622,6 +623,7 @@
}
}.execute(user);
}
+*/
public void testUpdateNavigation()
{
@@ -833,6 +835,9 @@
Throwable failure = null;
//
+ begin();
+
+ //
ConversationState conversationState = null;
if (userId != null)
{
@@ -849,10 +854,6 @@
//
if (failure == null)
{
- // Clear cache
-// mgr.clearCache();
-
- //
mopSession = mgr.openSession();
if (failure == null)
{
@@ -870,8 +871,8 @@
finally
{
ConversationState.setCurrent(null);
- mopSession.close();
- mopSession = null;
+ mopSession.close(false);
+ end();
}
}
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestWSRP.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -47,11 +47,8 @@
public void setUp() throws Exception
{
super.setUp();
- if (storage_ != null)
- {
- return;
- }
- PortalContainer container = PortalContainer.getInstance();
+ begin();
+ PortalContainer container = getContainer();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
session = mgr.openSession();
@@ -59,8 +56,9 @@
protected void tearDown() throws Exception
{
- session.close(false);
- session = null;
+ session.close();
+ end();
+ super.tearDown();
}
public void testBilto() throws Exception
Modified: portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java
===================================================================
--- portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/test/core/src/main/java/org/exoplatform/component/test/AbstractGateInTest.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -18,16 +18,12 @@
*/
package org.exoplatform.component.test;
-import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.component.RequestLifeCycle;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.EnumMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
/**
@@ -40,8 +36,12 @@
public abstract class AbstractGateInTest extends TestCase
{
+ /** . */
+ private PortalContainer container;
+
protected AbstractGateInTest()
{
+ super();
}
protected AbstractGateInTest(String name)
@@ -49,6 +49,21 @@
super(name);
}
+ public PortalContainer getContainer()
+ {
+ return container;
+ }
+
+ protected void begin()
+ {
+ RequestLifeCycle.begin(container);
+ }
+
+ protected void end()
+ {
+ RequestLifeCycle.end();
+ }
+
@Override
public void runBare() throws Throwable
{
@@ -78,9 +93,7 @@
}
//
- PortalContainer container = null;
- List<ComponentRequestLifecycle> componentRLFs = Collections.emptyList();
- List<Throwable> failures = new ArrayList<Throwable>();
+// List<Throwable> failures = new ArrayList<Throwable>();
//
try
@@ -91,40 +104,19 @@
// Boot the container
container = PortalContainer.getInstance();
- // Honours the request life cycle
- componentRLFs = (List<ComponentRequestLifecycle>)container.getComponentInstancesOfType(ComponentRequestLifecycle.class);
-
- //
- for (ComponentRequestLifecycle componentRLF : componentRLFs)
- {
- componentRLF.startRequest(container);
- }
-
// Execute test
super.runBare();
}
finally
{
- if (container != null)
- {
- for (ComponentRequestLifecycle componentRLF : componentRLFs)
- {
- try
- {
- componentRLF.endRequest(container);
- }
- catch (Throwable e)
- {
- failures.add(e);
- }
- }
- }
+ container = null;
//
Thread.currentThread().setContextClassLoader(realClassLoader);
}
//
+/*
if (failures.size() > 0)
{
Throwable failure = failures.get(0);
@@ -132,5 +124,6 @@
afe.initCause(failure);
throw afe;
}
+*/
}
}
Modified: portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/test/core/src/test/java/org/exoplatform/component/test/BootstrapTestCase.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -40,8 +40,12 @@
{
PortalContainer container = PortalContainer.getInstance();
CustomService testService = (CustomService)container.getComponentInstanceOfType(CustomService.class);
+ assertNull(testService.currentContainer);
+ begin();
+ assertNotNull(testService);
assertSame(container, testService.currentContainer);
- assertNotNull(testService);
+ end();
+ assertNull(testService.currentContainer);
}
public void testDataSource() throws Exception
Modified: portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java
===================================================================
--- portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/test/organization/src/test/java/org/exoplatform/component/test/organization/BootstrapTestCase.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -52,6 +52,7 @@
OrganizationService organization = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
assertNotNull(organization);
+ begin();
User test = new UserImpl("testUser");
organization.getUserHandler().createUser(test, false);
@@ -59,6 +60,7 @@
assertNull(test);
test = organization.getUserHandler().findUserByName("testUser");
assertNotNull(test);
+ end();
}
}
\ No newline at end of file
Modified: portal/trunk/component/web/src/main/java/org/exoplatform/web/WebAppController.java
===================================================================
--- portal/trunk/component/web/src/main/java/org/exoplatform/web/WebAppController.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/component/web/src/main/java/org/exoplatform/web/WebAppController.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -22,6 +22,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.Application;
@@ -136,29 +137,14 @@
if (handler != null)
{
ExoContainer portalContainer = ExoContainerContext.getCurrentContainer();
- List<ComponentRequestLifecycle> components =
- portalContainer.getComponentInstancesOfType(ComponentRequestLifecycle.class);
+ RequestLifeCycle.begin(portalContainer);
try
{
- for (ComponentRequestLifecycle component : components)
- {
- component.startRequest(portalContainer);
- }
handler.execute(this, req, res);
}
finally
{
- for (ComponentRequestLifecycle component : components)
- {
- try
- {
- component.endRequest(portalContainer);
- }
- catch (Exception e)
- {
- log.warn("An error occured while calling the endRequest method", e);
- }
- }
+ RequestLifeCycle.end();
}
}
}
Modified: portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
===================================================================
--- portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -57,7 +57,8 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ExoContainerConfig extends JsonContainerConfig
+public class
+ ExoContainerConfig extends JsonContainerConfig
{
/** . */
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/pom.xml 2009-12-17 04:39:43 UTC (rev 1032)
@@ -37,10 +37,10 @@
<name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.2.0-Beta04</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.0-Beta04</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.0-Beta04</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.12.0-Beta04</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.2.0-Beta05</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.0-Beta05</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.0-Beta05</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.12.0-Beta05</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>SNAPSHOT-r790473</org.shindig.version>
<org.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
@@ -53,7 +53,7 @@
<rhino.version>1.6R5</rhino.version>
<org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
- <version.chromattic>1.0.0-beta10</version.chromattic>
+ <version.chromattic>1.0.0-beta11</version.chromattic>
<version.reflect>1.0.0-beta4</version.reflect>
<!-- ************** -->
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml 2009-12-17 04:39:43 UTC (rev 1032)
@@ -311,6 +311,7 @@
<type>org.exoplatform.portal.config.GroupPortalConfigListener</type>
</component-plugin>
+<!--
<component-plugin>
<name>ecm.new.user.event.listener</name>
<set-method>addListenerPlugin</set-method>
@@ -359,5 +360,6 @@
</object-param>
</init-params>
</component-plugin>
+-->
</external-component-plugins>
</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/webui-configuration.xml 2009-12-17 04:39:43 UTC (rev 1032)
@@ -32,7 +32,6 @@
<state-manager>org.exoplatform.portal.application.PortalStateManager</state-manager>
<application-lifecycle-listeners>
- <listener>org.exoplatform.portal.application.MOPSessionLifeCycle</listener>
<listener>org.exoplatform.portal.application.PortalStatisticLifecycle</listener>
<listener>org.exoplatform.portal.application.PortalApplicationLifecycle</listener>
<listener>org.exoplatform.webui.application.MonitorApplicationLifecycle</listener>
Deleted: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/MOPSessionLifeCycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/MOPSessionLifeCycle.java 2009-12-17 03:28:36 UTC (rev 1031)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/MOPSessionLifeCycle.java 2009-12-17 04:39:43 UTC (rev 1032)
@@ -1,62 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.application;
-
-import org.exoplatform.commons.chromattic.ChromatticManager;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.web.application.Application;
-import org.exoplatform.web.application.ApplicationLifecycle;
-import org.exoplatform.webui.application.WebuiRequestContext;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class MOPSessionLifeCycle implements ApplicationLifecycle<WebuiRequestContext>
-{
-
- /** . */
- private final ThreadLocal<ChromatticManager> currentMgr = new ThreadLocal<ChromatticManager>();
-
- public void onInit(Application app) throws Exception
- {
- }
-
- public void onStartRequest(Application app, WebuiRequestContext context) throws Exception
- {
- ExoContainer container = context.getApplication().getApplicationServiceContainer();
- ChromatticManager mgr = (ChromatticManager)container.getComponentInstanceOfType(ChromatticManager.class);
- mgr.beginRequest();
- currentMgr.set(mgr);
- }
-
- public void onEndRequest(Application app, WebuiRequestContext context) throws Exception
- {
- ChromatticManager mgr = currentMgr.get();
- currentMgr.remove();
-
- // Need to see if saving untouched session has an impact or not on performances
- mgr.endRequest(true);
- }
-
- public void onDestroy(Application app) throws Exception
- {
- }
-}
15 years
gatein SVN: r1031 - portal/trunk/web/portal/src/main/webapp/templates/skin/webui/component/UIHomePagePortlet.
by do-not-reply@jboss.org
Author: thuy.nguyen
Date: 2009-12-16 22:28:36 -0500 (Wed, 16 Dec 2009)
New Revision: 1031
Modified:
portal/trunk/web/portal/src/main/webapp/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css
Log:
GTNPORTAL-123: Bug in Homepage with Arabic and Ukainian language
Modified: portal/trunk/web/portal/src/main/webapp/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css
===================================================================
--- portal/trunk/web/portal/src/main/webapp/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css 2009-12-17 00:27:37 UTC (rev 1030)
+++ portal/trunk/web/portal/src/main/webapp/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css 2009-12-17 03:28:36 UTC (rev 1031)
@@ -58,7 +58,6 @@
margin: 7px auto;
}
-
.UIHomePagePortlet .TRContainer .VersionIcon {
background: url("DefaultSkin/background/HomePagePortlet.gif") no-repeat left -978px;
height: 65px;
@@ -181,11 +180,10 @@
.UIHomePagePortlet .HomePortletContent .AccountBlock {
height: 105px;
- width: 118px;
+ width: 160px;
float: left; /* orientation=lt */
float: right; /* orientation=rt */
- padding: 0px 42px 0px 0px; /* orientation=lt */
- padding: 0px 0px 0px 42px; /* orientation=rt */
+ text-align: right; /* orientation=rt */
}
.UIHomePagePortlet .HomePortletContent .AdministratorUser {
15 years
gatein SVN: r1030 - in portal/branches/wsrp-integration: component/wsrp/src/main/java/org/gatein/portal/wsrp/state and 5 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-16 19:27:37 -0500 (Wed, 16 Dec 2009)
New Revision: 1030
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- Started work to use ChromatticManager. Haven't figured out how to make it persist stuff so far so reverted to previous JCRPersister
with some modifications to make switching easier. :(
- Hooked-up JCRRegistrationPersistenceManager and fixed issues in mappings.
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -37,10 +37,10 @@
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
+import org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
-import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
import org.gatein.wsrp.api.SessionEvent;
@@ -75,9 +75,6 @@
private final String consumersConfigLocation;
private ConsumerRegistry consumerRegistry;
- private final String workspaceName;
- private final String repositoryName;
-
public ExoKernelIntegration(InitParams params, ConfigurationManager configurationManager,
org.exoplatform.portal.pc.ExoKernelIntegration pc) throws Exception
{
@@ -88,14 +85,11 @@
{
producerConfigLocation = params.getValueParam(PRODUCER_CONFIG_LOCATION).getValue();
consumersConfigLocation = params.getValueParam(CONSUMERS_CONFIG_LOCATION).getValue();
- workspaceName = params.getValueParam(WORKSPACE_NAME).getValue();
- repositoryName = params.getValueParam(REPOSITORY_NAME).getValue();
}
else
{
throw new IllegalArgumentException("Improperly configured service: missing values for "
- + PRODUCER_CONFIG_LOCATION + ", " + CONSUMERS_CONFIG_LOCATION + ", " + WORKSPACE_NAME + " and "
- + REPOSITORY_NAME);
+ + PRODUCER_CONFIG_LOCATION + "and " + CONSUMERS_CONFIG_LOCATION);
}
configurationIS = configurationManager.getInputStream(CLASSPATH + producerConfigLocation);
@@ -114,7 +108,7 @@
JCRProducerConfigurationService producerConfigurationService;
try
{
- producerConfigurationService = new JCRProducerConfigurationService(container, workspaceName, repositoryName);
+ producerConfigurationService = new JCRProducerConfigurationService(container);
producerConfigurationService.setDefaultConfigurationIS(configurationIS);
producerConfigurationService.reloadConfiguration();
}
@@ -124,7 +118,16 @@
}
container.registerComponentInstance(ProducerConfigurationService.class, producerConfigurationService);
- RegistrationPersistenceManager registrationPersistenceManager = new RegistrationPersistenceManagerImpl();
+ RegistrationPersistenceManager registrationPersistenceManager = null;
+ try
+ {
+ registrationPersistenceManager = new JCRRegistrationPersistenceManager(container);
+// registrationPersistenceManager = new RegistrationPersistenceManagerImpl();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Couln't instantiate RegistrationPersistenceManager", e);
+ }
RegistrationManager registrationManager = new RegistrationManagerImpl();
registrationManager.setPersistenceManager(registrationPersistenceManager);
@@ -172,7 +175,7 @@
try
{
- consumerRegistry = new JCRConsumerRegistry(container, workspaceName, repositoryName);
+ consumerRegistry = new JCRConsumerRegistry(container);
consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
consumerRegistry.setSessionEventBroadcaster(new SimpleSessionEventBroadcaster());
consumerRegistry.start();
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -53,12 +53,12 @@
static ThreadLocal<JCRPersister> PERSISTER = new ThreadLocal<JCRPersister>();
- public JCRPersister(ExoContainer container, String workspaceName, String repositoryName) throws RepositoryException
+ public JCRPersister(ExoContainer container) throws RepositoryException
{
try
{
RepositoryService repoService = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
- repository = repoService.getRepository(repositoryName);
+ repository = repoService.getRepository("repository");
}
catch (RepositoryConfigurationException e)
{
@@ -67,7 +67,7 @@
//
this.provider = SessionProvider.createSystemProvider();
- this.workspaceName = workspaceName;
+ this.workspaceName = "wsrp-system";
PERSISTER.set(this);
}
@@ -90,9 +90,12 @@
return chrome.openSession();
}
- public void closeSession(ChromatticSession session)
+ public void closeSession(ChromatticSession session, boolean save)
{
- session.save();
+ if (save)
+ {
+ session.save();
+ }
session.close();
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -51,14 +51,14 @@
private JCRPersister persister;
private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
- public JCRConsumerRegistry(ExoContainer container, String workspaceName, String repositoryName) throws Exception
+ public JCRConsumerRegistry(ExoContainer container) throws Exception
{
List<Class> mappingClasses = new ArrayList<Class>(6);
Collections.addAll(mappingClasses, ProducerInfosMapping.class, ProducerInfoMapping.class,
EndpointInfoMapping.class, RegistrationInfoMapping.class, RegistrationPropertyMapping.class,
RegistrationPropertyDescriptionMapping.class);
- persister = new JCRPersister(container, workspaceName, repositoryName);
+ persister = new JCRPersister(container);
persister.initializeBuilderFor(mappingClasses);
}
@@ -74,7 +74,7 @@
String key = session.persist(pims, pim, info.getId());
info.setKey(key);
- persister.closeSession(session);
+ persister.closeSession(session, true);
}
@Override
@@ -83,7 +83,7 @@
ChromatticSession session = persister.getSession();
delete(session, getPathFor(info));
- persister.closeSession(session);
+ persister.closeSession(session, true);
}
@Override
@@ -104,7 +104,7 @@
}
pim.initFrom(producerInfo);
- persister.closeSession(session);
+ persister.closeSession(session, true);
return null;
}
@@ -117,7 +117,7 @@
List<ProducerInfoMapping> mappings = producerInfosMapping.getProducerInfos();
- persister.closeSession(session);
+ persister.closeSession(session, true);
return new MappingToProducerInfoIterator(mappings.iterator());
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -43,18 +43,18 @@
*/
public class JCRProducerConfigurationService extends AbstractProducerConfigurationService
{
- private JCRPersister persister;
private static String PRODUCER_CONFIGURATION_PATH = ProducerConfigurationMapping.NODE_NAME;
private InputStream defaultConfigurationIS;
+ private JCRPersister persister;
- public JCRProducerConfigurationService(ExoContainer container, String workspaceName, String repositoryName) throws Exception
+ public JCRProducerConfigurationService(ExoContainer container) throws Exception
{
List<Class> mappingClasses = new ArrayList<Class>(3);
Collections.addAll(mappingClasses, ProducerConfigurationMapping.class, RegistrationRequirementsMapping.class,
RegistrationPropertyDescriptionMapping.class);
- persister = new JCRPersister(container, workspaceName, repositoryName);
+ persister = new JCRPersister(container);
persister.initializeBuilderFor(mappingClasses);
}
@@ -80,7 +80,7 @@
configuration = pcm.toProducerConfiguration();
- persister.closeSession(session);
+ persister.closeSession(session, true);
}
public void saveConfiguration() throws Exception
@@ -89,7 +89,7 @@
saveConfiguration(session, session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH), false);
- persister.closeSession(session);
+ persister.closeSession(session, true);
}
private ProducerConfigurationMapping saveConfiguration(ChromatticSession session, ProducerConfigurationMapping pcm, boolean forceReloadFromXML) throws Exception
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -52,9 +52,9 @@
private JCRPersister persister;
private ConsumersAndGroupsMapping mappings;
- public JCRRegistrationPersistenceManager(ExoContainer container, String workspaceName, String repositoryName) throws Exception
+ public JCRRegistrationPersistenceManager(ExoContainer container) throws Exception
{
- persister = new JCRPersister(container, workspaceName, repositoryName);
+ persister = new JCRPersister(container);
List<Class> mappingClasses = new ArrayList<Class>(5);
Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class, ConsumerMapping.class, ConsumerGroupMapping.class,
@@ -64,18 +64,18 @@
ChromatticSession session = persister.getSession();
mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
- if(mappings == null)
+ if (mappings == null)
{
- session.insert(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
+ mappings = session.insert(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
}
- persister.closeSession(session);
+ persister.closeSession(session, true);
- for (ConsumerGroupMapping cgm : mappings.getConsumerGroups().values())
+ for (ConsumerGroupMapping cgm : mappings.getConsumerGroups())
{
internalAddConsumerGroup(cgm.toConsumerGroup(this));
}
- for (ConsumerMapping cm : mappings.getConsumers().values())
+ for (ConsumerMapping cm : mappings.getConsumers())
{
internalAddConsumer(cm.toConsumer(this));
}
@@ -86,7 +86,7 @@
{
Registration registration = getRegistration(registrationId);
remove(registration.getPersistentKey(), RegistrationMapping.class);
-
+
return super.internalRemoveRegistration(registrationId);
}
@@ -98,7 +98,7 @@
RegistrationMapping rm = cm.createRegistration();
RegistrationSPI registration = newRegistrationSPI(consumer, registrationProperties, rm.getPersistentKey());
rm.initFrom(registration);
- persister.closeSession(session);
+ persister.closeSession(session, true);
return registration;
}
@@ -115,7 +115,7 @@
{
ChromatticSession session = persister.getSession();
session.remove(session.findById(clazz, id));
- persister.closeSession(session);
+ persister.closeSession(session, true);
}
@Override
@@ -126,7 +126,7 @@
ChromatticSession session = persister.getSession();
ConsumerMapping cm = mappings.createConsumer(consumerId);
cm.initFrom(consumer);
- persister.closeSession(session);
+ persister.closeSession(session, true);
return consumer;
}
@@ -156,7 +156,7 @@
ConsumerGroupMapping cgm = mappings.createConsumerGroup(name);
group.setPersistentKey(cgm.getPersistentKey());
cgm.initFrom(group);
- persister.closeSession(session);
+ persister.closeSession(session, true);
return group;
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -22,11 +22,8 @@
package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-import org.chromattic.api.RelationshipType;
import org.chromattic.api.annotations.FindById;
import org.chromattic.api.annotations.Id;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
@@ -50,16 +47,18 @@
{
public static final String NODE_NAME = "wsrp:consumergroup";
- @OneToMany(type = RelationshipType.PATH)
+ @OneToMany
@RelatedMappedBy("group")
public abstract Collection<ConsumerMapping> getConsumers();
@Property(name = "name")
public abstract String getName();
+
public abstract void setName(String name);
@Property(name = "status")
public abstract RegistrationStatus getStatus();
+
public abstract void setStatus(RegistrationStatus status);
@Id
@@ -93,12 +92,17 @@
public ConsumerGroupSPI toConsumerGroup(JCRRegistrationPersistenceManager persistenceManager) throws RegistrationException
{
ConsumerGroupSPI group = persistenceManager.newConsumerGroupSPI(getName());
- group.setStatus(getStatus());
+ RegistrationStatus status = getStatus();
+ if (status == null)
+ {
+ status = RegistrationStatus.PENDING;
+ }
+ group.setStatus(status);
for (ConsumerMapping cm : getConsumers())
{
Consumer consumer = persistenceManager.getConsumerById(cm.getPersistentKey());
- if(consumer == null)
+ if (consumer == null)
{
consumer = cm.toConsumer(persistenceManager);
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -75,7 +75,7 @@
public abstract void setStatus(RegistrationStatus status);
- @OneToMany(type = RelationshipType.PATH)
+ @OneToMany
@RelatedMappedBy("consumer")
public abstract Map<String, RegistrationMapping> getRegistrations();
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -25,29 +25,27 @@
import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.MappedBy;
-import java.util.Map;
+import java.util.List;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
@NodeMapping(name = ConsumersAndGroupsMapping.NODE_NAME)
-public abstract class ConsumersAndGroupsMapping {
- public static final String NODE_NAME = "wsrp:consumersandgroups";
+public abstract class ConsumersAndGroupsMapping
+{
+ public static final String NODE_NAME = "wsrp:consumersandgroups";
- @OneToMany
- @MappedBy("consumers")
- public abstract Map<String, ConsumerMapping> getConsumers();
+ @OneToMany
+ public abstract List<ConsumerMapping> getConsumers();
- @OneToMany
- @MappedBy("consumergroups")
- public abstract Map<String, ConsumerGroupMapping> getConsumerGroups();
+ @OneToMany
+ public abstract List<ConsumerGroupMapping> getConsumerGroups();
- @Create
- public abstract ConsumerMapping createConsumer(String id);
+ @Create
+ public abstract ConsumerMapping createConsumer(String id);
- @Create
- public abstract ConsumerGroupMapping createConsumerGroup(String name);
+ @Create
+ public abstract ConsumerGroupMapping createConsumerGroup(String name);
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-17 00:27:37 UTC (rev 1030)
@@ -22,7 +22,6 @@
package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-import org.chromattic.api.RelationshipType;
import org.chromattic.api.annotations.FindById;
import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.ManyToOne;
@@ -37,11 +36,6 @@
import org.gatein.registration.spi.ConsumerSPI;
import org.gatein.registration.spi.RegistrationSPI;
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -54,16 +48,18 @@
@Id
public abstract String getPersistentKey();
- @ManyToOne(type = RelationshipType.PATH)
+ @ManyToOne
@MappedBy("consumer")
public abstract ConsumerMapping getConsumer();
@Property(name = "status")
public abstract RegistrationStatus getStatus();
+
public abstract void setStatus(RegistrationStatus status);
@Property(name = "registrationhandle")
public abstract String getRegistrationHandle();
+
public abstract void setRegistrationHandle(String handle);
@OneToOne
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2009-12-17 00:27:37 UTC (rev 1030)
@@ -32,15 +32,15 @@
<supertype>mix:referenceable</supertype>
</supertypes>
<childNodeDefinitions>
- <childNodeDefinition name="consumers" defaultPrimaryType="wsrp:consumer"
- autoCreated="true" mandatory="false" onParentVersion="COPY" protected="false"
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:consumer"
+ autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>wsrp:consumer</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
- <childNodeDefinition name="consumergroups" defaultPrimaryType="wsrp:consumergroup"
- autoCreated="true" mandatory="false" onParentVersion="COPY" protected="false"
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:consumergroup"
+ autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false"
sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>wsrp:consumergroup</requiredPrimaryType>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-12-16 11:15:25 UTC (rev 1029)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-12-17 00:27:37 UTC (rev 1030)
@@ -39,17 +39,44 @@
<description>Location of the default consumers configuration file</description>
<value>conf/wsrp-consumers-config.xml</value>
</value-param>
- <value-param>
- <name>workspaceName</name>
- <description>Name of the JCR workspace for WSRP persistence</description>
- <value>wsrp-system</value>
- </value-param>
- <value-param>
- <name>repositoryName</name>
- <description>Name of the JCR repository for WSRP persistence</description>
- <value>repository</value>
- </value-param>
</init-params>
</component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>wsrp</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>wsrp-system</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+ <value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
+ <value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.configuration.mapping.ProducerConfigurationMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.configuration.mapping.RegistrationRequirementsMapping
+ </value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerCapabilitiesMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerGroupMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumersAndGroupsMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationMapping</value>
+ <value>org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationPropertiesMapping</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
15 years
gatein SVN: r1029 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-12-16 06:15:25 -0500 (Wed, 16 Dec 2009)
New Revision: 1029
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-301: ClassCastException while drag/drop dashboard in edit/create page
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-12-16 08:17:11 UTC (rev 1028)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-12-16 11:15:25 UTC (rev 1029)
@@ -187,7 +187,7 @@
/** Update server-side */
UIContainer parentOfTopAncestor = topAncestor.getParent();
parentOfTopAncestor.removeChildById(topAncestorId);
-
+
/** Update client side */
if (topAncestorId.startsWith(UI_CONTAINER_PREFIX))
{
@@ -197,9 +197,12 @@
removeComponent(topAncestorId, UI_CONTAINER_PREFIX, pcontext);
return;
}
-
- /** If the uiParent is not the topAncestor and having no child, then it is removed */
- if(uiParent.getChildren().size() == 0)
+
+ /**
+ * If the uiParent is not the topAncestor and having no child,
+ * then it is removed
+ */
+ if (uiParent.getChildren().size() == 0)
{
/** Update server-side */
UIContainer itsParent = uiParent.getParent();
@@ -376,11 +379,17 @@
uiPortlet.setAccessPermissions(accessPers);
UIPage uiPage = uiTarget.getAncestorOfType(UIPage.class);
- //
- CloneApplicationState state = new CloneApplicationState<Object>(app.getStorageId());
-
- //
- uiPortlet.setState(new PortletState(state, applicationType));
+ // Hardcode on state to fix error while drag/drop Dashboard
+ if ("dashboard/DashboardPortlet".equals(app.getContentId()))
+ {
+ TransientApplicationState state = new TransientApplicationState<Object>(app.getContentId());
+ uiPortlet.setState(new PortletState(state, applicationType));
+ }
+ else
+ {
+ CloneApplicationState state = new CloneApplicationState<Object>(app.getStorageId());
+ uiPortlet.setState(new PortletState(state, applicationType));
+ }
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
uiPortlet.setShowEditControl(true);
uiSource = uiPortlet;
@@ -510,14 +519,15 @@
{
String portalName = event.getRequestContext().getRequestParameter("portalName");
UIPortal uiPortal = Util.getUIPortal();
- UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
+ UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
- if(portalName !=null && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null)
+ if (portalName != null
+ && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null)
{
- uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",new String[]{portalName}));
+ uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist", new String[]{portalName}));
return;
}
-
+
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
portalForm.setPortalOwner(portalName);
15 years
gatein SVN: r1028 - portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-16 03:17:11 -0500 (Wed, 16 Dec 2009)
New Revision: 1028
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageCreateDescription.gtmpl
Log:
GTNPORTAL-386: Wrong import in groovy script
(Contribution of Luca Stancapiano)
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageCreateDescription.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageCreateDescription.gtmpl 2009-12-16 08:11:01 UTC (rev 1027)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageCreateDescription.gtmpl 2009-12-16 08:17:11 UTC (rev 1028)
@@ -1,5 +1,3 @@
-<% import org.exoplatform.webui.core.UIDescription; %>
-
<div class="TopTitleBar">
<div class="DecoratorBox">
<div class="BarDecorator">
15 years
gatein SVN: r1027 - portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-16 03:11:01 -0500 (Wed, 16 Dec 2009)
New Revision: 1027
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
Log:
GTNPORTAL-304 Add tooltip for Search User icon
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-12-16 07:32:57 UTC (rev 1026)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-12-16 08:11:01 UTC (rev 1027)
@@ -19,3 +19,4 @@
UIRegisterForm.registerWithSuccess.message=You have successfully registered a new account!
UIRegisterForm.title=Register New Account
+UIRegisterForm.label.action.CheckUsernameAvailability=Check availability
15 years
gatein SVN: r1026 - components/sso/trunk/packaging/josso.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-16 02:32:57 -0500 (Wed, 16 Dec 2009)
New Revision: 1026
Modified:
components/sso/trunk/packaging/josso/pom.xml
Log:
JOSSO 1.8 (packaging notes)
Modified: components/sso/trunk/packaging/josso/pom.xml
===================================================================
--- components/sso/trunk/packaging/josso/pom.xml 2009-12-16 07:16:17 UTC (rev 1025)
+++ components/sso/trunk/packaging/josso/pom.xml 2009-12-16 07:32:57 UTC (rev 1026)
@@ -109,6 +109,19 @@
overwrite="true"/>
<!-- Deploy JOSSO Agent dependencies -->
+ <!--
+ NOTE: Thirdparty JOSSO dependencies to be copied to portal.war/WEB-INF/lib
+
+ * axis-1.4.jar
+ * commons-discovery-0.2.jar
+ * josso-agents-bin-1.8.1.jar
+ * josso-agents-shared-1.8.1.jar
+ * spring-aop-2.5.5.jar
+ * spring-beans-2.5.5.jar
+ * spring-context-2.5.5.jar
+ * spring-core-2.5.5.jar
+ * xbean-spring-3.4.3.jar
+ -->
</tasks>
</configuration>
15 years
gatein SVN: r1025 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-16 02:16:17 -0500 (Wed, 16 Dec 2009)
New Revision: 1025
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
Log:
GTNPORTAL-333 Nothing changes when check Search User function with new account's user name does not exist in Register New Accout portlet
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-12-16 06:45:42 UTC (rev 1024)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-12-16 07:16:17 UTC (rev 1025)
@@ -19,9 +19,6 @@
package org.exoplatform.account.webui.component;
-import java.util.ArrayList;
-import java.util.List;
-
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserHandler;
import org.exoplatform.web.application.ApplicationMessage;
@@ -40,6 +37,9 @@
import org.exoplatform.webui.form.UIFormInputWithActions.ActionData;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import java.util.ArrayList;
+import java.util.List;
+
/**
*
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
@@ -122,13 +122,17 @@
}
String typedUsername = userNameInput.getValue();
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ UIApplication uiApp = context.getUIApplication();
if (usernameIsUsed(typedUsername, orgService))
{
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- UIApplication uiApp = context.getUIApplication();
-
- uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", new String[]{typedUsername}));
+ uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", new String[]{typedUsername},
+ ApplicationMessage.WARNING));
}
+ else
+ {
+ uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-not-exist", new String[]{typedUsername}));
+ }
}
private boolean usernameIsUsed(String username, OrganizationService orgService)
15 years
gatein SVN: r1024 - in components/sso/trunk: agent/src/main/java/org/gatein/sso/agent and 6 other directories.
by do-not-reply@jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-12-16 01:45:42 -0500 (Wed, 16 Dec 2009)
New Revision: 1024
Added:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInAgentRequest.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInLocalSession.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInSSOAgent.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/LocalSessionImpl.java
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/classes/
components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/classes/josso-agent-config.xml
Modified:
components/sso/trunk/agent/pom.xml
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
components/sso/trunk/gatein-josso-plugin/pom.xml
components/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java
components/sso/trunk/packaging/josso/pom.xml
Log:
JOSSO 1.8 (end-to-end)
Modified: components/sso/trunk/agent/pom.xml
===================================================================
--- components/sso/trunk/agent/pom.xml 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/agent/pom.xml 2009-12-16 06:45:42 UTC (rev 1024)
@@ -75,6 +75,21 @@
<skip>true</skip>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${version.xbean}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <namespace>urn:org:josso:agent:generic-servlet</namespace>
+ </configuration>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/GenericSSOAgent.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -63,7 +63,7 @@
{
try
{
- this.processSSOToken(req);
+ this.processSSOToken(req,resp);
super.doGet(req, resp);
}
catch(Exception e)
@@ -80,7 +80,7 @@
this.doGet(req, resp);
}
- private void processSSOToken(HttpServletRequest httpRequest) throws Exception
+ private void processSSOToken(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws Exception
{
String ticket = httpRequest.getParameter("ticket");
String jossoAssertion = httpRequest.getParameter("josso_assertion_id");
@@ -91,8 +91,8 @@
}
else if (jossoAssertion != null && jossoAssertion.trim().length() > 0)
{
- //TODO: fix the JOSSO Agent. This will need to the new client side JOSSO stack that can run on 5.1.0.GA
- JOSSOAgent.getInstance(this.ssoServerUrl).validateTicket(httpRequest);
+ //the JOSSO Agent. This will need to the new client side JOSSO stack that can run on 5.1.0.GA
+ JOSSOAgent.getInstance().validateTicket(httpRequest,httpResponse);
}
else
{
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInAgentRequest.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInAgentRequest.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInAgentRequest.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, 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.sso.agent.josso;
+
+import org.josso.agent.LocalSession;
+
+import org.josso.agent.http.HttpSSOAgentRequest;
+import org.josso.agent.http.JOSSOSecurityContext;
+
+/**
+ *
+ * @author <a href="mailto:sgonzalez@josso.org">Sebastian Gonzalez Oyuela</a>
+ */
+public class GateInAgentRequest extends HttpSSOAgentRequest
+{
+ private JOSSOSecurityContext ctx;
+
+ public GateInAgentRequest(int action, String sessionId, LocalSession session,
+ String assertionId)
+ {
+ super(action, sessionId, session, assertionId);
+ }
+
+ public GateInAgentRequest(int action, String sessionId, LocalSession session)
+ {
+ super(action, sessionId, session);
+ }
+
+ public void setSecurityContext(JOSSOSecurityContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ public JOSSOSecurityContext getSecurityContext()
+ {
+ return this.ctx;
+ }
+
+}
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInLocalSession.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInLocalSession.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInLocalSession.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, 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.sso.agent.josso;
+
+import javax.servlet.http.HttpSession;
+import org.josso.agent.http.JOSSOSecurityContext;
+import org.josso.agent.http.WebAccessControlUtil;
+
+/**
+ *
+ * @author <a href="mailto:sgonzalez@josso.org">Sebastian Gonzalez Oyuela</a>
+ */
+public class GateInLocalSession extends LocalSessionImpl
+{
+
+ public GateInLocalSession(HttpSession httpSession)
+ {
+ super();
+
+ setWrapped(httpSession);
+ setMaxInactiveInterval(httpSession.getMaxInactiveInterval());
+
+ }
+
+ public void setSecurityContext(JOSSOSecurityContext ctx)
+ {
+ HttpSession session = (HttpSession) getWrapped();
+ session.setAttribute(WebAccessControlUtil.KEY_JOSSO_SECURITY_CONTEXT, ctx);
+ }
+}
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInSSOAgent.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/GateInSSOAgent.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -0,0 +1,69 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, 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.sso.agent.josso;
+
+import org.apache.log4j.Logger;
+
+import org.josso.agent.SSOAgentRequest;
+import org.josso.agent.http.HttpSSOAgent;
+
+import java.security.Principal;
+
+/**
+ *
+ * @org.apache.xbean.XBean element="agent"
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class GateInSSOAgent extends HttpSSOAgent
+{
+
+ private static final Logger log = Logger.getLogger(GateInSSOAgent.class);
+
+ protected Principal authenticate(SSOAgentRequest request)
+ {
+ try
+ {
+ String ssoSessionId = request.getSessionId();
+ return this.getSSOIdentityManager().findUserInSession(ssoSessionId);
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected boolean isAuthenticationAlwaysRequired()
+ {
+ return true;
+ }
+
+ protected void log(String message)
+ {
+ log.debug(message);
+ }
+
+ protected void log(String message, Throwable throwable)
+ {
+ log.debug(message, throwable);
+ }
+}
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/JOSSOAgent.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -22,22 +22,19 @@
package org.gatein.sso.agent.josso;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.exoplatform.web.security.Credentials;
import org.gatein.sso.agent.GenericSSOAgent;
-import org.josso.agent.SSOAgent;
+
import org.josso.agent.Lookup;
import org.josso.agent.SSOAgentRequest;
import org.josso.agent.SingleSignOnEntry;
+import org.josso.agent.http.HttpSSOAgent;
-import org.josso.servlet.agent.GenericServletSSOAgentRequest;
-import org.josso.servlet.agent.GenericServletLocalSession;
-
/**
- * TODO: This is broken. This will need a JBoss 5.1.0.GA based JOSSO client stack
- *
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*/
public class JOSSOAgent
@@ -45,14 +42,27 @@
private static Logger log = Logger.getLogger(Logger.class);
private static JOSSOAgent singleton;
- private String serverUrl = null;
+ private HttpSSOAgent httpAgent;
- private JOSSOAgent(String serverUrl)
+ private JOSSOAgent()
{
- this.serverUrl = serverUrl;
+ try
+ {
+ //Initializing the JOSSO Agent
+ Lookup lookup = Lookup.getInstance();
+ lookup.init("josso-agent-config.xml");
+
+ this.httpAgent = (HttpSSOAgent) lookup.lookupSSOAgent();
+ this.httpAgent.start();
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ throw new RuntimeException(e);
+ }
}
- public static JOSSOAgent getInstance(String serverUrl)
+ public static JOSSOAgent getInstance()
{
if(JOSSOAgent.singleton == null)
{
@@ -60,22 +70,49 @@
{
if(JOSSOAgent.singleton == null)
{
- JOSSOAgent.singleton = new JOSSOAgent(serverUrl);
+ JOSSOAgent.singleton = new JOSSOAgent();
}
}
}
return JOSSOAgent.singleton;
}
- public void validateTicket(HttpServletRequest httpRequest) throws Exception
+ public void validateTicket(HttpServletRequest httpRequest,HttpServletResponse httpResponse) throws Exception
{
String ticket = httpRequest.getParameter("josso_assertion_id");
- log.info("Trying to validate the following Ticket: "+ticket);
+ log.debug("Trying to validate the following Ticket: "+ticket);
- //TODO: Use the JOSSO Client Library to validate the token and extract the subject that was authenticated
+ //Use the JOSSO Client Library to validate the token and extract the subject that was authenticated
+ SSOAgentRequest agentRequest = this.doMakeSSOAgentRequest(SSOAgentRequest.ACTION_RELAY,
+ null, ticket, httpRequest, httpResponse);
- //Just do a hack login for now...to cutoff the infinite redirects
- Credentials credentials = new Credentials("demo", "");
- httpRequest.getSession().setAttribute(GenericSSOAgent.CREDENTIALS, credentials);
+ SingleSignOnEntry entry = this.httpAgent.processRequest(agentRequest);
+
+ if(entry != null)
+ {
+ String sessionId = agentRequest.getSessionId();
+ String assertionId = agentRequest.getAssertionId();
+ String principal = entry.principal.getName();
+
+ log.debug("-----------------------------------------------------------");
+ log.debug("SessionId: "+sessionId);
+ log.debug("AssertionId: "+assertionId);
+ log.debug("Principal: "+principal);
+ log.debug("-----------------------------------------------------------");
+
+ Credentials credentials = new Credentials(principal, "");
+ httpRequest.getSession().setAttribute(GenericSSOAgent.CREDENTIALS, credentials);
+ }
}
+
+ protected SSOAgentRequest doMakeSSOAgentRequest(int action, String sessionId, String assertionId,
+ HttpServletRequest hreq, HttpServletResponse hres)
+ {
+ GateInAgentRequest r = new GateInAgentRequest(action, sessionId, new GateInLocalSession(hreq.getSession()), assertionId);
+ r.setRequest(hreq);
+ r.setResponse(hres);
+
+ return r;
+
+ }
}
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/LocalSessionImpl.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/LocalSessionImpl.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/josso/LocalSessionImpl.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2006, 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.sso.agent.josso;
+
+import org.josso.agent.LocalSession;
+import org.josso.agent.LocalSessionEvent;
+import org.josso.agent.LocalSessionListener;
+
+import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ *
+ * @author <a href="mailto:sgonzalez@josso.org">Sebastian Gonzalez Oyuela</a>
+ */
+public class LocalSessionImpl implements LocalSession
+{
+
+ /**
+ * The session event listeners for this Session.
+ */
+ private transient ArrayList _listeners = new ArrayList();
+ private long _creationTime;
+
+ private String _id;
+
+ private long _lastAccessedTime;
+
+ private int _maxInactiveInterval;
+
+ private Object _wrapped;
+
+ public LocalSessionImpl()
+ {
+ }
+
+ public long getCreationTime()
+ {
+ return _creationTime;
+ }
+
+ public String getId()
+ {
+ return _id;
+ }
+
+ public long getLastAccessedTime()
+ {
+ return _lastAccessedTime;
+ }
+
+ public void setMaxInactiveInterval(int i)
+ {
+ _maxInactiveInterval = i;
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return _maxInactiveInterval;
+ }
+
+ public void expire()
+ {
+
+ Iterator i = _listeners.iterator();
+ while (i.hasNext())
+ {
+ LocalSessionListener listener = (LocalSessionListener) i.next();
+
+ listener.localSessionEvent(new LocalSessionEvent(this,
+ LocalSession.LOCAL_SESSION_DESTROYED_EVENT, null));
+ }
+ }
+
+ public void addSessionListener(LocalSessionListener sessionListener)
+ {
+ _listeners.add(sessionListener);
+ }
+
+ public void removeSessionListener(LocalSessionListener sessionListener)
+ {
+ _listeners.remove(sessionListener);
+ }
+
+ public void exipre()
+ {
+ ((HttpSession) _wrapped).invalidate();
+ }
+
+ public void setWrapped(Object wrapped)
+ {
+ _wrapped = wrapped;
+ }
+
+ public Object getWrapped()
+ {
+ return _wrapped;
+ }
+}
Modified: components/sso/trunk/gatein-josso-plugin/pom.xml
===================================================================
--- components/sso/trunk/gatein-josso-plugin/pom.xml 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/gatein-josso-plugin/pom.xml 2009-12-16 06:45:42 UTC (rev 1024)
@@ -23,7 +23,11 @@
<dependency>
<groupId>org.josso</groupId>
<artifactId>josso-basic-authscheme</artifactId>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: components/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java
===================================================================
--- components/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/gatein-josso-plugin/src/main/java/org/gatein/sso/josso/plugin/GateinIdentityPlugin.java 2009-12-16 06:45:42 UTC (rev 1024)
@@ -22,36 +22,36 @@
******************************************************************************/
package org.gatein.sso.josso.plugin;
+import java.io.InputStream;
+import java.util.Properties;
+
import org.apache.log4j.Logger;
-import org.josso.gateway.SSONameValuePair;
import org.josso.gateway.identity.exceptions.NoSuchUserException;
import org.josso.gateway.identity.exceptions.SSOIdentityException;
import org.josso.gateway.identity.service.BaseRole;
-import org.josso.gateway.identity.service.BaseRoleImpl;
import org.josso.gateway.identity.service.BaseUser;
import org.josso.gateway.identity.service.BaseUserImpl;
import org.josso.gateway.identity.service.store.UserKey;
-import org.josso.gateway.identity.service.store.SimpleUserKey;
import org.josso.gateway.identity.service.store.IdentityStore;
import org.josso.auth.Credential;
import org.josso.auth.CredentialKey;
import org.josso.auth.CredentialProvider;
import org.josso.auth.scheme.AuthenticationScheme;
-import org.josso.auth.scheme.UsernameCredential;
-import org.josso.auth.scheme.PasswordCredential;
import org.josso.auth.BindableCredentialStore;
import org.josso.auth.exceptions.SSOAuthenticationException;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.GetMethod;
+
/**
* @org.apache.xbean.XBean element="gatein-store"
*
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
*/
-public class GateinIdentityPlugin implements IdentityStore,
- BindableCredentialStore
+public class GateinIdentityPlugin implements BindableCredentialStore,IdentityStore
{
private static Logger log = Logger.getLogger(GateinIdentityPlugin.class);
@@ -67,9 +67,17 @@
*/
public GateinIdentityPlugin()
{
+ InputStream is = null;
try
{
- // TODO: readin GateIn configuration from WEB-INF/gatein.properties
+ ///Load the GateIn properties
+ Properties properties = new Properties();
+ is = Thread.currentThread().getContextClassLoader().getResourceAsStream("gatein.properties");
+ properties.load(is);
+
+ this.gateInHost = properties.getProperty("host");
+ this.gateInPort = properties.getProperty("port");
+ this.gateInContext = properties.getProperty("context");
log
.info("-------------------------------------------------------------------");
@@ -87,6 +95,13 @@
throw new RuntimeException(
"GateIn Identity Plugin registration failed....");
}
+ finally
+ {
+ if(is != null)
+ {
+ try{is.close();}catch(Exception e){}
+ }
+ }
}
public void setAuthenticationScheme(AuthenticationScheme authenticationScheme)
@@ -128,15 +143,12 @@
// implementation------------------------------------------------------------------------------------------------------------------------
public boolean userExists(UserKey userKey) throws SSOIdentityException
{
- log.info("User: "+userKey+" exists....");
return true;
}
public BaseRole[] findRolesByUserKey(UserKey userKey)
throws SSOIdentityException
{
- log.info("Loading Roles for..."+userKey);
-
return null;
}
@@ -145,11 +157,6 @@
{
BaseUser user = new BaseUserImpl();
user.setName(userKey.toString());
- user.addProperty("password", "");
-
- log.info("Loading User................................................................");
- log.info("User:"+user.getName());
-
return user;
}
// ---------------CredentialStore
@@ -157,30 +164,68 @@
public Credential[] loadCredentials(CredentialKey credentialKey,
CredentialProvider credentialProvider) throws SSOIdentityException
{
- log.info("Loading Credentials using the new method................................................................");
- return loadCredentials(credentialKey);
+ return null;
}
public Credential[] loadCredentials(CredentialKey credentialKey) throws SSOIdentityException
{
- // Get the User corresponding to this credentialKey
- BaseUser user = this.loadUser((SimpleUserKey) credentialKey);
- SSONameValuePair[] properties = user.getProperties();
- String password = properties[0].getValue();
-
- log.info("Loading Credentials for................................................................");
- log.info("User:"+user.getName());
- log.info("Password:"+password);
- return new Credential[] { new UsernameCredential(user.getName()),new PasswordCredential(password) };
+ return null;
}
public boolean bind(String username, String password)
throws SSOAuthenticationException
{
- // return this.portalIdentityService.authenticate(username, password);
- log.info("Performing Authentication........................");
- log.info("Username: "+username);
- log.info("Password: "+password);
- return true;
+ try
+ {
+ // return this.portalIdentityService.authenticate(username, password);
+ log.debug("Performing Authentication........................");
+ log.debug("Username: "+username);
+ log.debug("Password: "+password);
+
+ StringBuilder urlBuffer = new StringBuilder();
+ urlBuffer.append("http://" + this.gateInHost + ":" + this.gateInPort + "/"
+ + this.gateInContext + "/rest/sso/authcallback/auth/" + username + "/"
+ + password);
+
+ boolean success = this.executeRemoteCall(urlBuffer.toString());
+
+ return success;
+ }
+ catch(Exception e)
+ {
+ throw new SSOAuthenticationException(e);
+ }
}
+ //------------------------------------------------------------------------------------------------------------------------------------------
+ private boolean executeRemoteCall(String authUrl) throws Exception
+ {
+ HttpClient client = new HttpClient();
+ GetMethod method = null;
+ try
+ {
+ method = new GetMethod(authUrl);
+
+ int status = client.executeMethod(method);
+ String response = method.getResponseBodyAsString();
+
+ switch (status)
+ {
+ case 200:
+ if (response.equals(Boolean.TRUE.toString()))
+ {
+ return true;
+ }
+ break;
+ }
+
+ return false;
+ }
+ finally
+ {
+ if (method != null)
+ {
+ method.releaseConnection();
+ }
+ }
+ }
}
Modified: components/sso/trunk/packaging/josso/pom.xml
===================================================================
--- components/sso/trunk/packaging/josso/pom.xml 2009-12-16 06:15:40 UTC (rev 1023)
+++ components/sso/trunk/packaging/josso/pom.xml 2009-12-16 06:45:42 UTC (rev 1024)
@@ -109,11 +109,7 @@
overwrite="true"/>
<!-- Deploy JOSSO Agent dependencies -->
- <!--
- <copy file="${settings.localRepository}/opensso/openssoclientsdk/${version.opensso}/openssoclientsdk-${version.opensso}.jar"
- todir="${gatein.location}/deploy/gatein.ear/lib"
- overwrite="true"/>
- -->
+
</tasks>
</configuration>
<goals>
@@ -165,7 +161,13 @@
<!-- copy thirdparty dependency -->
<copy tofile="${basedir}/target/plugin/webapps/josso/WEB-INF/lib/log4j.jar"
file="${settings.localRepository}/apache-log4j/log4j/${version.log4j}/log4j-${version.log4j}.jar"
- overwrite="true"/>
+ overwrite="true"/>
+ <copy tofile="${basedir}/target/plugin/webapps/josso/WEB-INF/lib/commons-httpclient.jar"
+ file="${settings.localRepository}/commons-httpclient/commons-httpclient/${version.commons-httpclient}/commons-httpclient-${version.commons-httpclient}.jar"
+ overwrite="true"/>
+ <copy tofile="${basedir}/target/plugin/webapps/josso/WEB-INF/lib/commons-logging.jar"
+ file="${settings.localRepository}/commons-logging/commons-logging/${version.commons-logging}/commons-logging-${version.commons-logging}.jar"
+ overwrite="true"/>
</tasks>
</configuration>
<goals>
Added: components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/classes/josso-agent-config.xml
===================================================================
--- components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/classes/josso-agent-config.xml (rev 0)
+++ components/sso/trunk/packaging/josso/src/main/config/gatein/portal.war/WEB-INF/classes/josso-agent-config.xml 2009-12-16 06:45:42 UTC (rev 1024)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<s:beans xmlns:s="http://www.springframework.org/schema/beans"
+ xmlns:gen-svlt="urn:org:josso:agent:generic-servlet"
+ xmlns:agent="urn:org:josso:agent:core"
+ xmlns:protocol="urn:org:josso:protocol:client"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+<gen-svlt:agent name="josso-tomcat60-agent" sessionAccessMinInterval="1000">
+
+ <gatewayLoginUrl>http://localhost:8888/josso/signon/login.do</gatewayLoginUrl>
+ <gatewayLogoutUrl>http://localhost:8888/josso/signon/logout.do</gatewayLogoutUrl>
+
+ <gatewayServiceLocator>
+ <protocol:ws-service-locator endpoint="localhost:8888"/>
+ </gatewayServiceLocator>
+ <configuration>
+ <agent:agent-configuration>
+ <agent:partner-apps>
+ <agent:partner-app id="portal" context="/portal"/>
+ </agent:partner-apps>
+ </agent:agent-configuration>
+ </configuration>
+ <parametersBuilders>
+ <agent:vhost-parameters-builder/>
+ <agent:appctx-parameters-builder/>
+ </parametersBuilders>
+ </gen-svlt:agent>
+</s:beans>
\ No newline at end of file
15 years
gatein SVN: r1023 - portal/trunk/docs/user-guide/en/modules/language.
by do-not-reply@jboss.org
Author: smumford
Date: 2009-12-16 01:15:40 -0500 (Wed, 16 Dec 2009)
New Revision: 1023
Modified:
portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml
Log:
correct minor xml errors
Modified: portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml 2009-12-16 04:51:04 UTC (rev 1022)
+++ portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml 2009-12-16 06:15:40 UTC (rev 1023)
@@ -150,12 +150,12 @@
A Create/Edit node dialog appears, enter a resource key in the <emphasis role="bold">Label</emphasis> field
</para>
</step>
+ </procedure>
<note>
<para>
You can reuse the same resource key in several nodes.
</para>
</note>
- </procedure>
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Internationalize_Resource_Keys">
@@ -163,7 +163,7 @@
<para>
&PRODUCT; organizes resource keys in resource files. Each file contains a list of keys and their meanings (translations) in one specific language. Normally one resource file has one language supported by Portal. This helps to structure the resource keys. Each resource file has a name and a language attribute. One resource file only can contain translations for one single language.
</para>
- <procedure>
+
<para>
Do as follows: 1. Go to <emphasis role="bold">GateIn Start</emphasis> -> <emphasis role="bold">Page Navigation</emphasis> -> <emphasis role="bold">Administration</emphasis> --> <emphasis role="bold">Internationalization</emphasis>
</para>
@@ -219,6 +219,7 @@
<para>
5. Click on the <emphasis role="bold">Save</emphasis> button.
</para>
+
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Example">
15 years