gatein SVN: r1052 - components/common/trunk/common/src/main/java/org/gatein/common/i18n.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 12:06:31 -0500 (Thu, 17 Dec 2009)
New Revision: 1052
Removed:
components/common/trunk/common/src/main/java/org/gatein/common/i18n/LocaleManager.java
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/i18n/DefaultLocaleFormat.java
Log:
GTNPORTAL-8 : Remove unnecessary blocking method call (2s)
Modified: components/common/trunk/common/src/main/java/org/gatein/common/i18n/DefaultLocaleFormat.java
===================================================================
--- components/common/trunk/common/src/main/java/org/gatein/common/i18n/DefaultLocaleFormat.java 2009-12-17 15:23:11 UTC (rev 1051)
+++ components/common/trunk/common/src/main/java/org/gatein/common/i18n/DefaultLocaleFormat.java 2009-12-17 17:06:31 UTC (rev 1052)
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
@@ -40,20 +39,9 @@
class DefaultLocaleFormat extends AbstractLocaleFormat
{
- /** . */
- private static final Map<String, Locale> CACHE = new HashMap<String, Locale>();
+ /** A copy on write cache (yeah not volatile, so what?). */
+ private Map<String, Locale> CACHE = new HashMap<String, Locale>();
- static
- {
- for (Iterator<Locale> i = LocaleManager.getLocales().iterator(); i.hasNext();)
- {
- Locale locale = (Locale)i.next();
-
- //
- CACHE.put(locale.toString(), locale);
- }
- }
-
/** . */
private LocaleFactory factory;
@@ -69,7 +57,7 @@
protected Locale internalGetLocale(String value) throws FormatConversionException
{
- Locale locale = (Locale)CACHE.get(value);
+ Locale locale = CACHE.get(value);
if (locale != null)
{
return locale;
@@ -79,38 +67,44 @@
int p1 = value.lastIndexOf('_');
if (p1 < 0)
{
- return factory.createLocale(value);
+ locale = factory.createLocale(value);
}
-
- //
- String a = (p1 == (value.length() - 1)) ? "" : value.substring(p1 + 1, value.length());
-
- //
- int p2 = value.lastIndexOf('_', p1 - 1);
- if (p2 < 0)
+ else
{
- if (a.length() == 0)
+ String a = (p1 == (value.length() - 1)) ? "" : value.substring(p1 + 1, value.length());
+ int p2 = value.lastIndexOf('_', p1 - 1);
+ if (p2 < 0)
{
- throw new FormatConversionException();
+ if (a.length() == 0)
+ {
+ throw new FormatConversionException();
+ }
+ else
+ {
+ locale = factory.createLocale(value.substring(0, p1), a);
+ }
}
else
{
- return factory.createLocale(value.substring(0, p1), a);
+ boolean emptyLanguage = p2 == p1 - 1;
+ if (p2 == 0 && emptyLanguage)
+ {
+ throw new FormatConversionException();
+ }
+
+ //
+ String b = emptyLanguage ? "" : value.substring(p2 + 1, p1);
+ locale = factory.createLocale(value.substring(0, p2), b, a);
}
}
//
- boolean emptyLanguage = p2 == p1 - 1;
- if (p2 == 0 && emptyLanguage)
- {
- throw new FormatConversionException();
- }
+ Map<String, Locale> copy = new HashMap<String, Locale>(CACHE);
+ copy.put(locale.toString(), locale);
+ CACHE = copy;
//
- String b = emptyLanguage ? "" : value.substring(p2 + 1, p1);
-
- //
- return factory.createLocale(value.substring(0, p2), b, a);
+ return locale;
}
protected void internalWrite(Locale locale, CharWriter writer) throws IOException
Deleted: components/common/trunk/common/src/main/java/org/gatein/common/i18n/LocaleManager.java
===================================================================
--- components/common/trunk/common/src/main/java/org/gatein/common/i18n/LocaleManager.java 2009-12-17 15:23:11 UTC (rev 1051)
+++ components/common/trunk/common/src/main/java/org/gatein/common/i18n/LocaleManager.java 2009-12-17 17:06:31 UTC (rev 1052)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, 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.common.i18n;
-
-import org.gatein.common.util.Tools;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Locale;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 7228 $
- */
-public class LocaleManager
-{
-
- /** . */
- private static final Collection<Locale> all = Collections.unmodifiableSet(Tools.toSet(Locale.getAvailableLocales()));
-
- /** Return a collection of all available locale info for the platform. */
- public static Collection<Locale> getLocales()
- {
- return all;
- }
-}
15 years
gatein SVN: r1051 - in portal/trunk: component/application-registry/src/test/java/conf and 8 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 10:23:11 -0500 (Thu, 17 Dec 2009)
New Revision: 1051
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java
portal/trunk/component/application-registry/src/test/java/conf/application-registry-configuration.xml
portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
portal/trunk/component/common/pom.xml
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/Synchronization.java
portal/trunk/component/common/src/test/resources/conf/test-configuration.xml
portal/trunk/component/portal/src/test/java/conf/portal/portal-configuration.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
- on Synchronization rename "save" attribute to "saveOnClose" name
- rename "name" on chromattic life cycle to "domain-name"
- added logging in chromattic life cycle
- trim entity class names before they are loaded from class loader in chromattic life cycle
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/impl/ApplicationRegistryServiceImpl.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -620,7 +620,7 @@
finally
{
// lifeCycle.closeContext(context, true);
- manager.getSynchronization().setSave(save);
+ manager.getSynchronization().setSaveOnClose(save);
RequestLifeCycle.end();
}
}
Modified: portal/trunk/component/application-registry/src/test/java/conf/application-registry-configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/test/java/conf/application-registry-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/application-registry/src/test/java/conf/application-registry-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -229,7 +229,7 @@
<type>org.exoplatform.application.registry.impl.ApplicationRegistryChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>app</value>
</value-param>
<value-param>
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -85,7 +85,7 @@
@Override
protected void tearDown() throws Exception
{
- chromatticManager.getSynchronization().setSave(false);
+ chromatticManager.getSynchronization().setSaveOnClose(false);
end();
}
Modified: portal/trunk/component/common/pom.xml
===================================================================
--- portal/trunk/component/common/pom.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/common/pom.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -32,6 +32,11 @@
<dependencies>
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <version>${org.gatein.common.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
<version>${org.exoplatform.kernel.version}</version>
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticLifeCycle.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -22,6 +22,8 @@
import org.chromattic.api.ChromatticBuilder;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import java.util.List;
@@ -33,14 +35,14 @@
* or {@link #onCloseSession(SessionContext)} to perform additional treatment on the session context at a precise
* phase of its life cycle.</p>
*
- * <p>The life cycle name uniquely identifies the chromattic domain among all domain registered against the
+ * <p>The life cycle domain uniquely identifies the chromattic domain among all domain registered against the
* {@link org.exoplatform.commons.chromattic.ChromatticManager} manager.</p>
*
* <p>The plugin takes an instance of {@link org.exoplatform.container.xml.InitParams} as parameter that contains
* the following entries:
*
* <ul>
- * <li>The <code>name</code> string that is the life cycle name</li>
+ * <li>The <code>domain-name</code> string that is the life cycle domain name</li>
* <li>The <code>workspace-name</code> string that is the repository workspace name associated with this life cycle</li>
* <li>The <code>entities</code> list value that contains the list of chromattic entities that will be registered
* against the builder chromattic builder</li>
@@ -54,7 +56,7 @@
{
/** . */
- private final String name;
+ private final String domainName;
/** . */
private final String workspaceName;
@@ -74,16 +76,19 @@
/** . */
final ThreadLocal<LocalContext> currentContext = new ThreadLocal<LocalContext>();
+ /** . */
+ final Logger log = LoggerFactory.getLogger(ChromatticLifeCycle.class);
+
public ChromatticLifeCycle(InitParams params)
{
- this.name = params.getValueParam("name").getValue();
+ this.domainName = params.getValueParam("domain-name").getValue();
this.workspaceName = params.getValueParam("workspace-name").getValue();
this.entityClassNames = params.getValuesParam("entities").getValues();
}
- public final String getName()
+ public String getDomainName()
{
- return name;
+ return domainName;
}
public final String getWorkspaceName()
@@ -120,25 +125,37 @@
*/
public final SessionContext getContext(boolean peek)
{
+ log.trace("Requesting context");
Synchronization sync = manager.getSynchronization();
//
if (sync != null)
{
- GlobalContext context = sync.getContext(name);
+ log.trace("Found synchronization about to get the current context for chromattic " + domainName);
+ GlobalContext context = sync.getContext(domainName);
//
if (context == null && !peek)
{
+ log.trace("No current context found, about to open one");
context = sync.openContext(this);
}
+ else
+ {
+ log.trace("Found a context and will return it");
+ }
//
return context;
}
//
- return currentContext.get();
+ log.trace("No active synchronization about to try the current local context");
+ LocalContext localContext = currentContext.get();
+ log.trace("Found local context " + localContext);
+
+ //
+ return localContext;
}
LoginContext getLoginContext()
@@ -157,24 +174,31 @@
final SessionContext openGlobalContext()
{
+ log.trace("Opening a global context");
AbstractContext context = (AbstractContext)getContext(true);
//
if (context != null)
{
- throw new IllegalStateException("A session is already opened.");
+ String msg = "A global context is already opened";
+ log.trace(msg);
+ throw new IllegalStateException(msg);
}
// Attempt to get the synchronization
+ log.trace("Ok, no global context found, asking current synchronization");
Synchronization sync = manager.getSynchronization();
//
if (sync == null)
{
- throw new IllegalStateException("Need global synchronization");
+ String msg = "Need global synchronization for opening a global context";
+ log.trace(msg);
+ throw new IllegalStateException(msg);
}
//
+ log.trace("Opening a global context for the related sync");
return sync.openContext(this);
}
@@ -186,24 +210,30 @@
*/
public final SessionContext openContext()
{
+ log.trace("Opening a context");
AbstractContext context = (AbstractContext)getContext(true);
//
if (context != null)
{
- throw new IllegalStateException("A session is already opened.");
+ String msg = "A context is already opened";
+ log.trace(msg);
+ throw new IllegalStateException(msg);
}
//
+ log.trace("Ok, no context found, asking current synchronization");
Synchronization sync = manager.getSynchronization();
//
if (sync != null)
{
+ log.trace("Found a synchronization, about to open a global context");
context = sync.openContext(this);
}
else
{
+ log.trace("Not synchronization found, about to a local context");
LocalContext localContext = new LocalContext(this);
currentContext.set(localContext);
onOpenSession(localContext);
@@ -216,12 +246,15 @@
public final void closeContext(boolean save)
{
+ log.trace("Requesting for context close with save=" + save + " going to look for any context");
AbstractContext context = (AbstractContext)getContext(true);
//
if (context == null)
{
- throw new IllegalStateException("No current context existing");
+ String msg = "Cannot close non existing context";
+ log.trace(msg);
+ throw new IllegalStateException(msg);
}
//
@@ -238,13 +271,16 @@
public final void start() throws Exception
{
+ log.debug("About to setup Chromattic life cycle " + domainName);
ChromatticBuilder builder = ChromatticBuilder.create();
//
ClassLoader cl = Thread.currentThread().getContextClassLoader();
for (String className : entityClassNames)
{
- Class<?> entityClass = cl.loadClass(className);
+ String fqn = className.trim();
+ log.debug("Adding class " + fqn + " to life cycle " + domainName);
+ Class<?> entityClass = cl.loadClass(fqn);
builder.add(entityClass);
}
@@ -258,12 +294,13 @@
builder.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, PortalSessionLifeCycle.class.getName());
//
+ log.debug("Building Chromattic " + domainName);
realChromattic = builder.build();
chromattic = new ChromatticImpl(this);
}
catch (Exception e)
{
- e.printStackTrace();
+ log.error("Could not start Chromattic " + domainName, e);
}
finally
{
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/ChromatticManager.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -63,7 +63,7 @@
{
lifeCycle.manager = this;
lifeCycle.start();
- lifeCycles.put(lifeCycle.getName(), lifeCycle);
+ lifeCycles.put(lifeCycle.getDomainName(), lifeCycle);
}
catch (Exception e)
{
@@ -130,7 +130,7 @@
public void endRequest(ExoContainer container)
{
Synchronization sync = currentSynchronization.get();
- boolean save = sync.isSave();
+ boolean save = sync.getSaveOnClose();
endRequest(save);
}
}
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/common/src/main/java/org/exoplatform/commons/chromattic/Synchronization.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -38,7 +38,7 @@
private final Map<String, GlobalContext> contexts = new HashMap<String, GlobalContext>();
/** . */
- private boolean save = true;
+ private boolean saveOnClose = true;
/**
* Returns a specified global context by its name.
@@ -68,7 +68,7 @@
{
throw new NullPointerException();
}
- String name = lifeCycle.getName();
+ String name = lifeCycle.getDomainName();
GlobalContext context = contexts.get(name);
if (context != null)
{
@@ -100,13 +100,13 @@
}
}
- public boolean isSave()
+ public boolean getSaveOnClose()
{
- return save;
+ return saveOnClose;
}
- public void setSave(boolean save)
+ public void setSaveOnClose(boolean saveOnClose)
{
- this.save = save;
+ this.saveOnClose = saveOnClose;
}
}
Modified: portal/trunk/component/common/src/test/resources/conf/test-configuration.xml
===================================================================
--- portal/trunk/component/common/src/test/resources/conf/test-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/common/src/test/resources/conf/test-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -35,7 +35,7 @@
<type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>test</value>
</value-param>
<value-param>
Modified: portal/trunk/component/portal/src/test/java/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/portal/portal-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/portal/src/test/java/conf/portal/portal-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -141,7 +141,7 @@
<type>org.exoplatform.portal.pom.config.MOPChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>mop</value>
</value-param>
<value-param>
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 15:00:38 UTC (rev 1050)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/AbstractPortalTest.java 2009-12-17 15:23:11 UTC (rev 1051)
@@ -57,7 +57,7 @@
{
PortalContainer container = getContainer();
ChromatticManager manager = (ChromatticManager)container.getComponentInstanceOfType(ChromatticManager.class);
- manager.getSynchronization().setSave(save);
+ manager.getSynchronization().setSaveOnClose(save);
super.end();
}
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/autologin-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -59,7 +59,7 @@
<type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>autologin</value>
</value-param>
<value-param>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -529,7 +529,7 @@
<type>org.exoplatform.application.registry.impl.ApplicationRegistryChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>app</value>
</value-param>
<value-param>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-12-17 15:00:38 UTC (rev 1050)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-12-17 15:23:11 UTC (rev 1051)
@@ -182,7 +182,7 @@
<type>org.exoplatform.portal.pom.config.MOPChromatticLifeCycle</type>
<init-params>
<value-param>
- <name>name</name>
+ <name>domain-name</name>
<value>mop</value>
</value-param>
<value-param>
15 years
gatein SVN: r1050 - in portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state: consumer and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-17 10:00:38 -0500 (Thu, 17 Dec 2009)
New Revision: 1050
Added:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java
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/producer/configuration/JCRProducerConfigurationService.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
Log:
- Use NewJCRPersister so that work can be checked.
Added: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java (rev 0)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java 2009-12-17 15:00:38 UTC (rev 1050)
@@ -0,0 +1,132 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state;
+
+import org.chromattic.api.ChromatticSession;
+import org.chromattic.api.format.FormatterContext;
+import org.chromattic.api.format.ObjectFormatter;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class NewJCRPersister
+{
+ private AtomicBoolean initialized = new AtomicBoolean(false);
+ private ChromatticManager manager;
+ private ChromatticLifeCycle lifeCycle;
+ private ExoContainer container;
+
+ /** Same as defined in wsrp-configuration.xml */
+ private static final String LIFECYCLE_NAME = "wsrp";
+
+ private static class InstanceHolder
+ {
+ static final NewJCRPersister instance = new NewJCRPersister();
+ }
+
+ private NewJCRPersister()
+ {
+ }
+
+ public ChromatticSession getSession()
+ {
+ manager.beginRequest();
+// lifeCycle.openContext();
+ return lifeCycle.getChromattic().openSession();
+ }
+
+ public void closeSession(ChromatticSession session, boolean save)
+ {
+ session.save();
+ session.close();
+// lifeCycle.closeContext(save);
+ manager.endRequest(save);
+ }
+
+ public static NewJCRPersister getInstance(ExoContainer container)
+ {
+ // get the singleton
+ NewJCRPersister persister = InstanceHolder.instance;
+
+ // if it hasn't been initialized, do it
+ if (!persister.initialized.get())
+ {
+ persister.initWith(container);
+ }
+
+ return persister;
+ }
+
+ private synchronized void initWith(ExoContainer container)
+ {
+ this.container = container;
+ manager = (ChromatticManager) container.getComponentInstanceOfType(ChromatticManager.class);
+ lifeCycle = manager.getLifeCycle(LIFECYCLE_NAME);
+ initialized.set(true);
+ }
+
+ public static class QNameFormatter implements ObjectFormatter
+ {
+ private static final String OPEN_BRACE_REPLACEMENT = "-__";
+ private static final String CLOSE_BRACE_REPLACEMENT = "__-";
+ private static final String COLON_REPLACEMENT = "_-_";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ public String decodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ private String decode(String s)
+ {
+ return s.replace(CLOSE_BRACE_REPLACEMENT, "}").replace(OPEN_BRACE_REPLACEMENT, "{").replace(COLON_REPLACEMENT, ":");
+ }
+
+ private String encode(String s)
+ {
+ return s.replace("{", OPEN_BRACE_REPLACEMENT).replace("}", CLOSE_BRACE_REPLACEMENT).replace(":", COLON_REPLACEMENT);
+ }
+ }
+}
\ No newline at end of file
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-17 14:10:32 UTC (rev 1049)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-17 15:00:38 UTC (rev 1050)
@@ -26,6 +26,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.NewJCRPersister;
import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
@@ -48,18 +49,19 @@
*/
public class JCRConsumerRegistry extends AbstractConsumerRegistry
{
- private JCRPersister persister;
+ private NewJCRPersister persister;
private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
public JCRConsumerRegistry(ExoContainer container) throws Exception
{
- List<Class> mappingClasses = new ArrayList<Class>(6);
+ /*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);
- persister.initializeBuilderFor(mappingClasses);
+ persister.initializeBuilderFor(mappingClasses);*/
+ persister = NewJCRPersister.getInstance(container);
}
@Override
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-17 14:10:32 UTC (rev 1049)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-12-17 15:00:38 UTC (rev 1050)
@@ -25,6 +25,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.NewJCRPersister;
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
import org.gatein.portal.wsrp.state.producer.configuration.mapping.ProducerConfigurationMapping;
import org.gatein.portal.wsrp.state.producer.configuration.mapping.RegistrationRequirementsMapping;
@@ -46,16 +47,18 @@
private static String PRODUCER_CONFIGURATION_PATH = ProducerConfigurationMapping.NODE_NAME;
private InputStream defaultConfigurationIS;
- private JCRPersister persister;
+ private NewJCRPersister persister;
public JCRProducerConfigurationService(ExoContainer container) throws Exception
{
- List<Class> mappingClasses = new ArrayList<Class>(3);
+ /*List<Class> mappingClasses = new ArrayList<Class>(3);
Collections.addAll(mappingClasses, ProducerConfigurationMapping.class, RegistrationRequirementsMapping.class,
RegistrationPropertyDescriptionMapping.class);
persister = new JCRPersister(container);
- persister.initializeBuilderFor(mappingClasses);
+ persister.initializeBuilderFor(mappingClasses);*/
+
+ persister = NewJCRPersister.getInstance(container);
}
/**
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-17 14:10:32 UTC (rev 1049)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-17 15:00:38 UTC (rev 1050)
@@ -25,6 +25,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.NewJCRPersister;
import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerCapabilitiesMapping;
import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerGroupMapping;
import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping;
@@ -49,19 +50,21 @@
*/
public class JCRRegistrationPersistenceManager extends RegistrationPersistenceManagerImpl
{
- private JCRPersister persister;
+ private NewJCRPersister persister;
private ConsumersAndGroupsMapping mappings;
public JCRRegistrationPersistenceManager(ExoContainer container) throws Exception
{
- persister = new JCRPersister(container);
+ /*persister = new JCRPersister(container);
List<Class> mappingClasses = new ArrayList<Class>(5);
Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class, ConsumerMapping.class, ConsumerGroupMapping.class,
RegistrationMapping.class, ConsumerCapabilitiesMapping.class);
- persister.initializeBuilderFor(mappingClasses);
+ persister.initializeBuilderFor(mappingClasses);*/
+ persister = NewJCRPersister.getInstance(container);
+
ChromatticSession session = persister.getSession();
mappings = session.findByPath(ConsumersAndGroupsMapping.class, ConsumersAndGroupsMapping.NODE_NAME);
if (mappings == null)
15 years
gatein SVN: r1049 - portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 09:10:32 -0500 (Thu, 17 Dec 2009)
New Revision: 1049
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/FooEntity.java
Log:
added persistence unit test
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 13:55:28 UTC (rev 1048)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2009-12-17 14:10:32 UTC (rev 1049)
@@ -216,4 +216,24 @@
chromatticManager.endRequest(false);
}
}
+
+ public void testPersistence() throws Exception {
+
+ chromatticManager.beginRequest();
+ ChromatticSession session = testLF.getChromattic().openSession();
+ FooEntity foo = session.create(FooEntity.class);
+ String fooId = session.persist(foo, "testPersistence");
+ session.save();
+ chromatticManager.endRequest(true);
+
+ chromatticManager.beginRequest();
+ session = testLF.getChromattic().openSession();
+ foo = session.findById(FooEntity.class, fooId);
+ session.close();
+ chromatticManager.endRequest(false);
+
+ assertNotNull(foo);
+
+ }
+
}
Modified: portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java
===================================================================
--- portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java 2009-12-17 13:55:28 UTC (rev 1048)
+++ portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java 2009-12-17 14:10:32 UTC (rev 1049)
@@ -25,7 +25,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "foo")
+@NodeMapping(name = "nt:base")
public abstract class FooEntity
{
15 years
gatein SVN: r1048 - in portal/trunk: component/common/src/main/java/conf and 5 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 08:55:28 -0500 (Thu, 17 Dec 2009)
New Revision: 1048
Added:
portal/trunk/component/common/src/main/java/conf/
portal/trunk/component/common/src/main/java/conf/configuration-jboss.properties
portal/trunk/component/common/src/main/java/conf/configuration.properties
portal/trunk/component/common/src/main/java/conf/configuration.xml
Modified:
portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml
portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml
portal/trunk/packaging/pkg/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
GTNPORTAL-400 : Store portal data in a relocatable and runtime dependent directory
Added: portal/trunk/component/common/src/main/java/conf/configuration-jboss.properties
===================================================================
--- portal/trunk/component/common/src/main/java/conf/configuration-jboss.properties (rev 0)
+++ portal/trunk/component/common/src/main/java/conf/configuration-jboss.properties 2009-12-17 13:55:28 UTC (rev 1048)
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+# Data
+gatein.data.dir=${jboss.server.data.dir}/gatein
+
+# DB
+gatein.db.data.dir=${gatein.data.dir}/db
+
+# JCR
+gatein.jcr.data.dir=${gatein.data.dir}/jcr
Added: portal/trunk/component/common/src/main/java/conf/configuration.properties
===================================================================
--- portal/trunk/component/common/src/main/java/conf/configuration.properties (rev 0)
+++ portal/trunk/component/common/src/main/java/conf/configuration.properties 2009-12-17 13:55:28 UTC (rev 1048)
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+# Data
+gatein.data.dir=../temp
+
+# DB
+gatein.db.data.dir=${gatein.data.dir}/db
+
+# JCR
+gatein.jcr.data.dir=${gatein.data.dir}/jcr
Copied: portal/trunk/component/common/src/main/java/conf/configuration.xml (from rev 1031, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml)
===================================================================
--- portal/trunk/component/common/src/main/java/conf/configuration.xml (rev 0)
+++ portal/trunk/component/common/src/main/java/conf/configuration.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+ <component>
+ <key>org.exoplatform.container.PropertyConfigurator</key>
+ <type>org.exoplatform.container.PropertyConfigurator</type>
+ <init-params>
+ <value-param>
+ <name>properties.url</name>
+ <value>jar:/conf/configuration.properties</value>
+ </value-param>
+ <value-param profiles="jboss">
+ <name>properties.url</name>
+ <value>jar:/conf/configuration-jboss.properties</value>
+ </value-param>
+ </init-params>
+ </component>
+
+</configuration>
Modified: portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -34,12 +34,12 @@
<property name="multi-db" value="false" />
<property name="update-storage" value="true" />
<property name="max-buffer-size" value="204800" />
- <property name="swap-directory" value="../temp/swap/sample-ws${container.name.suffix}" />
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/sample-ws${container.name.suffix}" />
</properties>
<value-storages>
<value-storage id="sample-ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/sample-ws${container.name.suffix}" />
+ <property name="path" value="${gatein.jcr.data.dir}/values/sample-ws${container.name.suffix}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -62,14 +62,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/sample-ws${container.name.suffix}" />
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/sample-ws${container.name.suffix}" />
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/sample-ws${container.name.suffix}" />
+ <property name="path" value="${gatein.jcr.data.dir}/lock/sample-ws${container.name.suffix}" />
</properties>
</persister>
</lock-manager>
Modified: portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -34,12 +34,12 @@
<property name="multi-db" value="false" />
<property name="update-storage" value="true" />
<property name="max-buffer-size" value="204800" />
- <property name="swap-directory" value="../temp/swap/sample-ws${container.name.suffix}" />
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/sample-ws${container.name.suffix}" />
</properties>
<value-storages>
<value-storage id="sample-ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/sample-ws${container.name.suffix}" />
+ <property name="path" value="${gatein.jcr.data.dir}/values/sample-ws${container.name.suffix}" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -62,14 +62,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/sample-ws${container.name.suffix}" />
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/sample-ws${container.name.suffix}" />
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/sample-ws${container.name.suffix}" />
+ <property name="path" value="${gatein.jcr.data.dir}/lock/sample-ws${container.name.suffix}" />
</properties>
</persister>
</lock-manager>
Modified: portal/trunk/packaging/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/pkg/pom.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/packaging/pkg/pom.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -37,7 +37,7 @@
<groupId>org.gatein.tools</groupId>
<artifactId>packager</artifactId>
<type>zip</type>
- <version>1.0.0-Beta02</version>
+ <version>1.0.0-Beta04</version>
</dependency>
<dependency>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -39,11 +39,8 @@
<!--CHANGEME HashtableCacheProvider shold not be used in production env-->
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.datasource" value="jdbcexo${container.name.suffix}"/>
<property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
@@ -76,7 +73,7 @@
<name>ref-addresses</name>
<description>ref-addresses</description>
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="url" value="jdbc:hsqldb:file:${gatein.db.data.dir}/data/exodb${container.name.suffix}"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</properties-param>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -36,12 +36,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/system${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/system${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -63,14 +63,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/system${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/system${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
@@ -85,12 +85,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/portal-system${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="portal-system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/portal-system${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -112,14 +112,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/portal-system${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/portal-system${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
@@ -134,12 +134,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-work${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/portal-work${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="portal-work" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/portal-work${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/portal-work${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -161,14 +161,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-work${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/portal-work${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/portal-work${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/portal-work${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-17 13:08:13 UTC (rev 1047)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-17 13:55:28 UTC (rev 1048)
@@ -36,12 +36,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/system${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/system${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/system${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -63,14 +63,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/system${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/system${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/system${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
@@ -85,12 +85,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-system${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/portal-system${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="portal-system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/portal-system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/portal-system${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -112,14 +112,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-system${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/portal-system${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/portal-system${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/portal-system${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
@@ -134,12 +134,12 @@
<property name="multi-db" value="false"/>
<property name="update-storage" value="true"/>
<property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/portal-work${container.name.suffix}"/>
+ <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/portal-work${container.name.suffix}"/>
</properties>
<value-storages>
<value-storage id="portal-work" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
<properties>
- <property name="path" value="../temp/values/portal-work${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/values/portal-work${container.name.suffix}"/>
</properties>
<filters>
<filter property-type="Binary"/>
@@ -161,14 +161,14 @@
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
- <property name="index-dir" value="../temp/jcrlucenedb/portal-work${container.name.suffix}"/>
+ <property name="index-dir" value="${gatein.jcr.data.dir}/jcrlucenedb/portal-work${container.name.suffix}"/>
</properties>
</query-handler>
<lock-manager>
<time-out>15m</time-out><!-- 15min -->
<persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
<properties>
- <property name="path" value="../temp/lock/portal-work${container.name.suffix}"/>
+ <property name="path" value="${gatein.jcr.data.dir}/lock/portal-work${container.name.suffix}"/>
</properties>
</persister>
</lock-manager>
15 years
gatein SVN: r1046 - tools/packager/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 08:08:05 -0500 (Thu, 17 Dec 2009)
New Revision: 1046
Added:
tools/packager/tags/1.0.0-Beta04/
Log:
[maven-scm] copy for tag 1.0.0-Beta04
Copied: tools/packager/tags/1.0.0-Beta04 (from rev 1045, tools/packager/trunk)
15 years
gatein SVN: r1044 - in tools/packager/trunk: src/main/javascript/eXo/server and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-17 08:04:06 -0500 (Thu, 17 Dec 2009)
New Revision: 1044
Modified:
tools/packager/trunk/pom.xml
tools/packager/trunk/src/main/javascript/eXo/server/Database.js
Log:
- correct name for database URL connection for hsqldb
- update pom to parent 1.0.0-Beta04
Modified: tools/packager/trunk/pom.xml
===================================================================
--- tools/packager/trunk/pom.xml 2009-12-17 12:10:44 UTC (rev 1043)
+++ tools/packager/trunk/pom.xml 2009-12-17 13:04:06 UTC (rev 1044)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.gatein</groupId>
<artifactId>gatein-parent</artifactId>
- <version>1.0.0-Beta03</version>
+ <version>1.0.0-Beta04</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: tools/packager/trunk/src/main/javascript/eXo/server/Database.js
===================================================================
--- tools/packager/trunk/src/main/javascript/eXo/server/Database.js 2009-12-17 12:10:44 UTC (rev 1043)
+++ tools/packager/trunk/src/main/javascript/eXo/server/Database.js 2009-12-17 13:04:06 UTC (rev 1044)
@@ -121,7 +121,7 @@
instance.driverClass = "org.hsqldb.jdbcDriver";
instance.dialect = "org.hibernate.dialect.HSQLDialect" ;
- instance.conectionURL = "jdbc:hsqldb:file:${gatein.data.db.dir}/data/exodb${container.name.suffix}";
+ instance.conectionURL = "jdbc:hsqldb:file:${gatein.db.data.dir}/data/exodb${container.name.suffix}";
instance.username = "sa" ;
instance.password = "";
return instance ;
15 years
gatein SVN: r1043 - portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-17 07:10:44 -0500 (Thu, 17 Dec 2009)
New Revision: 1043
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Log:
- Remove extra space in RegistrationRequirementsMapping definition.
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-17 12:09:12 UTC (rev 1042)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-12-17 12:10:44 UTC (rev 1043)
@@ -66,8 +66,7 @@
<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.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>
15 years