[dna-commits] DNA SVN: r1127 - in trunk/dna-jcr/src/main: resources/org/jboss/dna/jcr and 1 other directory.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Thu Jul 23 22:38:37 EDT 2009


Author: bcarothers
Date: 2009-07-23 22:38:37 -0400 (Thu, 23 Jul 2009)
New Revision: 1127

Modified:
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrContentHandler.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrMultiValueProperty.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSingleValueProperty.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrValue.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java
   trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
   trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties
Log:
DNA-471 Add Messages to JCR Exceptions with No Message

Committed patch (DNA-471_updated.patch) adds messages for all of the non-trivial exceptions that don't already have messages. 

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/AbstractJcrNode.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -202,7 +202,7 @@
     public String getUUID() throws RepositoryException {
         // Return "jcr:uuid" only if node is referenceable
         if (!isReferenceable()) {
-            throw new UnsupportedRepositoryOperationException();
+            throw new UnsupportedRepositoryOperationException(JcrI18n.nodeNotReferenceable.text());
         }
         PropertyInfo<JcrPropertyPayload> uuidProp = nodeInfo().getProperty(JcrLexicon.UUID);
         if (uuidProp == null) {
@@ -361,7 +361,7 @@
         return false;
     }
 
-    public CorrespondenceId getCorrespondenceId() throws RepositoryException {
+    protected CorrespondenceId getCorrespondenceId() throws RepositoryException {
         if (this.isReferenceable()) return new CorrespondenceId(getUUID());
         assert !this.isRoot(); // the root must be referenceable
 
@@ -829,7 +829,7 @@
         }
 
         if (!canAddMixin(mixinName)) {
-            throw new ConstraintViolationException();
+            throw new ConstraintViolationException(JcrI18n.cannotAddMixin.text(mixinName));
         }
 
         this.editor().addMixin(mixinCandidateType);
@@ -864,13 +864,13 @@
         Property existingMixinProperty = getProperty(JcrLexicon.MIXIN_TYPES);
 
         if (existingMixinProperty == null) {
-            throw new NoSuchNodeTypeException();
+            throw new NoSuchNodeTypeException(JcrI18n.invalidMixinTypeForNode.text(mixinName, getPath()));
         }
 
         Value[] existingMixinValues = existingMixinProperty.getValues();
 
         if (existingMixinValues.length == 0) {
-            throw new NoSuchNodeTypeException();
+            throw new NoSuchNodeTypeException(JcrI18n.invalidMixinTypeForNode.text(mixinName, getPath()));
         }
 
         // ------------------------------------------------------------------------------
@@ -889,7 +889,7 @@
                     newMixinValues[j++] = existingMixinValues[i];
                     newMixinNames.add(cache.nameFactory.create(existingMixinValues[i].getString()));
                 } else {
-                    throw new NoSuchNodeTypeException();
+                    throw new NoSuchNodeTypeException(JcrI18n.invalidMixinTypeForNode.text(mixinName, getPath()));
                 }
             }
         }
@@ -922,7 +922,11 @@
                 }
 
                 if (match == null) {
-                    throw new ConstraintViolationException();
+                    throw new ConstraintViolationException(JcrI18n.noDefinition.text("property",
+                                                                                     property.getName(),
+                                                                                     getPath(),
+                                                                                     primaryTypeName,
+                                                                                     newMixinNames));
                 }
             }
         }
@@ -946,7 +950,11 @@
                                                                                     true);
 
                 if (match == null) {
-                    throw new ConstraintViolationException();
+                    throw new ConstraintViolationException(JcrI18n.noDefinition.text("child node",
+                                                                                     node.getName(),
+                                                                                     getPath(),
+                                                                                     primaryTypeName,
+                                                                                     newMixinNames));
                 }
             }
         }
@@ -1556,13 +1564,15 @@
                                    String destChildRelPath ) throws UnsupportedRepositoryOperationException, RepositoryException {
         // This implementation is correct, except for not calling the SessionCache or graph layer to do the re-order
         if (!getPrimaryNodeType().hasOrderableChildNodes()) {
-            throw new UnsupportedRepositoryOperationException();
+            throw new UnsupportedRepositoryOperationException(
+                                                              JcrI18n.notOrderable.text(getPrimaryNodeType().getName(), getPath()));
         }
 
         PathFactory pathFactory = this.cache.pathFactory();
         Path srcPath = pathFactory.create(srcChildRelPath);
         if (srcPath.isAbsolute() || srcPath.size() != 1) {
-            throw new ItemNotFoundException();
+            throw new ItemNotFoundException(JcrI18n.pathNotFound.text(srcPath.getString(cache.context().getNamespaceRegistry()),
+                                                                      cache.session().workspace().getName()));
         }
         // getLastSegment should return the only segment, since we verified that size() == 1
         Path.Segment sourceSegment = srcPath.getLastSegment();
@@ -1578,7 +1588,9 @@
         if (destChildRelPath != null) {
             Path destPath = pathFactory.create(destChildRelPath);
             if (destPath.isAbsolute() || destPath.size() != 1) {
-                throw new ItemNotFoundException();
+                throw new ItemNotFoundException(
+                                                JcrI18n.pathNotFound.text(destPath.getString(cache.context().getNamespaceRegistry()),
+                                                                          cache.session().workspace().getName()));
             }
 
             destSegment = destPath.getLastSegment();

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrContentHandler.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrContentHandler.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrContentHandler.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -360,12 +360,18 @@
                                     break;
                                 case ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING:
                                     if (existingNodeWithUuid.path().isAtOrAbove(parentStack.firstElement().path())) {
-                                        throw new ConstraintViolationException();
+                                        throw new ConstraintViolationException(
+                                                                               JcrI18n.cannotRemoveParentNodeOfTarget.text(existingNodeWithUuid.getPath(),
+                                                                                                                           uuid,
+                                                                                                                           parentStack.firstElement().getPath()));
                                     }
                                     existingNodeWithUuid.remove();
                                     break;
                                 case ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW:
-                                    throw new ItemExistsException();
+                                    throw new ItemExistsException(
+                                                                  JcrI18n.itemAlreadyExistsWithUuid.text(uuid,
+                                                                                                         cache().session().workspace().getName(),
+                                                                                                         existingNodeWithUuid.getPath()));
                             }
                         } catch (ItemNotFoundException e) {
                             // there wasn't an existing item, so just continue

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrI18n.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -40,6 +40,7 @@
     public static I18n nonInputStreamConsumed;
     public static I18n pathNotFound;
     public static I18n pathNotFoundRelativeTo;
+    public static I18n pathCannotHaveSameNameSiblingIndex;
     public static I18n permissionDenied;
     public static I18n repositoryMustBeConfigured;
     public static I18n sourceInUse;
@@ -47,6 +48,7 @@
     public static I18n fileDoesNotExist;
 
     public static I18n rootNodeHasNoParent;
+    public static I18n childNodeAlreadyExists;
 
     public static I18n noNamespaceWithPrefix;
     public static I18n noNamespaceWithUri;
@@ -71,6 +73,7 @@
     public static I18n primaryItemNameForPrimaryTypeIsNotValid;
     public static I18n primaryItemDoesNotExist;
     public static I18n itemNotFoundWithUuid;
+    public static I18n itemAlreadyExistsWithUuid;
     public static I18n itemNotFoundAtPath;
     public static I18n itemNotFoundAtPathRelativeToReferenceNode;
     public static I18n propertyNotFoundOnNode;
@@ -87,11 +90,16 @@
     public static I18n unableToSaveNodeThatWasCreatedSincePreviousSave;
     public static I18n unableToSetMultiValuedPropertyUsingSingleValue;
     public static I18n unableToSetSingleValuedPropertyUsingMultipleValues;
+    public static I18n invalidMethodForSingleValuedProperty;
+    public static I18n invalidMethodForMultiValuedProperty;
     public static I18n unableToRefreshBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch;
     public static I18n unableToSaveBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch;
     public static I18n allPropertyValuesMustHaveSameType;
     public static I18n cannotRemoveNodeFromClone;
 
+    public static I18n cannotRemoveParentNodeOfTarget;
+    public static I18n invalidPropertyType;
+
     public static I18n unableToRemoveRootNode;
     public static I18n unableToMoveNodeToBeChildOfDecendent;
     public static I18n nodeHasAlreadyBeenRemovedFromThisSession;
@@ -146,12 +154,17 @@
     public static I18n allNodeTypeTemplatesMustComeFromSameSession;
 
     public static I18n nodeNotReferenceable;
+    public static I18n nodeNotReferenceableUuid;
     public static I18n noPendingChangesAllowed;
 
     public static I18n cannotUnregisterSupertype;
     public static I18n cannotUnregisterRequiredPrimaryType;
     public static I18n cannotUnregisterDefaultPrimaryType;
 
+    public static I18n cannotAddMixin;
+    public static I18n invalidMixinTypeForNode;
+    public static I18n notOrderable;
+
     static {
         try {
             I18n.initialize(JcrI18n.class);

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrMultiValueProperty.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrMultiValueProperty.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrMultiValueProperty.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -71,7 +71,7 @@
      * @see javax.jcr.Property#getBoolean()
      */
     public boolean getBoolean() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -81,7 +81,7 @@
      * @see javax.jcr.Property#getDate()
      */
     public Calendar getDate() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -91,7 +91,7 @@
      * @see javax.jcr.Property#getDouble()
      */
     public double getDouble() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -100,7 +100,7 @@
      * @see javax.jcr.Property#getNode()
      */
     public Node getNode() throws ValueFormatException, RepositoryException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -110,7 +110,7 @@
      * @see javax.jcr.Property#getLength()
      */
     public long getLength() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -135,7 +135,7 @@
      * @see javax.jcr.Property#getLong()
      */
     public long getLong() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -145,7 +145,7 @@
      * @see javax.jcr.Property#getStream()
      */
     public InputStream getStream() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -155,7 +155,7 @@
      * @see javax.jcr.Property#getString()
      */
     public String getString() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -240,7 +240,7 @@
      * @see javax.jcr.Property#getValue()
      */
     public Value getValue() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -250,7 +250,7 @@
      * @see javax.jcr.Property#setValue(javax.jcr.Value)
      */
     public final void setValue( Value value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -260,7 +260,7 @@
      * @see javax.jcr.Property#setValue(java.lang.String)
      */
     public final void setValue( String value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -270,7 +270,7 @@
      * @see javax.jcr.Property#setValue(java.io.InputStream)
      */
     public final void setValue( InputStream value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -280,7 +280,7 @@
      * @see javax.jcr.Property#setValue(long)
      */
     public final void setValue( long value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -290,7 +290,7 @@
      * @see javax.jcr.Property#setValue(double)
      */
     public final void setValue( double value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -300,7 +300,7 @@
      * @see javax.jcr.Property#setValue(java.util.Calendar)
      */
     public final void setValue( Calendar value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -310,7 +310,7 @@
      * @see javax.jcr.Property#setValue(boolean)
      */
     public final void setValue( boolean value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
     /**
@@ -320,7 +320,7 @@
      * @see javax.jcr.Property#setValue(javax.jcr.Node)
      */
     public final void setValue( Node value ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForMultiValuedProperty.text());
     }
 
 }

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSession.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -564,7 +564,7 @@
 
             public Value createValue( Node value ) throws RepositoryException {
                 if (!value.isNodeType(JcrMixLexicon.REFERENCEABLE.getString(JcrSession.this.namespaces()))) {
-                    throw new RepositoryException();
+                    throw new RepositoryException(JcrI18n.nodeNotReferenceable.text());
                 }
                 String uuid = valueFactories.getStringFactory().create(value.getUUID());
                 return new JcrValue(valueFactories, sessionCache, PropertyType.REFERENCE, uuid);
@@ -772,14 +772,15 @@
         Path.Segment newNodeName = destPath.getSegment(destPath.size() - 1);
         // Doing a literal test here because the path factory will canonicalize "/node[1]" to "/node"
         if (destAbsPath.endsWith("]")) {
-            throw new RepositoryException();
+            throw new RepositoryException(JcrI18n.pathCannotHaveSameNameSiblingIndex.text(destAbsPath));
         }
 
         AbstractJcrNode sourceNode = getNode(pathFactory.create(srcAbsPath));
         AbstractJcrNode newParentNode = getNode(destPath.getParent());
 
+        String newNodeNameAsString = newNodeName.getString(executionContext.getNamespaceRegistry());
         if (newParentNode.hasNode(newNodeName.getString(executionContext.getNamespaceRegistry()))) {
-            throw new ItemExistsException();
+            throw new ItemExistsException(JcrI18n.childNodeAlreadyExists.text(newNodeNameAsString, newParentNode.getPath()));
         }
 
         newParentNode.editor().moveToBeChild(sourceNode, newNodeName.getName());

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSingleValueProperty.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSingleValueProperty.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrSingleValueProperty.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -116,7 +116,7 @@
      * @see javax.jcr.Property#getLengths()
      */
     public long[] getLengths() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForSingleValuedProperty.text());
     }
 
     /**
@@ -237,7 +237,7 @@
                 setValue(value.getString());
                 break;
             default:
-                throw new RepositoryException();
+                throw new RepositoryException(JcrI18n.invalidPropertyType.text(value.getType()));
         }
     }
 
@@ -346,7 +346,7 @@
      * @see javax.jcr.Property#getValues()
      */
     public Value[] getValues() throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForSingleValuedProperty.text());
     }
 
     /**
@@ -355,7 +355,7 @@
      * @see javax.jcr.Property#setValue(javax.jcr.Value[])
      */
     public void setValue( Value[] values ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForSingleValuedProperty.text());
     }
 
     /**
@@ -364,6 +364,6 @@
      * @see javax.jcr.Property#setValue(java.lang.String[])
      */
     public void setValue( String[] values ) throws ValueFormatException {
-        throw new ValueFormatException();
+        throw new ValueFormatException(JcrI18n.invalidMethodForSingleValuedProperty.text());
     }
 }

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrValue.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrValue.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrValue.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -279,7 +279,7 @@
                     case PropertyType.REFERENCE:
                         return this.getString().equals(that.getString());
                     default:
-                        throw new SystemFailureException();
+                        throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
                 }
             } catch (RepositoryException e) {
                 return false;
@@ -310,7 +310,7 @@
                     case PropertyType.REFERENCE:
                         return this.getString().equals(that.getString());
                     default:
-                        throw new SystemFailureException();
+                        throw new SystemFailureException(JcrI18n.invalidPropertyType.text(this.type));
                 }
             } catch (IOException e) {
                 return false;

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/JcrWorkspace.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -307,7 +307,7 @@
 
         // Doing a literal test here because the path factory will canonicalize "/node[1]" to "/node"
         if (destAbsPath.endsWith("]")) {
-            throw new RepositoryException();
+            throw new RepositoryException(JcrI18n.pathCannotHaveSameNameSiblingIndex.text(destAbsPath));
         }
 
         try {
@@ -431,7 +431,7 @@
 
         // Doing a literal test here because the path factory will canonicalize "/node[1]" to "/node"
         if (destAbsPath.endsWith("]")) {
-            throw new RepositoryException();
+            throw new RepositoryException(JcrI18n.pathCannotHaveSameNameSiblingIndex.text(destAbsPath));
         }
 
         try {
@@ -538,7 +538,7 @@
 
         // Doing a literal test here because the path factory will canonicalize "/node[1]" to "/node"
         if (destAbsPath.endsWith("]")) {
-            throw new RepositoryException();
+            throw new RepositoryException(JcrI18n.pathCannotHaveSameNameSiblingIndex.text(destAbsPath));
         }
 
         try {

Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/SessionCache.java	2009-07-24 02:38:37 UTC (rev 1127)
@@ -937,7 +937,12 @@
                                                                 true,
                                                                 skipProtected);
                 if (definition == null) {
-                    throw new ConstraintViolationException();
+                    throw new ConstraintViolationException(
+                                                           JcrI18n.noDefinition.text("property",
+                                                                                     readable(name),
+                                                                                     readable(node.getPath()),
+                                                                                     readable(payload.getPrimaryTypeName()),
+                                                                                     readable(payload.getMixinTypeNames())));
                 }
             }
             // Create the DNA property ...
@@ -1109,7 +1114,12 @@
                                                                 newValues,
                                                                 skipProtected);
                 if (definition == null) {
-                    throw new ConstraintViolationException();
+                    throw new ConstraintViolationException(
+                                                           JcrI18n.noDefinition.text("property",
+                                                                                     readable(name),
+                                                                                     readable(node.getPath()),
+                                                                                     readable(payload.getPrimaryTypeName()),
+                                                                                     readable(payload.getMixinTypeNames())));
                 }
             }
             // Create the DNA property ...
@@ -1239,8 +1249,8 @@
                     // The node definition changed, so try to set the property ...
                     NodeEditor newChildEditor = getEditorFor(existingChild);
                     try {
-                        JcrValue value = new JcrValue(factories(), SessionCache.this, PropertyType.STRING, defn.getId()
-                                                                                                               .getString());
+                        JcrValue value = new JcrValue(factories(), SessionCache.this, PropertyType.STRING,
+                                                      defn.getId().getString());
                         newChildEditor.setProperty(DnaIntLexicon.NODE_DEFINITON, value);
                     } catch (ConstraintViolationException e) {
                         // We can't set this property on the node (according to the node definition).

Modified: trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties
===================================================================
--- trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties	2009-07-24 01:15:00 UTC (rev 1126)
+++ trunk/dna-jcr/src/main/resources/org/jboss/dna/jcr/JcrI18n.properties	2009-07-24 02:38:37 UTC (rev 1127)
@@ -30,6 +30,7 @@
 nonInputStreamConsumed = This value was already consumed as a non-input stream
 pathNotFound = No item exists at path {0} in workspace "{1}"
 pathNotFoundRelativeTo = No item exists at path {0} relative to {1} in workspace "{2}"
+pathCannotHaveSameNameSiblingIndex = The path specified by the argument "{0}" cannot have a same-name-sibling index
 permissionDenied = Permission denied to perform actions "{1}" on path {0}
 repositoryMustBeConfigured = DNA repositories must be configured with either a repository source factory or a repository source
 sourceInUse = All sessions must end before a new repository source can be set
@@ -37,6 +38,7 @@
 fileDoesNotExist = Unable to find or read the file "{0}"
 
 rootNodeHasNoParent = The root node has no parent node
+childNodeAlreadyExists = A child node named "{0}" already exists at node "{1}"
 
 noNamespaceWithPrefix = There is no namespace with prefix "{0}"
 noNamespaceWithUri = There is no namespace with URI "{0}"
@@ -61,6 +63,7 @@
 primaryItemNameForPrimaryTypeIsNotValid = The primary type "{0}" for node "{2}" in workspace "{3}" defines an invalid primary item name ("{1}")
 primaryItemDoesNotExist = The node "{2}" in workspace "{3}" does not have an item named "{1}" as defined by its primary type "{0}"
 itemNotFoundWithUuid = An item with UUID "{0}" could not be found in workspace "{1}": {2}
+itemAlreadyExistsWithUuid = An item with UUID "{0}" already exists in workspace "{1}" at "{2}"
 itemNotFoundAtPath = An item at "{0}" could not be found in workspace "{1}"
 itemNotFoundAtPathRelativeToReferenceNode = An item at "{0}" relative to "{1}" could not be found in workspace "{2}"
 propertyNotFoundOnNode = Property "{0}" does not exist on node "{1}" in workspace "{2}"
@@ -77,10 +80,15 @@
 unableToSaveNodeThatWasCreatedSincePreviousSave = Unable to save node "{0}" in workspace "{1}" because it was created since the last save
 unableToSetMultiValuedPropertyUsingSingleValue = Unable to set existing multi-valued property "{0}" on node "{1}" in workspace "{2}" using single-value setter methods
 unableToSetSingleValuedPropertyUsingMultipleValues = Unable to set existing single-valued property "{0}" on node "{1}" in workspace "{2}" using multi-value setter methods
+invalidMethodForSingleValuedProperty = This method cannot be called on a property with a single value
+invalidMethodForMultiValuedProperty = This method cannot be called on a property with multiple values
 unableToRefreshBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch = Unable to refresh "{0}" in workspace "{1}" because it contains changes that depend on changes to nodes outside of this branch
 unableToSaveBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch = Unable to save "{0}" in workspace "{1}" because it contains changes that depend on changes to nodes outside of this branch
 allPropertyValuesMustHaveSameType = All values of property "{0}" on node "{3}" in workspace "{4}" must all be {2} values (values were: {1})
 cannotRemoveNodeFromClone = The node at "{0}" with UUID "{1}" exists in the current workspace but cannot be removed because it is a mandatory child node
+cannotRemoveParentNodeOfTarget = The node at "{0}" with UUID "{1}" is a parent of the target node for this operation "{2}"
+invalidPropertyType = Invalid property type: {0}
+ 
 
 unableToRemoveRootNode = Unable to remove the root node in workspace "{1}"
 unableToMoveNodeToBeChildOfDecendent = Node "{0}" in workspace "{2}" cannot be moved under a decendant node ("{1}") 
@@ -131,8 +139,13 @@
 allNodeTypeTemplatesMustComeFromSameSession=All node type templates must be created from the same javax.jcr.Session
 
 nodeNotReferenceable=Only referenceable nodes may be the value of reference properties
+nodeNotReferenceableUuid = Only referenceable nodes have a public UUID assigned
 noPendingChangesAllowed=This operation cannot be performed when the session has pending changes
 
 cannotUnregisterSupertype=Cannot unregister type '{0}' which is supertype of type '{1}'
 cannotUnregisterRequiredPrimaryType=Cannot unregister type '{0}' which is the required primary type for child node '{2}' on type '{1}'
-cannotUnregisterDefaultPrimaryType=Cannot unregister type '{0}' which is the default primary type for child node '{2}' of type '{1}'
\ No newline at end of file
+cannotUnregisterDefaultPrimaryType=Cannot unregister type '{0}' which is the default primary type for child node '{2}' of type '{1}'
+
+cannotAddMixin = This node does not allow adding the mixin type "{0}"
+invalidMixinTypeForNode = "{0}" is not currently a mixin type for node "{1}"
+notOrderable = The primary type "{0}" for this node (at "{1}") does not have orderable children



More information about the dna-commits mailing list