jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1405027 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml: PropInfo.java ProtectedItemImporter.java TextValue.java
Date Fri, 02 Nov 2012 16:14:54 GMT
Author: angela
Date: Fri Nov  2 16:14:53 2012
New Revision: 1405027

URL: http://svn.apache.org/viewvc?rev=1405027&view=rev
Log:
OAK-414 : Importing protected properties (work in progress)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/PropInfo.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/ProtectedItemImporter.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/TextValue.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/PropInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/PropInfo.java?rev=1405027&r1=1405026&r2=1405027&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/PropInfo.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/PropInfo.java
Fri Nov  2 16:14:53 2012
@@ -54,7 +54,7 @@ public class PropInfo {
     /**
      * Hint indicating whether the property is multi- or single-value
      */
-    public enum MultipleStatus { UNKNOWN, SINGLE, MULTIPLE }
+    public enum MultipleStatus { UNKNOWN, MULTIPLE }
     private MultipleStatus multipleStatus;
 
     /**
@@ -108,7 +108,7 @@ public class PropInfo {
         }
     }
 
-    public String getString() {
+    public String getName() {
         return name;
     }
 
@@ -116,10 +116,24 @@ public class PropInfo {
         return type;
     }
 
+    public TextValue getTextValue() throws RepositoryException {
+        if (multipleStatus == MultipleStatus.MULTIPLE) {
+            throw new RepositoryException("TODO");
+        }
+        return values[0];
+    }
+
     public TextValue[] getTextValues() {
         return values;
     }
 
+    public Value getValue(Type targetType, NamePathMapper namePathMapper) throws RepositoryException
{
+        if (multipleStatus == MultipleStatus.MULTIPLE) {
+            throw new RepositoryException("TODO");
+        }
+        return values[0].getValue(targetType, namePathMapper);
+    }
+
     public Value[] getValues(Type targetType, NamePathMapper namePathMapper) throws RepositoryException
{
         Value[] va = new Value[values.length];
         for (int i = 0; i < values.length; i++) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/ProtectedItemImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/ProtectedItemImporter.java?rev=1405027&r1=1405026&r2=1405027&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/ProtectedItemImporter.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/ProtectedItemImporter.java
Fri Nov  2 16:14:53 2012
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.oak.spi.xml;
 
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 
-import org.apache.jackrabbit.api.JackrabbitSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 
@@ -45,7 +45,7 @@ public abstract interface ProtectedItemI
      * @return {@code true} if this importer was successfully initialized and
      * is able to handle an import with the given setup; {@code false} otherwise.
      */
-    boolean init(JackrabbitSession session, Root root,
+    boolean init(Session session, Root root,
                  NamePathMapper namePathMapper,
                  boolean isWorkspaceImport, int uuidBehavior,
                  ReferenceChangeTracker referenceTracker);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/TextValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/TextValue.java?rev=1405027&r1=1405026&r2=1405027&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/TextValue.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/xml/TextValue.java
Fri Nov  2 16:14:53 2012
@@ -29,6 +29,8 @@ import org.apache.jackrabbit.oak.namepat
  */
 public interface TextValue {
 
+    String getString();
+
     // TODO: review again
     Value getValue(Type targetType, NamePathMapper namePathMapper) throws ValueFormatException,
RepositoryException;
 



Mime
View raw message