Author: tolusha
Date: 2010-10-08 05:34:35 -0400 (Fri, 08 Oct 2010)
New Revision: 3259
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/pom.xml
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java
Log:
EXOJCR-955: NPE when try to import data via WorkspaceContentImporter
Modified: jcr/branches/1.12.x/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/pom.xml 2010-10-08 09:07:54 UTC (rev 3258)
+++ jcr/branches/1.12.x/exo.jcr.component.core/pom.xml 2010-10-08 09:34:35 UTC (rev 3259)
@@ -409,7 +409,6 @@
<exclude>org/exoplatform/services/jcr/**/impl/**/TestRepositoryManagement.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSaveConfiguration.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/ValueStoragePluginTest.java</exclude>
-
<exclude>org/exoplatform/services/jcr/**/impl/**/TestWorkspaceRestore.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestSessionCleaner.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestJCRSerializationStream.java</exclude>
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08
09:07:54 UTC (rev 3258)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08
09:34:35 UTC (rev 3259)
@@ -18,21 +18,6 @@
*/
package org.exoplatform.services.jcr.impl.xml.importing;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.ValueFormatException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-
import org.exoplatform.services.jcr.access.AccessManager;
import org.exoplatform.services.jcr.core.ExtendedPropertyType;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
@@ -62,6 +47,21 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.security.ConversationState;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.ValueFormatException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
/**
* Created by The eXo Platform SAS.
*
@@ -159,7 +159,7 @@
ImportNodeData currentNodeInfo = (ImportNodeData)getParent();
- NodePropertiesInfo currentNodePropertiesInfo =
mapNodePropertiesInfo.get(currentNodeInfo.getQPath().getAsString());
+ NodePropertiesInfo currentNodePropertiesInfo =
mapNodePropertiesInfo.get(currentNodeInfo.getIdentifier());
currentNodePropertiesInfo.addProperty(propertyData);
}
@@ -219,7 +219,7 @@
changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true,
getAncestorToSave()));
- mapNodePropertiesInfo.put(newNodeData.getQPath().getAsString(), new
NodePropertiesInfo(newNodeData));
+ mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new
NodePropertiesInfo(newNodeData));
tree.push(newNodeData);
@@ -307,14 +307,14 @@
{
ImportNodeData currentNodeInfo = (ImportNodeData)tree.pop();
- NodePropertiesInfo currentNodePropertiesInfo =
mapNodePropertiesInfo.get(currentNodeInfo.getQPath().getAsString());
+ NodePropertiesInfo currentNodePropertiesInfo =
mapNodePropertiesInfo.get(currentNodeInfo.getIdentifier());
if (currentNodePropertiesInfo != null)
{
checkProperties(currentNodePropertiesInfo);
}
- mapNodePropertiesInfo.remove(currentNodeInfo.getQPath().getAsString());
+ mapNodePropertiesInfo.remove(currentNodeInfo.getIdentifier());
currentNodeInfo.setMixinTypeNames(currentNodeInfo.getMixinTypeNames());
@@ -567,8 +567,8 @@
tree.push(currentNodeInfo);
- mapNodePropertiesInfo.put(currentNodeInfo.getQPath().getAsString(), new
NodePropertiesInfo(currentNodeInfo));
-
+ mapNodePropertiesInfo.put(currentNodeInfo.getIdentifier(), new
NodePropertiesInfo(currentNodeInfo));
+
return propertyData;
}
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-10-08
09:07:54 UTC (rev 3258)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-10-08
09:34:35 UTC (rev 3259)
@@ -18,6 +18,11 @@
*/
package org.exoplatform.services.jcr.impl.xml.importing;
+import java.util.Map;
+
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.RepositoryException;
+
import org.exoplatform.services.jcr.access.AccessControlList;
import org.exoplatform.services.jcr.access.AccessManager;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
@@ -35,11 +40,6 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.security.ConversationState;
-import java.util.Map;
-
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS.
*
@@ -136,6 +136,8 @@
changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true,
parentData.getQPath()));
}
tree.push(newNodeData);
+
+ mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new
NodePropertiesInfo(newNodeData));
}
else
{
Show replies by date