You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-commits@incubator.apache.org by cl...@apache.org on 2006/01/04 21:06:44 UTC
svn commit: r365986 - in /incubator/graffito/trunk/jcr/jcr-mapping/src:
dtd/graffito-jcr-mapping.dtd
java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
Author: clombart
Date: Wed Jan 4 13:06:36 2006
New Revision: 365986
URL: http://svn.apache.org/viewcvs?rev=365986&view=rev
Log:
Apply patchs provided by Alexandru Popescu - see GRFT-82 & GRFT-83
Modified:
incubator/graffito/trunk/jcr/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd
incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd?rev=365986&r1=365985&r2=365986&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd Wed Jan 4 13:06:36 2006
@@ -1,120 +1,122 @@
-<!--
-/*
- * Copyright 2004-2005 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<!ELEMENT graffito-jcr (class-descriptor*)>
-<!--
- Class descriptor - Each class descriptor describes the mapping strategy used for one a java class
- * className : the className
- * jcrNodeType : the primary jcr node type, it can be nt:unstructured
- * jcrSuperTypes : the jcr super types, optional
--->
-<!ELEMENT class-descriptor (field-descriptor*, bean-descriptor*, collection-descriptor*)>
-
-<!ATTLIST class-descriptor
- className CDATA #REQUIRED
- jcrNodeType CDATA #IMPLIED
- jcrSuperTypes CDATA #IMPLIED>
-
-<!--
- Field descriptor - A field descriptor maps one atomic object attribute (primitive types, String, Long, ...) into a JCR property
- * fieldName : the field/attribute name
- * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr property name
- * id : specifies if the field is an id. Id is optional. If the class contains an id field, some process can run faster
- * path : specified if the fiels is the object path
- * jcrType: specifies the JCR property type (supported jcr property types: STRING, DATE, LONG, DOUBLE, BOOLEAN), optional
- * jcrAutoCreated: specifies if this JCR property will be autocreated (true/false / default is false), optional
- * jcrMandatory: specifies if this JCR property is mandatory (true/false / default is false), optional
- * jcrOnParentVersion: specifies how this JCR property acts on inherited versioned node properties (default is COPY), optional
- * jcrProtected: specifies if this JCR node property is protected (true/false / default is false), optional
- * jcrMultiple: specifies if this JCR node property is a multivalued property (true/false / default is false), optional
--->
-
-<!ELEMENT field-descriptor EMPTY>
-<!ATTLIST field-descriptor
- fieldName CDATA #REQUIRED
- jcrName CDATA #IMPLIED
- id (true | false) "false"
- path (true | false) "false"
- jcrType (String | Date | Long | Double | Boolean | Binary) #IMPLIED
- jcrAutoCreated (true | false) "false"
- jcrMandatory (true | false) "false"
- jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
- jcrProtected (true | false) "false"
- jcrMultiple (true | false) "false"
->
-
-<!--
- Bean descriptor - A bean descriptor maps one "complex" object attribute into a JCR node.
- * fieldName : the field/attribute name
- * jcrName : the jcr node name (optional). If it is not defined, fieldname is used to specify the jcr node name
- * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieved. it will be loaded when the get method is called.
- * jcrNodeType: defines the child node type, optional
- * jcrAutoCreated (boolean) default is "false"
- * jcrMandatory (boolean) default is "false"
- * jcrOnParentVersion default is "COPY"
- * jcrProtected (boolean) default is "false"
- * jcrSameNameSiblings (boolean) default is "false"
--->
-<!ELEMENT bean-descriptor EMPTY>
-<!ATTLIST bean-descriptor
- fieldName CDATA #REQUIRED
- jcrName CDATA #IMPLIED
- proxy (true | false) "false"
- jcrNodeType CDATA #IMPLIED
- jcrAutoCreated (true | false) "false"
- jcrMandatory (true | false) "false"
- jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
- jcrProtected (true | false) "false"
- jcrSameNameSiblings (true | false) "false"
->
-
-<!--
- Collection descriptor - A collection descriptor maps one object attribute based on a collection (or a map) into a series of JCR nodes.
- * fieldName : the field/attribute name (matching to the collection attribute)
- * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr node name
- * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieve. it will be loaded when the get method is called.
- * elementClassName : contains a fully qualified class name. This class is the Object type of the persistent collection elements.
- * collectionClassName : contains a fully qualified class name. This class must be the Java type of the Collection attribute.
- This attribute must only specified if the attribute type is not a java.util.Collection (or subclass).
- The declared class must implement ManageableCollection to let the persistence engine handles this type of collection.
- * collectionConverter : The class name converter. This is the collection mapping strategy to used.
- If this attribute is not specify, the default collection mapping strategy is used (DefaultCollectionConverterImpl)
- * jcrNodeType: defines the child node type, optional
- * jcrAutoCreated (boolean) default is "false"
- * jcrMandatory (boolean) default is "false"
- * jcrOnParentVersion default is "COPY"
- * jcrProtected (boolean) default is "false"
- * jcrSameNameSiblings (boolean) default is "false"
--->
-
-<!ELEMENT collection-descriptor EMPTY>
-<!ATTLIST collection-descriptor
- fieldName CDATA #REQUIRED
- jcrName CDATA #IMPLIED
- proxy (true | false) "false"
- elementClassName CDATA #REQUIRED
- collectionClassName CDATA #IMPLIED
- collectionConverter CDATA #IMPLIED
- jcrNodeType CDATA #IMPLIED
- jcrAutoCreated (true | false) "false"
- jcrMandatory (true | false) "false"
- jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
- jcrProtected (true | false) "false"
- jcrSameNameSiblings (true | false) "false"
->
+<!--
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<!ELEMENT graffito-jcr (class-descriptor*)>
+<!--
+ Class descriptor - Each class descriptor describes the mapping strategy used for one a java class
+ * className : the className
+ * jcrNodeType : the primary jcr node type, it can be nt:unstructured
+ * jcrSuperTypes : the jcr super types, optional
+-->
+<!ELEMENT class-descriptor (field-descriptor*, bean-descriptor*, collection-descriptor*)>
+
+<!ATTLIST class-descriptor
+ className CDATA #REQUIRED
+ jcrNodeType CDATA #IMPLIED
+ jcrSuperTypes CDATA #IMPLIED>
+
+<!--
+ Field descriptor - A field descriptor maps one atomic object attribute (primitive types, String, Long, ...) into a JCR property
+ * fieldName : the field/attribute name
+ * fieldType: the primitive type or fully qualified class name of the field (optional)
+ * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr property name
+ * id : specifies if the field is an id. Id is optional. If the class contains an id field, some process can run faster
+ * path : specified if the fiels is the object path
+ * jcrType: specifies the JCR property type (supported jcr property types: STRING, DATE, LONG, DOUBLE, BOOLEAN), optional
+ * jcrAutoCreated: specifies if this JCR property will be autocreated (true/false / default is false), optional
+ * jcrMandatory: specifies if this JCR property is mandatory (true/false / default is false), optional
+ * jcrOnParentVersion: specifies how this JCR property acts on inherited versioned node properties (default is COPY), optional
+ * jcrProtected: specifies if this JCR node property is protected (true/false / default is false), optional
+ * jcrMultiple: specifies if this JCR node property is a multivalued property (true/false / default is false), optional
+-->
+
+<!ELEMENT field-descriptor EMPTY>
+<!ATTLIST field-descriptor
+ fieldName CDATA #REQUIRED
+ fieldType CDATA #IMPLIED
+ jcrName CDATA #IMPLIED
+ id (true | false) "false"
+ path (true | false) "false"
+ jcrType (String | Date | Long | Double | Boolean | Binary) #IMPLIED
+ jcrAutoCreated (true | false) "false"
+ jcrMandatory (true | false) "false"
+ jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
+ jcrProtected (true | false) "false"
+ jcrMultiple (true | false) "false"
+>
+
+<!--
+ Bean descriptor - A bean descriptor maps one "complex" object attribute into a JCR node.
+ * fieldName : the field/attribute name
+ * jcrName : the jcr node name (optional). If it is not defined, fieldname is used to specify the jcr node name
+ * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieved. it will be loaded when the get method is called.
+ * jcrNodeType: defines the child node type, optional
+ * jcrAutoCreated (boolean) default is "false"
+ * jcrMandatory (boolean) default is "false"
+ * jcrOnParentVersion default is "COPY"
+ * jcrProtected (boolean) default is "false"
+ * jcrSameNameSiblings (boolean) default is "false"
+-->
+<!ELEMENT bean-descriptor EMPTY>
+<!ATTLIST bean-descriptor
+ fieldName CDATA #REQUIRED
+ jcrName CDATA #IMPLIED
+ proxy (true | false) "false"
+ jcrNodeType CDATA #IMPLIED
+ jcrAutoCreated (true | false) "false"
+ jcrMandatory (true | false) "false"
+ jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
+ jcrProtected (true | false) "false"
+ jcrSameNameSiblings (true | false) "false"
+>
+
+<!--
+ Collection descriptor - A collection descriptor maps one object attribute based on a collection (or a map) into a series of JCR nodes.
+ * fieldName : the field/attribute name (matching to the collection attribute)
+ * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr node name
+ * proxy : Use lazy loading or not. if true, this attributes is not loaded when the main object is retrieve. it will be loaded when the get method is called.
+ * elementClassName : contains a fully qualified class name. This class is the Object type of the persistent collection elements.
+ * collectionClassName : contains a fully qualified class name. This class must be the Java type of the Collection attribute.
+ This attribute must only specified if the attribute type is not a java.util.Collection (or subclass).
+ The declared class must implement ManageableCollection to let the persistence engine handles this type of collection.
+ * collectionConverter : The class name converter. This is the collection mapping strategy to used.
+ If this attribute is not specify, the default collection mapping strategy is used (DefaultCollectionConverterImpl)
+ * jcrNodeType: defines the child node type, optional
+ * jcrAutoCreated (boolean) default is "false"
+ * jcrMandatory (boolean) default is "false"
+ * jcrOnParentVersion default is "COPY"
+ * jcrProtected (boolean) default is "false"
+ * jcrSameNameSiblings (boolean) default is "false"
+-->
+
+<!ELEMENT collection-descriptor EMPTY>
+<!ATTLIST collection-descriptor
+ fieldName CDATA #REQUIRED
+ jcrName CDATA #IMPLIED
+ proxy (true | false) "false"
+ elementClassName CDATA #REQUIRED
+ collectionClassName CDATA #IMPLIED
+ collectionConverter CDATA #IMPLIED
+ jcrNodeType CDATA #IMPLIED
+ jcrAutoCreated (true | false) "false"
+ jcrMandatory (true | false) "false"
+ jcrOnParentVersion (COPY | VERSION | INITIALIZE | COMPUTE | IGNORE | ABORT) "COPY"
+ jcrProtected (true | false) "false"
+ jcrSameNameSiblings (true | false) "false"
+>
Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java?rev=365986&r1=365985&r2=365986&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java Wed Jan 4 13:06:36 2006
@@ -68,6 +68,7 @@
digester.addObjectCreate("graffito-jcr/class-descriptor/field-descriptor", FieldDescriptor.class);
digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "fieldName", "fieldName");
+ digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "fieldType", "fieldType");
digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrName", "jcrName");
digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "id", "id");
digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "path", "path");