exo-jcr SVN: r400 - in ws/trunk: frameworks and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 12:25:29 -0400 (Mon, 26 Oct 2009)
New Revision: 400
Added:
ws/trunk/exo.ws.frameworks.json/
Removed:
ws/trunk/frameworks/json/
Log:
EXOJCR-163 module names changed, projects moved
Copied: ws/trunk/exo.ws.frameworks.json (from rev 399, ws/trunk/frameworks/json)
14 years, 6 months
exo-jcr SVN: r399 - ws/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 12:23:41 -0400 (Mon, 26 Oct 2009)
New Revision: 399
Added:
ws/trunk/exo.ws.testframework/
Removed:
ws/trunk/testframework/
Log:
EXOJCR-163 module name changed
Copied: ws/trunk/exo.ws.testframework (from rev 398, ws/trunk/testframework)
14 years, 6 months
exo-jcr SVN: r398 - ws/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 12:22:15 -0400 (Mon, 26 Oct 2009)
New Revision: 398
Added:
ws/trunk/exo.ws.commons/
Removed:
ws/trunk/commons/
Log:
EXOJCR-163 module name changed
Copied: ws/trunk/exo.ws.commons (from rev 397, ws/trunk/commons)
14 years, 6 months
exo-jcr SVN: r397 - core/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 12:16:32 -0400 (Mon, 26 Oct 2009)
New Revision: 397
Modified:
core/trunk/pom.xml
Log:
EXOJCR-163 pom updated
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-10-26 16:11:15 UTC (rev 396)
+++ core/trunk/pom.xml 2009-10-26 16:16:32 UTC (rev 397)
@@ -49,16 +49,16 @@
</scm>
<modules>
- <module>component/security/core</module>
- <module>component/database</module>
- <module>component/document</module>
- <module>component/ldap</module>
- <module>component/organization/api</module>
- <module>component/organization/jdbc</module>
- <module>component/organization/ldap</module>
- <module>component/xml-processing</module>
- <module>component/script/groovy</module>
- <module>component/web/css</module>
+ <module>exo.core.component.security.core</module>
+ <module>exo.core.component.database</module>
+ <module>exo.core.component.document</module>
+ <module>exo.core.component.ldap</module>
+ <module>exo.core.component.organization.api</module>
+ <module>exo.core.component.organization.jdbc</module>
+ <module>exo.core.component.organization.ldap</module>
+ <module>exo.core.component.xml-processing</module>
+ <module>exo.core.component.script.groovy</module>
+ <module>exo.core.component.web.css</module>
<module>packaging/module</module>
</modules>
14 years, 6 months
exo-jcr SVN: r396 - core/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 12:11:15 -0400 (Mon, 26 Oct 2009)
New Revision: 396
Added:
core/trunk/exo.core.component.organization.ldap/
Removed:
core/trunk/exo.core.component.organization.api.ldap/
Log:
Copied: core/trunk/exo.core.component.organization.ldap (from rev 395, core/trunk/exo.core.component.organization.api.ldap)
14 years, 6 months
exo-jcr SVN: r395 - 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 12:00:48 -0400 (Mon, 26 Oct 2009)
New Revision: 395
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
Log:
EXOJCR-201 : ExoJCRCacheLoader was changed.
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-26 15:59:56 UTC (rev 394)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-10-26 16:00:48 UTC (rev 395)
@@ -19,12 +19,16 @@
package org.exoplatform.services.jcr.impl.storage.jbosscache;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+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.impl.storage.jdbc.JDBCStorageConnection;
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.Modification.ModificationType;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.loader.CacheLoader;
@@ -34,6 +38,8 @@
import java.util.Map;
import java.util.Set;
+import javax.jcr.RepositoryException;
+
/**
* Created by The eXo Platform SAS.
*
@@ -47,8 +53,6 @@
private WorkspaceDataContainer dataContainer;
- private JDBCStorageConnection jdbcConnection;
-
/**
* Init the loader DataContainer with given WorkspaceDataContainer instance.
*
@@ -131,16 +135,79 @@
*/
public void prepare(Object tx, List<Modification> modifications, boolean onePhase) throws Exception
{
- // TODO Auto-generated method stub
+ JDBCStorageConnection jdbcConnection = (JDBCStorageConnection) dataContainer.openConnection();
+ try {
+ for (Modification md : modifications)
+ {
+ switch (md.getType()) {
+ case PUT_KEY_VALUE:
+ doModified(md, jdbcConnection);
+ break;
+ case REMOVE_NODE:
+ doRemove(md, jdbcConnection);
+ break;
+ }
+ }
+
+ if (jdbcConnection != null)
+ jdbcConnection.commit();
+ } finally {
+ if (jdbcConnection != null && jdbcConnection.isOpened())
+ jdbcConnection.rollback();
+ }
}
+
+ private void doRemove(Modification modification, JDBCStorageConnection jdbcConnection) {
+ //TODO
+ }
+
+ /**
+ * Performs ADD and UPDATE to NodeData and PropertyData.
+ * @param modification
+ * @param jdbcConnection
+ * @throws IllegalStateException
+ * @throws RepositoryException
+ */
+ private void doModified(Modification modification, JDBCStorageConnection jdbcConnection) throws IllegalStateException, RepositoryException
+ {
+ if (modification.getValue() instanceof NodeData)
+ {
+ //add or update node data
+ NodeData nodeData = (NodeData) modification.getValue();
+
+ ItemData itemData = jdbcConnection.getItemData(nodeData.getIdentifier());
+
+ if (itemData == null) {
+ //add
+ jdbcConnection.add(nodeData);
+ } else {
+ //update
+ jdbcConnection.update(nodeData);
+ }
+ }
+ else if (modification.getValue() instanceof PropertyData)
+ {
+ //add or update property data
+ PropertyData propertyData = (PropertyData) modification.getValue();
+
+ ItemData itemData = jdbcConnection.getItemData(propertyData.getIdentifier());
+
+ if (itemData == null) {
+ //add
+ jdbcConnection.add(propertyData);
+ } else {
+ //update
+ jdbcConnection.update(propertyData);
+ }
+ }
+ }
/**
* {@inheritDoc}
*/
public Object put(Fqn name, Object key, Object value) throws Exception
{
- dataContainer.
return null;
}
14 years, 6 months
exo-jcr SVN: r394 - core/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 11:59:56 -0400 (Mon, 26 Oct 2009)
New Revision: 394
Removed:
core/trunk/component/
Log:
EXOJCR-163 component folder removed
14 years, 6 months
exo-jcr SVN: r393 - in core/trunk: component and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 11:58:51 -0400 (Mon, 26 Oct 2009)
New Revision: 393
Added:
core/trunk/exo.core.component.xml-processing/
Removed:
core/trunk/component/xml-processing/
Log:
EXOJCR-163 module names changed, projects moved
Copied: core/trunk/exo.core.component.xml-processing (from rev 392, core/trunk/component/xml-processing)
14 years, 6 months
exo-jcr SVN: r392 - in core/trunk: component/web and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 11:56:54 -0400 (Mon, 26 Oct 2009)
New Revision: 392
Added:
core/trunk/exo.core.component.web.css/
Removed:
core/trunk/component/web/css/
Log:
EXOJCR-163 module names changed, projects moved
Copied: core/trunk/exo.core.component.web.css (from rev 391, core/trunk/component/web/css)
14 years, 6 months
exo-jcr SVN: r391 - in core/trunk: component/script and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-26 11:54:37 -0400 (Mon, 26 Oct 2009)
New Revision: 391
Added:
core/trunk/exo.core.component.script.groovy/
Removed:
core/trunk/component/script/exo.core.component.script.groovy/
Log:
EXOJCR-163 projects moved
Copied: core/trunk/exo.core.component.script.groovy (from rev 390, core/trunk/component/script/exo.core.component.script.groovy)
14 years, 6 months