jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r409533 - in /jackrabbit/branches/1.0/jackrabbit/src: main/java/org/apache/jackrabbit/core/xml/ test/java/org/apache/jackrabbit/core/xml/
Date Fri, 26 May 2006 01:10:22 GMT
Author: jukka
Date: Thu May 25 18:10:21 2006
New Revision: 409533

URL: http://svn.apache.org/viewvc?rev=409533&view=rev
Log:
1.0: Merged revisions 390669 and 390700: JCR-369

Added:
    jackrabbit/branches/1.0/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/
      - copied from r390669, jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/
    jackrabbit/branches/1.0/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java
      - copied unchanged from r390669, jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/DocumentViewTest.java
    jackrabbit/branches/1.0/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java
      - copied unchanged from r390669, jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/xml/TestAll.java
Modified:
    jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java

Modified: jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java?rev=409533&r1=409532&r2=409533&view=diff
==============================================================================
--- jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
(original)
+++ jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
Thu May 25 18:10:21 2006
@@ -210,15 +210,7 @@
                     }
                 } else if (propName.equals(QName.JCR_MIXINTYPES)) {
                     // jcr:mixinTypes
-                    if (attrValue.length() > 0) {
-                        try {
-                            mixinTypes =
-                                    new QName[]{QName.fromJCRName(attrValue, nsContext)};
-                        } catch (NameException be) {
-                            throw new SAXException("illegal jcr:mixinTypes value: "
-                                    + attrValue, be);
-                        }
-                    }
+                    mixinTypes = parseNames(attrValue);
                 } else if (propName.equals(QName.JCR_UUID)) {
                     // jcr:uuid
                     if (attrValue.length() > 0) {
@@ -241,6 +233,29 @@
         } catch (RepositoryException re) {
             throw new SAXException(re);
         }
+    }
+
+    /**
+     * Parses the given string as a list of JCR names. Any whitespace sequence
+     * is supported as a names separator instead of just a single space to
+     * be more liberal in what we accept. The current namespace context is
+     * used to convert the prefixed name strings to QNames.
+     *
+     * @param value string value
+     * @return the parsed names
+     * @throws SAXException if an invalid name was encountered
+     */
+    private QName[] parseNames(String value) throws SAXException {
+        String[] names = value.split("\\p{Space}+");
+        QName[] qnames = new QName[names.length];
+        for (int i = 0; i < names.length; i++) {
+            try {
+                qnames[i] = nsContext.getQName(names[i]);
+            } catch (NameException ne) {
+                throw new SAXException("Invalid name: " + names[i], ne);
+            }
+        }
+        return qnames;
     }
 
     /**



Mime
View raw message