Author: areshetnyak
Date: 2009-11-17 06:53:08 -0500 (Tue, 17 Nov 2009)
New Revision: 712
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.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/JBossCacheTreeStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCStorageConnectionTest.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
Log:
EXOJCR-249 : Add methods delateNode and deleteProperty in WorkspaceStprageConnection.
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -276,4 +276,24 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteProperty(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
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-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -377,6 +377,26 @@
/**
* {@inheritDoc}
*/
+ public void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteProperty(String identifier) throws RepositoryException,
+ UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public ItemData getItemData(String identifier) throws RepositoryException,
IllegalStateException
{
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -436,4 +436,24 @@
throw new UnsupportedOperationException();
}
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteProperty(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -490,10 +490,30 @@
exceptionHandler.handleDeleteException(e, data);
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ }
+
/**
* {@inheritDoc}
*/
+ public void deleteProperty(String identifier) throws RepositoryException,
+ UnsupportedOperationException, InvalidItemStateException,
IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public void update(NodeData data) throws RepositoryException,
UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -259,6 +259,42 @@
*/
void delete(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException,
IllegalStateException;
+
+ /**
+ * Deletes <code>NodeData</code> by identifier.
+ *
+ * @param identifier
+ * the identifier of NodeData to be deleted
+ *
+ * @throws InvalidItemStateException
+ * if the data is already deleted
+ * @throws UnsupportedOperationException
+ * if operation is not supported (it is container for level 1)
+ * @throws RepositoryException
+ * if some exception occured
+ * @throws IllegalStateException
+ * if connection is closed
+ */
+ void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException, InvalidItemStateException,
+ IllegalStateException;
+
+ /**
+ * Deletes <code>PropertyData</code> by identifier.
+ *
+ * @param identifier
+ * the identifier of PropertyData to be deleted
+ *
+ * @throws InvalidItemStateException
+ * if the data is already deleted
+ * @throws UnsupportedOperationException
+ * if operation is not supported (it is container for level 1)
+ * @throws RepositoryException
+ * if some exception occured
+ * @throws IllegalStateException
+ * if connection is closed
+ */
+ void deleteProperty(String identifier) throws RepositoryException,
UnsupportedOperationException, InvalidItemStateException,
+ IllegalStateException;
/**
* Deletes <code>PropertyData</code>.
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCStorageConnectionTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -18,6 +18,12 @@
*/
package org.exoplatform.services.jcr.impl.storage;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.access.AccessControlEntry;
import org.exoplatform.services.jcr.access.PermissionType;
@@ -37,13 +43,9 @@
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS Author : Peter Nedonosko
peter.nedonosko(a)exoplatform.com.ua
* 30.01.2008
@@ -259,5 +261,27 @@
assertEquals("Wrong permission for operators",
PermissionType.SET_PROPERTY, iperms.get(0));
assertEquals("Wrong permission for operators", PermissionType.ADD_NODE,
iperms.get(1));
}
+
+ public void testDeleteItemsById() throws Exception
+ {
+ WorkspaceDataContainer dataContainer =
+ (WorkspaceDataContainer)
session.getContainer().getComponentInstanceOfType(WorkspaceDataContainer.class);
+ List<PropertyData> propertysData =
dataManager.getChildPropertiesData(testRoot);
+
+ assertNotNull(propertysData);
+ assertEquals(1, propertysData.size());
+
+ PropertyData primaryTypeData = propertysData.get(0);
+
+ WorkspaceStorageConnection connection = dataContainer.openConnection();
+
+ connection.deleteProperty(primaryTypeData.getIdentifier());
+ connection.deleteNode(testRoot.getIdentifier());
+ connection.commit();
+
+ assertNull(dataManager.getItemData(testRoot.getIdentifier()));
+ assertNull(dataManager.getItemData(primaryTypeData.getIdentifier()));
+ }
+
}
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-17
11:05:04 UTC (rev 711)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-17
11:53:08 UTC (rev 712)
@@ -572,6 +572,26 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteNode(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void deleteProperty(String identifier) throws RepositoryException,
UnsupportedOperationException,
+ InvalidItemStateException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
}