exo-jcr SVN: r370 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-26 07:43:38 -0400 (Mon, 26 Oct 2009)
New Revision: 370
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-200: storage connection impl
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:27:32 UTC (rev 369)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:43:38 UTC (rev 370)
@@ -63,7 +63,7 @@
private final Node<Serializable, Object> treeRoot;
private final Node<Serializable, Object> itemsRoot;
-
+
/**
* Start batching flag. 'true' if batching was started, 'false' if batching is not start.
*/
@@ -79,7 +79,7 @@
{
this.cache = cache;
this.itemsRoot = itemsRoot;
- this.treeRoot = treeRoot;
+ this.treeRoot = treeRoot;
}
private Fqn<String> makeNodeFqn(QPath nodePath)
@@ -225,6 +225,15 @@
/**
* {@inheritDoc}
*/
+ public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ // TODO it's same as getChild... now
+ return getChildPropertiesData(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException, IllegalStateException
{
Node<Serializable, Object> parentNode = cache.getNode(makeNodeFqn(parentData.getQPath()));
@@ -232,14 +241,32 @@
{
throw new IllegalStateException("Get Item data error: parent not found " + parentData.getQPath().getAsString());
}
-
-
- String propertyId = (String) parentNode.get(name.getAsString(true));
- if (propertyId != null) {
-
- } else {
-
+
+ // TODO check performance of Node vs Property get
+
+ String itemName = name.getAsString(true);
+
+ String propertyId = (String)parentNode.get(itemName);
+ if (propertyId != null)
+ {
+ // it's Property Item
+ return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA);
}
+ else
+ {
+ // it's Node Item
+ Node<Serializable, Object> node = parentNode.getChild(Fqn.fromString(itemName)); // TODO not Fqn?
+ if (node != null)
+ {
+ String nodeId = (String)node.get(ITEM_ID);
+ if (nodeId != null)
+ {
+ return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA);
+ }
+ }
+
+ }
+
return null;
}
@@ -248,8 +275,7 @@
*/
public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
{
- // TODO Auto-generated method stub
- return null;
+ return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA);
}
/**
@@ -258,65 +284,107 @@
public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
IllegalStateException, UnsupportedOperationException
{
- // TODO Auto-generated method stub
- return null;
+ // TODO refs impl
+ return new ArrayList<PropertyData>();
}
/**
* {@inheritDoc}
*/
- public boolean isOpened()
+ public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
- return false;
+ startBatch();
+ // TODO
}
/**
* {@inheritDoc}
*/
- public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
+ public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
- return null;
+ startBatch();
+
+ // TODO it's put anyway.. but with check?
+ Object prev = cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier());
+ if (prev == null)
+ {
+ throw new IllegalStateException("Node was deleted (tree)");
+ }
+
+ prev = cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
+ if (prev == null)
+ {
+ throw new IllegalStateException("Node was deleted (items)");
+ }
}
/**
* {@inheritDoc}
*/
- public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
startBatch();
+ // TODO it's put anyway.. but with check?
+ Fqn<String> parentFqn = makeParentFqn(data.getQPath());
+ Object prev =
+ cache.put(parentFqn, data.getQPath().getEntries()[data.getQPath().getEntries().length - 1].getAsString(true),
+ data.getIdentifier());
+ if (prev == null)
+ {
+ throw new IllegalStateException("Property was deleted (tree)");
+ }
+
+ prev = cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
+ if (prev == null)
+ {
+ throw new IllegalStateException("Property was deleted (items)");
+ }
}
/**
* {@inheritDoc}
*/
- public void rollback() throws IllegalStateException, RepositoryException
+ public void commit() throws IllegalStateException, RepositoryException
{
- // rollback batch
- this.cache.endBatch(false);
+ // end batch
+ if (batchStarted)
+ {
+ this.cache.endBatch(true);
+ batchStarted = false;
+ }
+ else
+ {
+ // TODO
+ }
}
/**
* {@inheritDoc}
*/
- public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
+ public void rollback() throws IllegalStateException, RepositoryException
{
- startBatch();
-
+ // rollback batch
+ if (batchStarted)
+ {
+ this.cache.endBatch(false);
+ batchStarted = false;
+ }
+ else
+ {
+ // TODO
+ }
}
/**
* {@inheritDoc}
*/
- public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
- InvalidItemStateException, IllegalStateException
+ public boolean isOpened()
{
- startBatch();
-
+ return true;
}
/**
@@ -328,21 +396,15 @@
}
/**
- * {@inheritDoc}
- */
- public void commit() throws IllegalStateException, RepositoryException
- {
- // end batch
- this.cache.endBatch(true);
- }
-
- /**
* Start batching.
*/
private void startBatch()
{
- if (!batchStarted)
- this.cache.startBatch();
+ if (!batchStarted)
+ {
+ batchStarted = true;
+ this.cache.startBatch();
+ }
}
}
15 years
exo-jcr SVN: r369 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-10-26 07:27:32 -0400 (Mon, 26 Oct 2009)
New Revision: 369
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-201 : The JBossCacheStorageConnection was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:14:55 UTC (rev 368)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:27:32 UTC (rev 369)
@@ -63,6 +63,11 @@
private final Node<Serializable, Object> treeRoot;
private final Node<Serializable, Object> itemsRoot;
+
+ /**
+ * Start batching flag. 'true' if batching was started, 'false' if batching is not start.
+ */
+ private boolean batchStarted = false;
/**
* JBossCacheStorageConnection constructor.
@@ -74,10 +79,7 @@
{
this.cache = cache;
this.itemsRoot = itemsRoot;
- this.treeRoot = treeRoot;
-
- // start batch
- this.cache.startBatch();
+ this.treeRoot = treeRoot;
}
private Fqn<String> makeNodeFqn(QPath nodePath)
@@ -121,6 +123,7 @@
public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
{
+ startBatch();
cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier());
cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
}
@@ -131,6 +134,7 @@
public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ startBatch();
Fqn<String> parentFqn = makeParentFqn(data.getQPath());
// add an attr to the parent node as key=PropertyName value=PropertyId
@@ -145,6 +149,7 @@
public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ startBatch();
cache.removeNode(makeNodeFqn(data.getQPath()));
cache.removeNode(makeIdFqn(data.getIdentifier()));
}
@@ -155,6 +160,7 @@
public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ startBatch();
// delete attr on parent by key=PropertyName
cache.remove(makeParentFqn(data.getQPath()),
data.getQPath().getEntries()[data.getQPath().getEntries().length - 1].getAsString(true));
@@ -280,7 +286,7 @@
public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
+ startBatch();
}
@@ -299,7 +305,7 @@
public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
+ startBatch();
}
@@ -309,7 +315,7 @@
public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
+ startBatch();
}
@@ -329,5 +335,14 @@
// end batch
this.cache.endBatch(true);
}
+
+ /**
+ * Start batching.
+ */
+ private void startBatch()
+ {
+ if (!batchStarted)
+ this.cache.startBatch();
+ }
}
15 years
exo-jcr SVN: r368 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-26 07:14:55 -0400 (Mon, 26 Oct 2009)
New Revision: 368
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
Log:
EXOJCR-200: conn impl
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:10:54 UTC (rev 367)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:14:55 UTC (rev 368)
@@ -221,11 +221,19 @@
*/
public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException, IllegalStateException
{
- // Node<Serializable, Object> node = cache.getNode(makeNodeFqn(parentData.getQPath()));
- // if (node == null)
- // {
- // throw new IllegalStateException("Get child Nodes error: parent not found " + parent.getQPath().getAsString());
- // };
+ Node<Serializable, Object> parentNode = cache.getNode(makeNodeFqn(parentData.getQPath()));
+ if (parentNode == null)
+ {
+ throw new IllegalStateException("Get Item data error: parent not found " + parentData.getQPath().getAsString());
+ }
+
+
+ String propertyId = (String) parentNode.get(name.getAsString(true));
+ if (propertyId != null) {
+
+ } else {
+
+ }
return null;
}
15 years
exo-jcr SVN: r367 - in jcr/branches/1.12.0-JBC/component/core/src/main: resources/conf/portal and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-10-26 07:10:54 -0400 (Mon, 26 Oct 2009)
New Revision: 367
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
Log:
EXOJCR-201 : Add baching to JBossCacheStorageConnection
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-25 19:50:14 UTC (rev 366)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-26 11:10:54 UTC (rev 367)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl.storage.jbosscache;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
@@ -46,6 +47,8 @@
private WorkspaceDataContainer dataContainer;
+ private JDBCStorageConnection jdbcConnection;
+
/**
* Init the loader DataContainer with given WorkspaceDataContainer instance.
*
@@ -137,7 +140,7 @@
*/
public Object put(Fqn name, Object key, Object value) throws Exception
{
- // TODO Auto-generated method stub
+ dataContainer.
return null;
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-25 19:50:14 UTC (rev 366)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-26 11:10:54 UTC (rev 367)
@@ -75,6 +75,9 @@
this.cache = cache;
this.itemsRoot = itemsRoot;
this.treeRoot = treeRoot;
+
+ // start batch
+ this.cache.startBatch();
}
private Fqn<String> makeNodeFqn(QPath nodePath)
@@ -278,8 +281,8 @@
*/
public void rollback() throws IllegalStateException, RepositoryException
{
- // TODO Auto-generated method stub
-
+ // rollback batch
+ this.cache.endBatch(false);
}
/**
@@ -315,7 +318,8 @@
*/
public void commit() throws IllegalStateException, RepositoryException
{
- // TODO Auto-generated method stub
+ // end batch
+ this.cache.endBatch(true);
}
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-25 19:50:14 UTC (rev 366)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-26 11:10:54 UTC (rev 367)
@@ -80,4 +80,7 @@
</properties>
</loader>
</loaders>
+
+ <!-- Enable batching -->
+ <invocationBatching enabled="true"/>
</jbosscache>
15 years
exo-jcr SVN: r366 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jbosscache and 4 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-25 15:50:14 -0400 (Sun, 25 Oct 2009)
New Revision: 366
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-200: WorkspaceStorageConnection impl parts + configs + JBossCacheService
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java 2009-10-25 19:50:14 UTC (rev 366)
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+/*
+ * 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.services.jbosscache;
+
+import java.io.Serializable;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.picocontainer.Startable;
+
+/**
+ * Created by The eXo Platform SAS.<br/>
+ *
+ * Service provides singletone JBossCache instance.
+ *
+ * <br/>Date: 25.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: JBossCacheService.java 111 2008-11-11 11:11:11Z pnedonosko $
+ */
+public class JBossCacheService implements Startable
+{
+ protected static Log LOG = ExoLogger.getLogger("jcr.JBossCacheService");
+
+ private final Cache<Serializable, Object> cache;
+
+ public JBossCacheService(InitParams params)
+ {
+ String jbcConfig = params.getValueParam("jboss-cache-configuration").getValue();
+
+ CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+
+ LOG.info("JBoss Cache configuration used: " + jbcConfig);
+
+ this.cache = factory.createCache(jbcConfig);
+
+ // initializes configuration state, the root node, etc.
+ this.cache.create();
+ }
+
+ /**
+ * Return JBoss Cache instance.
+ *
+ * @return Cache
+ */
+ public Cache<Serializable, Object> getCache()
+ {
+ return cache;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start()
+ {
+ // starts the cache loader, starts cache replication, starts the region manager, etc.
+ this.cache.start();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void stop()
+ {
+ this.cache.stop();
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-25 16:29:14 UTC (rev 365)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-25 19:50:14 UTC (rev 366)
@@ -39,7 +39,7 @@
* <br/>Date: 23.10.2009
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: ExoJCRCacheLoader.java 111 2008-11-11 11:11:11Z pnedonosko $
+ * @version $Id$
*/
public class ExoJCRCacheLoader implements CacheLoader
{
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-25 16:29:14 UTC (rev 365)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-25 19:50:14 UTC (rev 366)
@@ -30,7 +30,9 @@
import org.jboss.cache.Node;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import javax.jcr.InvalidItemStateException;
import javax.jcr.RepositoryException;
@@ -46,7 +48,7 @@
* References map ??? /$repo_name/$ws_name/$REFS: Key=NodeId, Value = PropertyId.<br/>
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: JBossCacheStorageConnection.java 111 2008-11-11 11:11:11Z pnedonosko $
+ * @version $Id$
*/
public class JBossCacheStorageConnection extends DBConstants implements WorkspaceStorageConnection
{
@@ -59,7 +61,7 @@
private final Cache<Serializable, Object> cache;
private final Node<Serializable, Object> treeRoot;
-
+
private final Node<Serializable, Object> itemsRoot;
/**
@@ -67,7 +69,8 @@
*
* @param cache Cache<Serializable, Object>
*/
- public JBossCacheStorageConnection(Cache<Serializable, Object> cache, Node<Serializable, Object> treeRoot, Node<Serializable, Object> itemsRoot)
+ public JBossCacheStorageConnection(Cache<Serializable, Object> cache, Node<Serializable, Object> treeRoot,
+ Node<Serializable, Object> itemsRoot)
{
this.cache = cache;
this.itemsRoot = itemsRoot;
@@ -88,7 +91,7 @@
return Fqn.fromRelativeFqn(treeRoot.getFqn(), Fqn.fromElements(fqns));
}
- private Fqn<String> makePropertyFqn(QPath propertyPath)
+ private Fqn<String> makeParentFqn(QPath propertyPath)
{
QPathEntry[] path = propertyPath.getEntries();
int pathLen = path.length - 1;
@@ -125,9 +128,11 @@
public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
+ Fqn<String> parentFqn = makeParentFqn(data.getQPath());
- cache.put(makePropertyFqn(data.getQPath()), data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]
- .getAsString(true), data.getIdentifier());
+ // add an attr to the parent node as key=PropertyName value=PropertyId
+ cache.put(parentFqn, data.getQPath().getEntries()[data.getQPath().getEntries().length - 1].getAsString(true),
+ data.getIdentifier());
cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
}
@@ -137,8 +142,8 @@
public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
-
+ cache.removeNode(makeNodeFqn(data.getQPath()));
+ cache.removeNode(makeIdFqn(data.getIdentifier()));
}
/**
@@ -147,8 +152,10 @@
public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
- // TODO Auto-generated method stub
-
+ // delete attr on parent by key=PropertyName
+ cache.remove(makeParentFqn(data.getQPath()),
+ data.getQPath().getEntries()[data.getQPath().getEntries().length - 1].getAsString(true));
+ cache.removeNode(makeIdFqn(data.getIdentifier()));
}
/**
@@ -156,8 +163,26 @@
*/
public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
{
- // TODO Auto-generated method stub
- return null;
+ //Set<Object> childNames = cache.getChildrenNames(makeNodeFqn(parent.getQPath()));
+ Node<Serializable, Object> parentNode = cache.getNode(makeNodeFqn(parent.getQPath()));
+ if (parentNode == null)
+ {
+ throw new IllegalStateException("Get child Nodes error: parent not found " + parent.getQPath().getAsString());
+ }
+
+ Set<Node<Serializable, Object>> childNodes = parentNode.getChildren();
+
+ List<NodeData> childs = new ArrayList<NodeData>();
+ for (Node<Serializable, Object> child : childNodes)
+ {
+ String childId = (String)child.get(ITEM_ID);
+
+ // TODO NodeData or PropertyData? As ItemData check then and cast.
+ NodeData node = (NodeData)cache.get(makeIdFqn(childId), ITEM_DATA);
+ childs.add(node);
+ }
+
+ return childs;
}
/**
@@ -165,8 +190,27 @@
*/
public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
{
- // TODO Auto-generated method stub
- return null;
+ // TODO treeRoot.getChild(f) possible if f not a direct child???
+ Node<Serializable, Object> parentNode = cache.getNode(makeNodeFqn(parent.getQPath()));
+ if (parentNode == null)
+ {
+ throw new IllegalStateException("Get child Nodes error: parent not found " + parent.getQPath().getAsString());
+ }
+
+ List<PropertyData> childs = new ArrayList<PropertyData>();
+
+ // TODO keys Serializable shoudl be!!!
+ for (Object key : parentNode.getKeys())
+ {
+ if (!key.equals(ITEM_ID))
+ {
+ // TODO NodeData or PropertyData? As ItemData check then and cast.
+ PropertyData property = (PropertyData)cache.get(makeIdFqn((String)key), ITEM_DATA);
+ childs.add(property);
+ }
+ }
+
+ return childs;
}
/**
@@ -174,7 +218,11 @@
*/
public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException, IllegalStateException
{
- // TODO Auto-generated method stub
+ // Node<Serializable, Object> node = cache.getNode(makeNodeFqn(parentData.getQPath()));
+ // if (node == null)
+ // {
+ // throw new IllegalStateException("Get child Nodes error: parent not found " + parent.getQPath().getAsString());
+ // };
return null;
}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-10-25 16:29:14 UTC (rev 365)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-10-25 19:50:14 UTC (rev 366)
@@ -18,6 +18,14 @@
*/
package org.exoplatform.services.jcr.impl.storage.jbosscache;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.naming.NamingException;
+
+import org.exoplatform.services.jbosscache.JBossCacheService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
@@ -34,21 +42,16 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.picocontainer.Startable;
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.jcr.RepositoryException;
-import javax.naming.NamingException;
-
/**
* Created by The eXo Platform SAS.
*
* <br/>Date: 23.10.2009
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: JBossWorkspaceDataContainer.java 111 2008-11-11 11:11:11Z pnedonosko $
+ * @version $Id$
*/
public class JBossCacheWorkspaceDataContainer extends WorkspaceDataContainerBase implements Startable
{
@@ -70,38 +73,39 @@
private final Cache<Serializable, Object> cache;
private final Node<Serializable, Object> tree;
+
+ private final Node<Serializable, Object> items;
- private final Node<Serializable, Object> items;
-
/**
* JBossWorkspaceDataContainer constructor.
*
*/
- public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEntry repConfig,
- InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider)
+ public JBossCacheWorkspaceDataContainer(JBossCacheService jbcService, WorkspaceEntry wsConfig,
+ RepositoryEntry repConfig, InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider)
throws RepositoryConfigurationException, NamingException, RepositoryException, IOException
{
this.repositoryName = repConfig.getName();
this.containerName = wsConfig.getName();
- CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+ this.cache = jbcService.getCache();
- String jbcConfig = wsConfig.getContainer().getParameterValue(JBOSSCACHE_CONFIG);
- LOG.info("JBossCache configuration used: " + jbcConfig);
-
- this.cache = factory.createCache(jbcConfig);
-
// TODO hardcoded now
this.persistentContainer = new JDBCWorkspaceDataContainer(wsConfig, repConfig, contextInit, valueStorageProvider);
- // TODO add/configure CacheLoader here with this.persistentContainer
- this.cache.create();
- this.cache.start();
+ // TODO configure CacheLoader here with this.persistentContainer
+ for (IndividualCacheLoaderConfig loaderCfg : this.cache.getConfiguration().getCacheLoaderConfig()
+ .getIndividualCacheLoaderConfigs())
+ {
+ if (loaderCfg.getClassName().equals(ExoJCRCacheLoader.class.getName()))
+ {
+ ((ExoJCRCacheLoader)loaderCfg.getCacheLoader()).initDataContainer(this.persistentContainer);
+ }
+ }
Node<Serializable, Object> cacheRoot = cache.getRoot();
Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements(repositoryName, containerName));
- // prepare
+ // prepare cache structures
this.tree = wsRoot.addChild(Fqn.fromString(ROOT));
this.items = wsRoot.addChild(Fqn.fromString(ITEMS));
}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 2009-10-25 19:50:14 UTC (rev 366)
@@ -0,0 +1,134 @@
+/*
+ * 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.
+ */
+/*
+ * 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.services.jcr.impl.storage.jbosscache;
+
+import java.io.Serializable;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.datamodel.IllegalPathException;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 25.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id$
+ */
+public class JBossCacheStorageConnectionTest extends TestCase
+{
+
+ private JBossCacheStorageConnection conn;
+
+ private Cache<Serializable, Object> cache;
+
+ private Node<Serializable, Object> tree;
+
+ private Node<Serializable, Object> items;
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ // JBossCache
+ String jbcConfig = "/conf/portal/exojcr-jboss-cache-conf.xml";
+
+ cache = new DefaultCacheFactory<Serializable, Object>().createCache(jbcConfig);
+
+ Node<Serializable, Object> cacheRoot = cache.getRoot();
+ Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
+
+ // prepare cache structures
+ tree = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
+ items = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
+
+ // run cache
+ cache.create();
+ cache.start();
+
+ // JCR connection
+ conn = new JBossCacheStorageConnection(cache, tree, items);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void tearDown() throws Exception
+ {
+
+ cache.stop();
+ cache.destroy();
+
+ super.tearDown();
+ }
+
+ public void testAddNode() throws Exception
+ {
+ // add
+ conn.add(new TransientNodeData(QPath.parse("[]:node:1"), "1", 1, Constants.NT_UNSTRUCTURED, new InternalQName[0],
+ 0, Constants.ROOT_UUID, new AccessControlList()));
+
+ // test
+ tree.getChildren();
+ }
+
+ public void testGetChildNodesData()
+ {
+
+ // prepare
+
+ // check
+
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-25 16:29:14 UTC (rev 365)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-25 19:50:14 UTC (rev 366)
@@ -102,6 +102,16 @@
</init-params>
</component>
+ <component>
+ <type>org.exoplatform.services.jbosscache.JBossCacheService</type>
+ <init-params>
+ <value-param>
+ <name>jboss-cache-configuration</name>
+ <value>/conf/portal/exojcr-jboss-cache-conf.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<key>org.exoplatform.services.jcr.RepositoryService</key>
<type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-25 16:29:14 UTC (rev 365)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-25 19:50:14 UTC (rev 366)
@@ -32,7 +32,6 @@
<!-- for system storage -->
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JBossCacheWorkspaceDataContainer">
<properties>
- <property name="jboss-cache-conf" value="/conf/portal/exojcr-jboss-cache-conf.xml" />
<property name="source-name" value="jdbcjcr" />
<property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
15 years
exo-jcr SVN: r365 - in jcr/branches/1.12.0-JBC/component/core: src/main/javacc/xpath and 14 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-25 12:29:14 -0400 (Sun, 25 Oct 2009)
New Revision: 365
Modified:
jcr/branches/1.12.0-JBC/component/core/pom.xml
jcr/branches/1.12.0-JBC/component/core/src/main/javacc/xpath/xpath-grammar.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding-nodetypevalues.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exo-jcr-config.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
jcr/branches/1.12.0-JBC/component/core/src/main/resources/org/exoplatform/services/jcr/impl/core/nodetype/nodetypes.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config-extended.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-impl.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-tck.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test2.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-usecase.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/import-export/testPermdocview.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/index/test_index.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/indexing-configuration.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/nodetypes/ext-registry-nodetypes.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config-extended.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/nodetypes-api-test.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-jcr589.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-nodetypes.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/nodetypes/nodetypes-usecase-test.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/business-process-nodetypes.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/ext-nodetypes-config.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config-extended.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-ecm.xml
Log:
EXOJCR-2: XMLs header in JCR core
Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/javacc/xpath/xpath-grammar.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/javacc/xpath/xpath-grammar.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/javacc/xpath/xpath-grammar.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,4 +1,24 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Scott Boag (XSL WG) -->
<!-- <!DOCTYPE g:grammar SYSTEM "grammar.dtd"> -->
<!--
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding-nodetypevalues.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding-nodetypevalues.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding-nodetypevalues.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<binding>
<mapping name="nodeTypes" class="org.exoplatform.services.jcr.core.nodetype.NodeTypeValuesList">
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/binding.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<binding>
<mapping name="repository-service" class="org.exoplatform.services.jcr.config.RepositoryServiceConfiguration">
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exo-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exo-jcr-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exo-jcr-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,4 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?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.
+
+-->
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/org/exoplatform/services/jcr/impl/core/nodetype/nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/org/exoplatform/services/jcr/impl/core/nodetype/nodetypes.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/org/exoplatform/services/jcr/impl/core/nodetype/nodetypes.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dc="http://purl.org/dc/elements/1.1">
<!-- nt:base commented for example -->
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
@@ -18,7 +19,6 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
@@ -56,13 +56,18 @@
<!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/>
<property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
- <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/
+-->
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/
+-->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/
+-->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/
+-->
- <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/
+-->
</properties-param>
@@ -79,7 +84,8 @@
<description>SimpleLog properties</description>
<property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
<property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
- </properties-param -->
+ </properties-param
+-->
<!-- value-param>
<name>logger</name>
@@ -95,7 +101,8 @@
<property name="handlers" value="java.util.logging.ConsoleHandler"/>
<property name=".level" value="FINE"/>
<property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
- </properties-param -->
+ </properties-param
+-->
</init-params>
</component>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
@@ -18,7 +19,6 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config-extended.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config-extended.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config-extended.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-impl.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-impl.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-impl.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-tck.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-tck.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-tck.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test2.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test2.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-test2.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-usecase.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-usecase.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/test/nodetypes-usecase.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/import-export/testPermdocview.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/import-export/testPermdocview.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/import-export/testPermdocview.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,4 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?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.
+
+-->
<a xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/index/test_index.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/index/test_index.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/index/test_index.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,4 +1,24 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
<note>
<to>John</to>
<from>Alice</from>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/indexing-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/indexing-configuration.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/indexing-configuration.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,4 +1,24 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
<!DOCTYPE configuration SYSTEM "http://www.exoplatform.org/dtd/indexing-configuration-1.2.dtd">
<configuration xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/nodetypes/ext-registry-nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/nodetypes/ext-registry-nodetypes.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/nodetypes/ext-registry-nodetypes.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (C) 2009 eXo Platform SAS.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config-extended.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config-extended.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config-extended.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!-- For DTD rules look at nodetypes.dtd (
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/ecm/nodetypes-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!-- For DTD rules look at nodetypes.dtd (
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/nodetypes-api-test.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/nodetypes-api-test.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/api/nodetypes/nodetypes-api-test.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!--
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-jcr589.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-jcr589.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-jcr589.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<nodeType name="myNodeType" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-nodetypes.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/impl/core/nodetype/test-nodetypes.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<nodeType name="exo:mySubTypeJCR805" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/nodetypes/nodetypes-usecase-test.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/nodetypes/nodetypes-usecase-test.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/nodetypes/nodetypes-usecase-test.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/business-process-nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/business-process-nodetypes.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/business-process-nodetypes.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!-- These specific nodetypes is used for content publishing process -->
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/ext-nodetypes-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/ext-nodetypes-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/ext-nodetypes-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<!-- metadata nodetypes -->
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config-extended.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config-extended.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config-extended.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<nodeType name="exo:addMetadataAction" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-config.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<nodeType name="exo:datetime" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-ecm.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-ecm.xml 2009-10-23 15:57:11 UTC (rev 364)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/org/exoplatform/services/jcr/usecases/query/nodetypes-ecm.xml 2009-10-25 16:29:14 UTC (rev 365)
@@ -1,3 +1,24 @@
+<?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.
+
+-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<nodeType name="rma:filePlan" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
15 years
exo-jcr SVN: r364 - in jcr/branches/1.12.0-JBC: component/core and 5 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-23 11:57:11 -0400 (Fri, 23 Oct 2009)
New Revision: 364
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCachePersistentDataManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
Modified:
jcr/branches/1.12.0-JBC/component/core/pom.xml
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/SystemDataContainerHolder.java
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/branches/1.12.0-JBC/pom.xml
Log:
EXOJCR-200: skeleton of persistent manager and cache loader architecture
Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -82,6 +82,11 @@
</dependency>
<!-- Third party dependencies (eXo JCR Impl) -->
+
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCachePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCachePersistentDataManager.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCachePersistentDataManager.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -0,0 +1,182 @@
+/*
+ * 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 3 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.services.jcr.impl.dataflow.persistent;
+
+import org.exoplatform.services.jcr.dataflow.ItemState;
+import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.dataflow.TransientItemData;
+import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 23.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id$
+ */
+public class JBossCachePersistentDataManager extends WorkspacePersistentDataManager
+{
+
+ /**
+ * JBossCachePersistentDataManager constructor.
+ *
+ * @param dataContainer WorkspaceDataContainer
+ * @param systemDataContainerHolder SystemDataContainerHolder
+ */
+ public JBossCachePersistentDataManager(WorkspaceDataContainer dataContainer,
+ SystemDataContainerHolder<WorkspaceDataContainer> systemDataContainerHolder)
+ {
+ super(dataContainer, systemDataContainerHolder);
+ }
+
+ @Override
+ public void save(ItemStateChangesLog changesLog) throws RepositoryException
+ {
+ // check if this workspace container is not read-only
+ if (readOnly && !(changesLog instanceof ReadOnlyThroughChanges))
+ throw new ReadOnlyWorkspaceException("Workspace container '" + dataContainer.getName() + "' is read-only.");
+
+ final Set<QPath> addedNodes = new HashSet<QPath>();
+
+ WorkspaceStorageConnection thisConnection = null;
+ WorkspaceStorageConnection systemConnection = null;
+
+ try
+ {
+ for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
+ {
+ ItemState itemState = iter.next();
+
+ if (!itemState.isPersisted())
+ continue;
+
+ long start = System.currentTimeMillis();
+
+ TransientItemData data = (TransientItemData)itemState.getData();
+
+ WorkspaceStorageConnection conn = null;
+ if (isSystemDescendant(data.getQPath()))
+ {
+ conn = systemConnection == null
+ // we need system connection but it's not exist
+ ? systemConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? systemDataContainer.equals(dataContainer) && thisConnection != null
+ // but container confugrations are same and non-system connnection open
+ // reuse this connection as system
+ ? systemDataContainer.reuseConnection(thisConnection)
+ // or open one new system
+ : systemDataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : thisConnection == null
+ // and non-system connection doens't exist - open it
+ ? thisConnection = dataContainer.openConnection()
+ // if already open - use it
+ : thisConnection)
+ // system connection opened - use it
+ : systemConnection;
+ }
+ else
+ {
+ conn = thisConnection == null
+ // we need this conatiner conection
+ ? thisConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? dataContainer.equals(systemDataContainer) && systemConnection != null
+ // but container confugrations are same and system connnection open
+ // reuse system connection as this
+ ? dataContainer.reuseConnection(systemConnection)
+ // or open one new
+ : dataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : systemConnection == null
+ // and system connection doens't exist - open it
+ ? systemConnection = dataContainer.openConnection()
+ // if already open - use it
+ : systemConnection)
+ // this connection opened - use it
+ : thisConnection;
+ }
+
+ data.increasePersistedVersion();
+
+ if (itemState.isAdded())
+ {
+ doAdd(data, conn, addedNodes);
+ }
+ else if (itemState.isUpdated())
+ {
+ doUpdate(data, conn);
+ }
+ else if (itemState.isDeleted())
+ {
+ doDelete(data, conn);
+ }
+ else if (itemState.isRenamed())
+ {
+ doRename(data, conn, addedNodes);
+ }
+
+ if (LOG.isDebugEnabled())
+ LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
+ + "ms, " + data.getQPath().getAsString());
+ }
+ if (thisConnection != null)
+ thisConnection.commit();
+ if (systemConnection != null && !systemConnection.equals(thisConnection))
+ systemConnection.commit();
+ }
+ finally
+ {
+ if (thisConnection != null && thisConnection.isOpened())
+ thisConnection.rollback();
+ if (systemConnection != null && !systemConnection.equals(thisConnection) && systemConnection.isOpened())
+ systemConnection.rollback();
+
+ // help to GC
+ addedNodes.clear();
+ }
+ }
+
+
+ /**
+ * Tell if the path is jcr:system descendant.
+ *
+ * @param path
+ * path to check
+ * @return boolean result, true if yes - it's jcr:system tree path
+ */
+ private boolean isSystemDescendant(QPath path)
+ {
+ return path.isDescendantOf(Constants.JCR_SYSTEM_PATH) || path.equals(Constants.JCR_SYSTEM_PATH);
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCachePersistentDataManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -104,7 +104,7 @@
* holder of system workspace data container
*/
public WorkspacePersistentDataManager(WorkspaceDataContainer dataContainer,
- SystemDataContainerHolder systemDataContainerHolder)
+ SystemDataContainerHolder<WorkspaceDataContainer> systemDataContainerHolder)
{
this.dataContainer = dataContainer;
this.listeners = new ArrayList<ItemsPersistenceListener>();
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/SystemDataContainerHolder.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/SystemDataContainerHolder.java 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/SystemDataContainerHolder.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -22,22 +22,20 @@
/**
* Created by The eXo Platform SAS.
+ *
+ * System DataContainer holder.
*
+ * Used to store Container and provide it as dependency on statup time.
+ *
* @author Gennady Azarenkov
* @version $Id$
*/
-
-/**
- * System DataContainer holder.
- *
- * Used to store Container and provide it as dependency on statup time.
- */
-public class SystemDataContainerHolder
+public class SystemDataContainerHolder<DC extends WorkspaceDataContainer>
{
/**
* Actual data Container.
*/
- private WorkspaceDataContainer dataContainer;
+ private DC dataContainer;
/**
* SystemDataContainerHolder constructor.
@@ -45,7 +43,7 @@
* @param dataContainer
* - data Container instance
*/
- public SystemDataContainerHolder(WorkspaceDataContainer dataContainer)
+ public SystemDataContainerHolder(DC dataContainer)
{
this.dataContainer = dataContainer;
}
@@ -55,7 +53,7 @@
*
* @return WorkspaceDataContainer instance
*/
- public WorkspaceDataContainer getContainer()
+ public DC getContainer()
{
return dataContainer;
}
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -0,0 +1,279 @@
+/*
+ * 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 3 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.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Modification;
+import org.jboss.cache.RegionManager;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.loader.CacheLoader;
+
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 23.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: ExoJCRCacheLoader.java 111 2008-11-11 11:11:11Z pnedonosko $
+ */
+public class ExoJCRCacheLoader implements CacheLoader
+{
+
+ private WorkspaceDataContainer dataContainer;
+
+ /**
+ * Init the loader DataContainer with given WorkspaceDataContainer instance.
+ *
+ * @param dataContainer WorkspaceDataContainer
+ */
+ public void initDataContainer(WorkspaceDataContainer dataContainer) throws RepositoryConfigurationException
+ {
+ if (this.dataContainer != null) {
+ throw new RepositoryConfigurationException("Cannot set WorkspaceDataContainer twice");
+ }
+
+ this.dataContainer = dataContainer;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void commit(Object tx) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean exists(Fqn name) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Map<Object, Object> get(Fqn name) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<?> getChildrenNames(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IndividualCacheLoaderConfig getConfig()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void loadEntireState(ObjectOutputStream os) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void loadState(Fqn subtree, ObjectOutputStream os) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void prepare(Object tx, List<Modification> modifications, boolean onePhase) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object put(Fqn name, Object key, Object value) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void put(Fqn name, Map<Object, Object> attributes) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void put(List<Modification> modifications) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object remove(Fqn fqn, Object key) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void remove(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeData(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback(Object tx)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCache(CacheSPI c)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setConfig(IndividualCacheLoaderConfig config)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setRegionManager(RegionManager manager)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void storeEntireState(ObjectInputStream is) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void storeState(Fqn subtree, ObjectInputStream is) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void create() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void destroy()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void stop()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -0,0 +1,273 @@
+/*
+ * 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 3 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.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import org.jboss.cache.Cache;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 23.10.2009<br/>
+ *
+ * Cache contains several regions:<br/>
+ * Workspace tree. /$repo_name/$ws_name/$ROOT: On each leaf (JBossCache Node) an JCR Item Id stored.<br/>
+ * Items map. /$repo_name/$ws_name/$ITEMS: Key=Id, Value = ItemData.<br/>
+ * References map ??? /$repo_name/$ws_name/$REFS: Key=NodeId, Value = PropertyId.<br/>
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: JBossCacheStorageConnection.java 111 2008-11-11 11:11:11Z pnedonosko $
+ */
+public class JBossCacheStorageConnection extends DBConstants implements WorkspaceStorageConnection
+{
+
+ //public static final InternalQName NODE = new InternalQName(Constants.NS_DEFAULT_URI, "$node");
+ public static final String ITEM_DATA = "$idata".intern();
+
+ public static final String ITEM_ID = "$id".intern();
+
+ private final Cache<Serializable, Object> cache;
+
+ private final Node<Serializable, Object> treeRoot;
+
+ private final Node<Serializable, Object> itemsRoot;
+
+ /**
+ * JBossCacheStorageConnection constructor.
+ *
+ * @param cache Cache<Serializable, Object>
+ */
+ public JBossCacheStorageConnection(Cache<Serializable, Object> cache, Node<Serializable, Object> treeRoot, Node<Serializable, Object> itemsRoot)
+ {
+ this.cache = cache;
+ this.itemsRoot = itemsRoot;
+ this.treeRoot = treeRoot;
+ }
+
+ private Fqn<String> makeNodeFqn(QPath nodePath)
+ {
+ QPathEntry[] path = nodePath.getEntries();
+ String[] fqns = new String[path.length];
+
+ for (int i = 0; i < path.length; i++)
+ {
+ fqns[i] = path[i].getAsString(true);
+ }
+
+ // TODO make Fqn generation clearer
+ return Fqn.fromRelativeFqn(treeRoot.getFqn(), Fqn.fromElements(fqns));
+ }
+
+ private Fqn<String> makePropertyFqn(QPath propertyPath)
+ {
+ QPathEntry[] path = propertyPath.getEntries();
+ int pathLen = path.length - 1;
+ String[] fqns = new String[pathLen];
+
+ for (int i = 0; i < pathLen; i++)
+ {
+ fqns[i] = path[i].getAsString(true);
+ }
+
+ // TODO make Fqn generation clearer
+ return Fqn.fromRelativeFqn(treeRoot.getFqn(), Fqn.fromElements(fqns));
+ }
+
+ private Fqn<String> makeIdFqn(String itemId)
+ {
+ // TODO make Fqn generation clearer
+ return Fqn.fromRelativeFqn(itemsRoot.getFqn(), Fqn.fromString(itemId));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(NodeData data) throws RepositoryException, UnsupportedOperationException, InvalidItemStateException,
+ IllegalStateException
+ {
+ cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier());
+ cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void add(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+
+ cache.put(makePropertyFqn(data.getQPath()), data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]
+ .getAsString(true), data.getIdentifier());
+ cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void delete(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(NodeData parentData, QPathEntry name) throws RepositoryException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getReferencesData(String nodeIdentifier) throws RepositoryException,
+ IllegalStateException, UnsupportedOperationException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isOpened()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> listChildPropertiesData(NodeData parent) throws RepositoryException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback() throws IllegalStateException, RepositoryException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void update(NodeData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void update(PropertyData data) throws RepositoryException, UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void close() throws IllegalStateException, RepositoryException
+ {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void commit() throws IllegalStateException, RepositoryException
+ {
+ // TODO Auto-generated method stub
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-10-23 15:57:11 UTC (rev 364)
@@ -0,0 +1,181 @@
+/*
+ * 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 3 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.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.RepositoryEntry;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
+import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.naming.InitialContextInitializer;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.picocontainer.Startable;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.jcr.RepositoryException;
+import javax.naming.NamingException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 23.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: JBossWorkspaceDataContainer.java 111 2008-11-11 11:11:11Z pnedonosko $
+ */
+public class JBossCacheWorkspaceDataContainer extends WorkspaceDataContainerBase implements Startable
+{
+
+ public static final String JBOSSCACHE_CONFIG = "jboss-cache-conf";
+
+ public static final String ROOT = "$ROOT".intern();
+
+ public static final String ITEMS = "$ITEMS".intern();
+
+ protected static final Log LOG = ExoLogger.getLogger("jcr.JBossCacheWorkspaceDataContainer");
+
+ protected final String repositoryName;
+
+ protected final String containerName;
+
+ protected final WorkspaceDataContainer persistentContainer;
+
+ private final Cache<Serializable, Object> cache;
+
+ private final Node<Serializable, Object> tree;
+
+ private final Node<Serializable, Object> items;
+
+ /**
+ * JBossWorkspaceDataContainer constructor.
+ *
+ */
+ public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEntry repConfig,
+ InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider)
+ throws RepositoryConfigurationException, NamingException, RepositoryException, IOException
+ {
+ this.repositoryName = repConfig.getName();
+ this.containerName = wsConfig.getName();
+
+ CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+
+ String jbcConfig = wsConfig.getContainer().getParameterValue(JBOSSCACHE_CONFIG);
+ LOG.info("JBossCache configuration used: " + jbcConfig);
+
+ this.cache = factory.createCache(jbcConfig);
+
+ // TODO hardcoded now
+ this.persistentContainer = new JDBCWorkspaceDataContainer(wsConfig, repConfig, contextInit, valueStorageProvider);
+ // TODO add/configure CacheLoader here with this.persistentContainer
+
+ this.cache.create();
+ this.cache.start();
+
+ Node<Serializable, Object> cacheRoot = cache.getRoot();
+ Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements(repositoryName, containerName));
+
+ // prepare
+ this.tree = wsRoot.addChild(Fqn.fromString(ROOT));
+ this.items = wsRoot.addChild(Fqn.fromString(ITEMS));
+ }
+
+ public void start()
+ {
+ if (persistentContainer instanceof Startable)
+ {
+ ((Startable)persistentContainer).start();
+ }
+ }
+
+ public void stop()
+ {
+ if (persistentContainer instanceof Startable)
+ {
+ ((Startable)persistentContainer).stop();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isSame(WorkspaceDataContainer another)
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public WorkspaceStorageConnection openConnection() throws RepositoryException
+ {
+ return new JBossCacheStorageConnection(cache, tree, items);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ return new JBossCacheStorageConnection(cache, tree, items);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original) throws RepositoryException
+ {
+ return original;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getInfo()
+ {
+ return "JBossCache based Workspace data container (prototype v1)";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName()
+ {
+ return repositoryName + "-" + containerName;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getStorageVersion()
+ {
+ return "alpha1";
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <!-- Configure the TransactionManager -->
+ <transaction
+ transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
+
+ <clustering mode="replication">
+
+ <jgroupsConfig>
+ <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+ loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+ mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+ oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+ oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+ oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+ thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+ thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+ tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+ use_incoming_packet_handler="true" />
+ <PING num_initial_members="3" timeout="2000" />
+
+ <!-- TCP bind_addr="192.168.0.15" start_port="7800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+ max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true" use_send_queues="false" sock_conn_timeout="300"
+ skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+
+ oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+ <MPING timeout="2000" num_initial_members="3" mcast_port="34526" bind_addr="192.168.0.15" mcast_addr="224.0.0.1" /-->
+
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD max_tries="5" shun="true" timeout="10000"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+ use_mcast_xmit="false"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+ <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+ view_bundling="true"/>
+ <FRAG2 frag_size="60000"/>
+ <pbcast.STREAMING_STATE_TRANSFER/>
+ <pbcast.FLUSH timeout="0"/>
+
+ </jgroupsConfig>
+
+ <sync />
+ <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below. -->
+ <!-- <async /> -->
+
+ </clustering>
+ <loaders passivation="false" shared="true">
+ <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+ fetchPersistentState="true" ignoreModifications="false"
+ purgeOnStartup="false">
+ <properties>
+ location=/tmp/test-jboss-cache/proxy
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache>
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -1,3 +1,23 @@
+<!--
+
+ 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.
+
+-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -1,3 +1,23 @@
+<!--
+
+ 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.
+
+-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -152,13 +172,13 @@
<description>JCR configuration file</description>
<value>jar:/conf/standalone/test-jcr-config.xml</value>
</value-param>
- <properties-param>
+ <!-- properties-param>
<name>working-conf</name>
<description>working-conf</description>
<property name="source-name" value="jdbcjcr"/>
<property name="dialect" value="hsqldb"/>
<property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- </properties-param>
+ </properties-param -->
</init-params>
</component>
@@ -535,7 +555,4 @@
</init-params>
</component-plugin>
</external-component-plugins>
-
- <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
- <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
</configuration>
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -1,4 +1,3 @@
-
<!--
Copyright (C) 2009 eXo Platform SAS.
@@ -18,7 +17,8 @@
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
---><repository-service default-repository="db1">
+-->
+<repository-service default-repository="db1">
<repositories>
<repository name="db1" system-workspace="ws" default-workspace="ws">
<security-domain>exo-domain</security-domain>
@@ -29,8 +29,9 @@
<workspaces>
<workspace name="ws">
<!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JBossCacheWorkspaceDataContainer">
<properties>
+ <property name="jboss-cache-conf" value="/conf/portal/exojcr-jboss-cache-conf.xml" />
<property name="source-name" value="jdbcjcr" />
<property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
@@ -58,21 +59,6 @@
<property name="root-nodetype" value="nt:unstructured" />
</properties>
</initializer>
- <!-- initializer class="org.exoplatform.services.jcr.impl.core.RestoreWorkspaceInitializer">
- <properties>
- <property name="restore-path" value="./sv_export_root.xml" />
- <property name="restore-path" value="./src/test/resources/import-export/restore_db1_ws1.xml" />
- </properties>
- </initializer
--->
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- <property name="statistic-period" value="30" />
- <property name="statistic-log" value="false" />
- </properties>
- </cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/temp/index/db1/ws" />
Modified: jcr/branches/1.12.0-JBC/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBC/pom.xml 2009-10-23 15:26:35 UTC (rev 363)
+++ jcr/branches/1.12.0-JBC/pom.xml 2009-10-23 15:57:11 UTC (rev 364)
@@ -393,6 +393,12 @@
<version>1.5</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>3.1.0.GA</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
15 years
exo-jcr SVN: r363 - jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-23 11:26:35 -0400 (Fri, 23 Oct 2009)
New Revision: 363
Modified:
jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
Log:
[EXOJCR-178] cache-control parameter handler added
Modified: jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
===================================================================
--- jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2009-10-23 15:10:31 UTC (rev 362)
+++ jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2009-10-23 15:26:35 UTC (rev 363)
@@ -23,6 +23,7 @@
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import javax.jcr.NoSuchWorkspaceException;
@@ -130,6 +131,10 @@
* Initialization "auto-version"-parameter value.
*/
public static final String INIT_PARAM_AUTO_VERSION = "auto-version";
+
+ public static final String INIT_PARAM_CACHE_CONTROL = "cache-control";
+
+ private HashMap<String, String> cacheControlMap = new HashMap<String, String>();
/**
* Logger.
@@ -251,7 +256,26 @@
autoVersionType = pAutoVersion.getValue();
log.info(INIT_PARAM_AUTO_VERSION + " = " + autoVersionType);
}
+
+
+// <value-param>
+// <name>cache-control</name>
+// <value>^(gif|jpg|png)$:max-age=3600;^(image/jpeg|text/html)$:max-age=1800</value>
+// </value-param>
+ ValueParam pCacheControl = params.getValueParam(INIT_PARAM_CACHE_CONTROL);
+ if (pCacheControl != null)
+ {
+ String cacheControlValue = pCacheControl.getValue();
+ for (String element : cacheControlValue.split(";"))
+ {
+ String mask = element.split(":")[0];
+ String value = element.split(":")[1];
+ cacheControlMap.put(mask, value);
+ }
+ log.info(INIT_PARAM_CACHE_CONTROL + " = " + pCacheControl);
+ }
+
}
/**
15 years
exo-jcr SVN: r362 - core/trunk/component/document/src/main/java/org/exoplatform/services/document/impl.
by do-not-reply@jboss.org
Author: vparfonov
Date: 2009-10-23 11:10:31 -0400 (Fri, 23 Oct 2009)
New Revision: 362
Modified:
core/trunk/component/document/src/main/java/org/exoplatform/services/document/impl/TextPlainDocumentReader.java
Log:
EXOJCR-206:Add MimeType application/x-groovy, script/groovy, application/x-javascript to the TextPlainDocumentReader.
Modified: core/trunk/component/document/src/main/java/org/exoplatform/services/document/impl/TextPlainDocumentReader.java
===================================================================
--- core/trunk/component/document/src/main/java/org/exoplatform/services/document/impl/TextPlainDocumentReader.java 2009-10-23 15:02:18 UTC (rev 361)
+++ core/trunk/component/document/src/main/java/org/exoplatform/services/document/impl/TextPlainDocumentReader.java 2009-10-23 15:10:31 UTC (rev 362)
@@ -61,13 +61,13 @@
}
/**
- * Get the text/plain mime type.
+ * Get the "text/plain","script/groovy","application/x-groovy","application/x-javascript","application/javascript","text/javascript" mime types.
*
- * @return The text/plain mime type.
+ * @return The "text/plain","script/groovy","application/x-groovy","application/x-javascript","application/javascript","text/javascript" mime type.
*/
public String[] getMimeTypes()
{
- return new String[]{"text/plain"};
+ return new String[]{"text/plain","script/groovy","application/x-groovy","application/x-javascript","application/javascript","text/javascript"};
}
/**
15 years
exo-jcr SVN: r360 - in jcr/trunk/component/core: src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-10-23 09:29:46 -0400 (Fri, 23 Oct 2009)
New Revision: 360
Modified:
jcr/trunk/component/core/known-issues.txt
jcr/trunk/component/core/pom.xml
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java
Log:
EXOJCR-193: similarity NPE fixed. TestSimilarity updated
Modified: jcr/trunk/component/core/known-issues.txt
===================================================================
--- jcr/trunk/component/core/known-issues.txt 2009-10-23 10:55:09 UTC (rev 359)
+++ jcr/trunk/component/core/known-issues.txt 2009-10-23 13:29:46 UTC (rev 360)
@@ -1,3 +0,0 @@
-
-// https://jira.jboss.org/jira/browse/EXOJCR-193
-org.exoplatform.services.jcr.impl.core.query.TestSimilarity.java
Modified: jcr/trunk/component/core/pom.xml
===================================================================
--- jcr/trunk/component/core/pom.xml 2009-10-23 10:55:09 UTC (rev 359)
+++ jcr/trunk/component/core/pom.xml 2009-10-23 13:29:46 UTC (rev 360)
@@ -361,14 +361,13 @@
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationVersionRestore.java</exclude>
- <exclude>org/exoplatform/services/jcr/**/impl/**/TestSimilarity.java</exclude>
<exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
<exclude>org/exoplatform/services/jcr/**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
<exclude>org/exoplatform/services/jcr/**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
<exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
<exclude>org/exoplatform/services/jcr/**/api/**/TestSameNameItems.java</exclude>
- <exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
-
+ <exclude>org/exoplatform/services/jcr/**/api/**/TestVersionRestore.java</exclude>
+
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionDataManager.java</exclude>
</excludes>
</configuration>
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2009-10-23 10:55:09 UTC (rev 359)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/LuceneQueryBuilder.java 2009-10-23 13:29:46 UTC (rev 360)
@@ -775,18 +775,27 @@
}, null);
QPath relPath = node.getRelativePath();
+
+ InternalQName propName;
+
if (node.getOperation() == QueryConstants.OPERATION_SIMILAR)
{
// this is a bit ugly:
// add the name of a dummy property because relPath actually
// references a property. whereas the relPath of the similar
// operation references a node
- relPath = QPath.makeChildPath(relPath, Constants.JCR_PRIMARYTYPE);
+ //relPath = QPath.makeChildPath(relPath, Constants.JCR_PRIMARYTYPE);
+ propName = Constants.JCR_PRIMARYTYPE;
}
+ else
+ {
+ propName = relPath.getName();
+ }
+
String field = "";
try
{
- field = resolver.createJCRName(relPath.getName()).getAsString();
+ field = resolver.createJCRName(propName).getAsString();
}
catch (NamespaceException e)
{
@@ -795,7 +804,7 @@
}
// support for fn:name()
- InternalQName propName = relPath.getName();
+ //InternalQName propName = relPath.getName();
if (propName.getNamespace().equals(NS_FN_URI) && propName.getName().equals("name()"))
{
if (node.getValueType() != QueryConstants.TYPE_STRING)
@@ -1053,7 +1062,7 @@
}
}
- if (relPath.getEntries().length > 1)
+ if (relPath != null && relPath.getEntries().length > 1)
{
// child axis in relation
QPathEntry[] elements = relPath.getEntries();
Modified: jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java
===================================================================
--- jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java 2009-10-23 10:55:09 UTC (rev 359)
+++ jcr/trunk/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestSimilarity.java 2009-10-23 13:29:46 UTC (rev 360)
@@ -21,6 +21,7 @@
import java.util.Calendar;
import javax.jcr.Node;
+import javax.jcr.RepositoryException;
import javax.jcr.query.Query;
import javax.jcr.query.QueryManager;
import javax.jcr.query.QueryResult;
@@ -38,7 +39,7 @@
public void testFindSimilarNodes() throws Exception
{
- // base node
+ //base node
Node file = testRootNode.addNode("baseFile", "nt:file");
Node resource = file.addNode("jcr:content", "nt:resource");
resource.setProperty("jcr:lastModified", Calendar.getInstance());
@@ -54,47 +55,55 @@
+ "Only terms that occur in at least 5 nodes are considered.");
session.save();
- // target node
+ // target nodes
Node target1 = testRootNode.addNode("target1", "nt:file");
Node resource1 = target1.addNode("jcr:content", "nt:resource");
resource1.setProperty("jcr:lastModified", Calendar.getInstance());
resource1.setProperty("jcr:encoding", "UTF-8");
resource1.setProperty("jcr:mimeType", "text/plain");
- resource1.setProperty("jcr:data", "There is term word.");
+ resource1.setProperty("jcr:data", "Similarity is determined by looking up terms that are common to nodes.");
Node target2 = testRootNode.addNode("target2", "nt:file");
Node resource2 = target2.addNode("jcr:content", "nt:resource");
resource2.setProperty("jcr:lastModified", Calendar.getInstance());
resource2.setProperty("jcr:encoding", "UTF-8");
resource2.setProperty("jcr:mimeType", "text/plain");
- resource2.setProperty("jcr:data", "You know what is not here");
+ resource2.setProperty("jcr:data", "There is no you know what");
Node target3 = testRootNode.addNode("target3", "nt:file");
Node resource3 = target3.addNode("jcr:content", "nt:resource");
resource3.setProperty("jcr:lastModified", Calendar.getInstance());
resource3.setProperty("jcr:encoding", "UTF-8");
resource3.setProperty("jcr:mimeType", "text/plain");
- resource3.setProperty("jcr:data", "Term occures here");
+ resource3.setProperty("jcr:data", "Terms occures here terms");
session.save();
- //Lets find similar
+ //Lets find similar nodes - will return base and similar target nodes
// make SQL query
QueryManager qman = session.getWorkspace().getQueryManager();
- // Query q =
- // qman.createQuery("select * from nt:resource where similar(., '/jcr:root/baseFile/jcr:content')", Query.SQL);
- // QueryResult result = q.execute();
- // checkResult(result, new Node[]{resource1, resource3});
+ Query q =
+ qman.createQuery("select * from nt:resource where similar(.,'/testroot/baseFile/jcr:content')", Query.SQL);
+ QueryResult result = q.execute();
+ assertEquals(3, result.getNodes().getSize());
+ checkResult(result, new Node[]{resource, resource1, resource3});
//make XPath query
Query xq =
- qman.createQuery("//element(*, nt:resource)[rep:similar(., '/jcr:root/baseFile/jcr:content')]", Query.XPATH);
+ qman.createQuery("//element(*, nt:resource)[rep:similar(., '/testroot/baseFile/jcr:content')]", Query.XPATH);
QueryResult xres = xq.execute();
- checkResult(xres, new Node[]{resource1, resource3});
+ assertEquals(3, xres.getNodes().getSize());
+ checkResult(xres, new Node[]{resource, resource1, resource3});
}
+ public void testSimilar() throws RepositoryException
+ {
+ executeQuery("//*[rep:similar(., '" + testRootNode.getPath() + "')]");
+ executeQuery("//*[rep:similar(node, '" + testRootNode.getPath() + "')]");
+ }
+
}
15 years