stefan      2004/06/30 07:39:25

  Modified:    proposals/jcrri/src/org/apache/slide/jcr/core/nodetype
                        ChildNodeDef.java ItemDef.java PropDef.java
  Removed:     proposals/jcrri/src/org/apache/slide/jcr/core/nodetype
                        nodetypes.xml
  Log:
  jcrri
  
  Revision  Changes    Path
  1.5       +3 -64     
jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/ChildNodeDef.java
  
  Index: ChildNodeDef.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/ChildNodeDef.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ChildNodeDef.java 29 Jun 2004 17:11:47 -0000      1.4
  +++ ChildNodeDef.java 30 Jun 2004 14:39:24 -0000      1.5
  @@ -24,10 +24,6 @@
   package org.apache.slide.jcr.core.nodetype;
   
   import org.apache.slide.jcr.core.QName;
  -import org.apache.slide.jcr.core.NamespaceResolver;
  -
  -import javax.jcr.*;
  -import javax.jcr.version.OnParentVersionAction;
   
   /**
    * A <code>ChildNodeDef</code> ...
  @@ -48,57 +44,6 @@
       }
   
       /**
  -     * Create a new <code>ChildNodeDef</code> and set definitions from the nodes
  -     * properties.
  -     * @param childNodeDef
  -     * @throws RepositoryException
  -     * @throws IllegalArgumentException if the given node is <code>null</code>
  -     * or not of type nt:childNodeDef.
  -     */
  -    public ChildNodeDef(Node childNodeDef, QName declaringNodeType, 
NamespaceResolver nsResolver)
  -     throws RepositoryException {
  -
  -        if (childNodeDef == null || !childNodeDef.isNodeType("nt:childNodeDef")) {
  -         throw new IllegalArgumentException("ChildNodeDef creation requires node of 
type nt:childNodeDef.");
  -     }
  -
  -     setDeclaringNodeType(declaringNodeType);
  -     Value nameVal = childNodeDef.getProperty("jcr:name").getValue();
  -     if (nameVal != null && !nameVal.getString().equals("")) {
  -         this.setName(QName.fromJCRName(nameVal.getString(), nsResolver));
  -     }
  -     setAutoCreate(childNodeDef.getProperty("jcr:autoCreate").getBoolean());
  -     setMandatory(childNodeDef.getProperty("jcr:mandatory").getBoolean());
  -     Property onVersion = childNodeDef.getProperty("jcr:onParentVersion");
  -     if (onVersion.hasValue()) {
  -         
setOnParentVersion(OnParentVersionAction.valueFromName(onVersion.getString()));
  -     }
  -     this.setPrimaryItem(childNodeDef.getProperty("jcr:primaryItem").getBoolean());
  -     this.setProtected(childNodeDef.getProperty("jcr:protected").getBoolean());
  -
  -     // child def specific values
  -     
this.setAllowSameNameSibs(childNodeDef.getProperty("jcr:sameNameSibs").getBoolean());
  -
  -     Property defaultPrimaryType = 
childNodeDef.getProperty("jcr:defaultPrimaryType");
  -     if (defaultPrimaryType.hasValue()) {
  -         String dpt = defaultPrimaryType.getString();
  -         if (!dpt.equals("")) {
  -             setDefaultPrimaryType(QName.fromJCRName(dpt, nsResolver));
  -         }
  -     }
  -     Property rptProp = childNodeDef.getProperty("jcr:requiredPrimaryTypes");
  -     if (rptProp.hasValue()) {
  -         Value[] values = rptProp.getValues();
  -         QName[] requiredPrimaryTypes = new QName[values.length];
  -         for (int i = 0; i < values.length; i++) {
  -             requiredPrimaryTypes[i] = QName.fromJCRName(values[i].getString(), 
nsResolver);
  -         }
  -         setRequiredPrimaryTypes(requiredPrimaryTypes);
  -     }
  -    }
  -
  -    /**
  -     *
        * @param defaultNodeType
        */
       public void setDefaultPrimaryType(QName defaultNodeType) {
  @@ -106,7 +51,6 @@
       }
   
       /**
  -     *
        * @param requiredPrimaryTypes
        */
       public void setRequiredPrimaryTypes(QName[] requiredPrimaryTypes) {
  @@ -114,7 +58,6 @@
       }
   
       /**
  -     *
        * @param allowSameNameSibs
        */
       public void setAllowSameNameSibs(boolean allowSameNameSibs) {
  @@ -122,7 +65,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public QName getDefaultPrimaryType() {
  @@ -130,7 +72,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public QName[] getRequiredPrimaryTypes() {
  @@ -138,7 +79,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public boolean allowSameNameSibs() {
  @@ -146,10 +86,9 @@
       }
   
       /**
  -     *
        * @return
        */
  -    boolean definesNode() {
  +    public boolean definesNode() {
        return true;
       }
   }
  
  
  
  1.4       +10 -10    
jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/ItemDef.java
  
  Index: ItemDef.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/ItemDef.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ItemDef.java      22 Jun 2004 18:02:48 -0000      1.3
  +++ ItemDef.java      30 Jun 2004 14:39:24 -0000      1.4
  @@ -50,31 +50,31 @@
        return super.clone();
       }
   
  -    void setDeclaringNodeType(QName declaringNodeType) {
  +    public void setDeclaringNodeType(QName declaringNodeType) {
        this.declaringNodeType = declaringNodeType;
       }
   
  -    void setName(QName name) {
  +    public void setName(QName name) {
        this.name = name;
       }
   
  -    void setAutoCreate(boolean autoCreate) {
  +    public void setAutoCreate(boolean autoCreate) {
        this.autoCreate = autoCreate;
       }
   
  -    void setOnParentVersion(int onParentVersion) {
  +    public void setOnParentVersion(int onParentVersion) {
        this.onParentVersion = onParentVersion;
       }
   
  -    void setProtected(boolean writeProtected) {
  +    public void setProtected(boolean writeProtected) {
        this.writeProtected = writeProtected;
       }
   
  -    void setMandatory(boolean mandatory) {
  +    public void setMandatory(boolean mandatory) {
        this.mandatory = mandatory;
       }
   
  -    void setPrimaryItem(boolean primaryItem) {
  +    public void setPrimaryItem(boolean primaryItem) {
        this.primaryItem = primaryItem;
       }
   
  @@ -106,5 +106,5 @@
        return primaryItem;
       }
   
  -    abstract boolean definesNode();
  +    public abstract boolean definesNode();
   }
  
  
  
  1.5       +4 -75     
jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/PropDef.java
  
  Index: PropDef.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/nodetype/PropDef.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PropDef.java      29 Jun 2004 17:11:47 -0000      1.4
  +++ PropDef.java      30 Jun 2004 14:39:24 -0000      1.5
  @@ -23,10 +23,9 @@
    */
   package org.apache.slide.jcr.core.nodetype;
   
  -import org.apache.slide.jcr.core.*;
  +import org.apache.slide.jcr.core.InternalValue;
   
  -import javax.jcr.*;
  -import javax.jcr.version.OnParentVersionAction;
  +import javax.jcr.PropertyType;
   
   /**
    * A <code>PropDef</code> ...
  @@ -48,68 +47,6 @@
       }
   
       /**
  -     * Create a new <code>PropDef</code> and set definitions from the nodes
  -     * properties.
  -     * @param propertyDef
  -     * @param declaringNodeType
  -     * @param nsResolver
  -     * @throws RepositoryException
  -     * @throws InvalidConstraintException
  -     * @throws IllegalArgumentException if the given node is not of type 
nt:propertyDef
  -     */
  -    public PropDef(Node propertyDef, QName declaringNodeType, NamespaceResolver 
nsResolver)
  -     throws RepositoryException, InvalidConstraintException {
  -
  -     if (propertyDef == null || !propertyDef.isNodeType("nt:propertyDef")) {
  -         throw new IllegalArgumentException("PropDef creation requires node of type 
nt:propertyDef.");
  -     }
  -
  -     setDeclaringNodeType(declaringNodeType);
  -     Value nameVal = propertyDef.getProperty("jcr:name").getValue();
  -     if (nameVal != null && !nameVal.getString().equals("")) {
  -         setName(QName.fromJCRName(nameVal.getString(), nsResolver));
  -     }
  -     setAutoCreate(propertyDef.getProperty("jcr:autoCreate").getBoolean());
  -     setMandatory(propertyDef.getProperty("jcr:mandatory").getBoolean());
  -     Property onVersion = propertyDef.getProperty("jcr:onParentVersion");
  -     if (onVersion.hasValue()) {
  -         
setOnParentVersion(OnParentVersionAction.valueFromName(onVersion.getString()));
  -     }
  -     setPrimaryItem(propertyDef.getProperty("jcr:primaryItem").getBoolean());
  -     setProtected(propertyDef.getProperty("jcr:protected").getBoolean());
  -
  -     // propdef specific values
  -     // multiple value property
  -     setMultiple(propertyDef.getProperty("jcr:multiple").getBoolean());
  -
  -     // required property type
  -     int type = PropertyType.UNDEFINED;
  -     Property typeProp = propertyDef.getProperty("jcr:type");
  -     if (typeProp.hasValue()) {
  -         type = PropertyType.valueFromName(typeProp.getString());
  -     }
  -     setRequiredType(type);
  -
  -     // constraint
  -     Property constr = propertyDef.getProperty("jcr:valueConstraint");
  -     if (constr.hasValue()) {
  -         String c = constr.getString();
  -         if (!c.equals("")) {
  -             setValueConstraint(ValueConstraint.create(type, c));
  -         }
  -     }
  -
  -     // default value
  -     Property defValue = propertyDef.getProperty("jcr:defaultValue");
  -     if (defValue.hasValue() && !defValue.getString().equals("")) {
  -         int defValType = (type == PropertyType.UNDEFINED) ? PropertyType.STRING : 
type;
  -         InternalValue defVal = InternalValue.valueOf(defValue.getString(), 
defValType);
  -         setDefaultValue(defVal);
  -     }
  -    }
  -
  -    /**
  -     *
        * @param requiredType
        */
       public void setRequiredType(int requiredType) {
  @@ -117,7 +54,6 @@
       }
   
       /**
  -     *
        * @param valueConstraint
        */
       public void setValueConstraint(ValueConstraint valueConstraint) {
  @@ -125,7 +61,6 @@
       }
   
       /**
  -     *
        * @param defaultValue
        */
       public void setDefaultValue(InternalValue defaultValue) {
  @@ -133,7 +68,6 @@
       }
   
       /**
  -     *
        * @param multiple
        */
       public void setMultiple(boolean multiple) {
  @@ -141,7 +75,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public int getRequiredType() {
  @@ -149,7 +82,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public ValueConstraint getValueConstraint() {
  @@ -157,7 +89,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public InternalValue getDefaultValue() {
  @@ -165,7 +96,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public boolean isMultiple() {
  @@ -173,7 +103,6 @@
       }
   
       /**
  -     *
        * @return
        */
       public boolean definesNode() {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to