incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r375122 - in /incubator/graffito/trunk/jcr/jcr-mapping/xdocs: atomic-strategy.xml bean-strategy.xml engine-introduction.xml index.xml introduction-strategies.xml navigation.xml
Date Sun, 05 Feb 2006 22:38:40 GMT
Author: clombart
Date: Sun Feb  5 14:38:38 2006
New Revision: 375122

URL: http://svn.apache.org/viewcvs?rev=375122&view=rev
Log:
Still working on the documentation

Modified:
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/atomic-strategy.xml
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/bean-strategy.xml
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/engine-introduction.xml
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/index.xml
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/introduction-strategies.xml
    incubator/graffito/trunk/jcr/jcr-mapping/xdocs/navigation.xml

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/atomic-strategy.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/atomic-strategy.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/atomic-strategy.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/atomic-strategy.xml Sun Feb  5 14:38:38
2006
@@ -24,21 +24,72 @@
 				
 		<section name="Mapping Atomic Fields">
 			<subsection name="Introduction">
-				<p>The field-descriptor maps a bean attribute into one JCR property. it can map
any kind of atomic types (java primitive data types and their wrapper classes)</p> 
-				<p>Based on our model defined <a href="introduction-strategies.html">here</a>,
the following field-descriptor is used to map the bean field "title" into the JCR property
"graffito:title".</p>
-				<source><![CDATA[ 				
-<field-descriptor fieldName="title" jcrName="graffito:title" />	
+				<p>The field-descriptor maps a bean attribute into one JCR property. it can map
any kind of atomic types (java primitive data types and their wrapper classes).</p>

+				<p>Based on our model defined <a href="introduction-strategies.html">here</a>,
the following field-descriptor can be used in the class 'PageInfo' to map the bean field "title"
(String type) into the JCR property "graffito:title".</p>
+				<source><![CDATA[ 
+<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.PageInfo" jcrNodeType="graffito:PageInfo">
+	<field-descriptor fieldName="title" jcrName="graffito:title" />	
+	.... other descriptors ....
+</class-descriptor>	
 				]]></source>
+				<p>It is not necessary to specify the type in the field-descriptor. The Persistence
Manager uses the java introspection to get information on the each atomic field.</p>
 				
 			</subsection>
 			<subsection name ="Supported Types">
+				
+				<table>
+					<tr>
+						<th>Java Type</th>
+						<th>Jcr Type</th>
+					</tr>
+					<tr>
+						<td>String</td>
+						<td>STRING</td>
+					</tr>
+					<tr>
+						<td>Boolean, boolean</td>
+						<td>BOOLEAN</td>
+					</tr>
+					<tr>
+						<td>Double, double</td>
+						<td>DOUBLE</td>
+					</tr>
+					<tr>
+						<td>Integer, int</td>
+						<td>DOUBLE</td>
+					</tr>
+					<tr>
+						<td>Long, long</td>
+						<td>LONG</td>
+					</tr>
+					<tr>
+						<td>byte[]</td>
+						<td>BINARY</td>
+					</tr>
+					
+					<tr>
+						<td>java.io.InputStream</td>
+						<td>BINALRY</td>
+					</tr>
+					
+					<tr>
+						<td>java.util.Calendar</td>
+						<td>LONG (corresponding to Calendar.getTimeInMillis()</td>
+					</tr>
+
+					<tr>
+						<td>java.sql.Timestamp</td>
+						<td>LONG (corresponding to Timestamp.getTime()</td>
+					</tr>					
+					<tr>
+						<td>java.util.Date</td>
+						<td>LONG (corresponding to java.util.Date.getTime()</td>
+					</tr>										
+					
+				</table>	
 				<p>
-				[TO DO]				
-				</p>
-			</subsection>
-			<subsection name ="Build you own Atomic Type Converter">
-				<p>
-				[TO DO]	
+					Due to some issues with Jackrabbit,  Calendar, Timestamp and date are converted into
JCR LONG.
+					We plan to add other converters for those types in the next release. We plan also to
support other java types (char, ...) 
 				</p>
 			</subsection>
 			

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/bean-strategy.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/bean-strategy.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/bean-strategy.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/bean-strategy.xml Sun Feb  5 14:38:38 2006
@@ -23,8 +23,47 @@
 	<body>
 				
 		<section name="Mapping Bean Fields">
-			TODO
+			<subsection name="Introduction">
+				<p>The bean-descriptor maps a bean attribute into one JCR node. Generally, this
bean attribute is a also a bean.</p>
+				<p>Based on our model defined <a href="introduction-strategies.html">here</a>,
the following bean-descriptor is used to map the bean field "pageInfo" (PageInfo class) into
the JCR node called "pageInfo".</p>
+
+				<source><![CDATA[ 				
+<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Page" jcrNodeType="graffito:page">
+	<bean-descriptor fieldName="pageInfo" jcrName="pageInfo" />
+	<!-- other field, bean and collection mapping here !-->
+</class-descriptor>
+									
+<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.PageInfo" jcrNodeType="graffito:PageInfo">
+	<field-descriptor fieldName="path" path="true" />
+	<field-descriptor fieldName="title" jcrName="graffito:title"/>
+	<field-descriptor fieldName="description" jcrName="graffito:description"/>
+</class-descriptor>
+									
+				]]></source>
 				
+				<p>In this example, the PageInfo class has a corresponding class-descriptor in
the mapping file. 
+				   By this way, the Persistence Manager can map each PageInfo attributes.
+				   It is not necessary to specify the type in the bean-descriptor. The Persistence Manager
uses the java introspection to get information on the each bean fields.</p>
+
+			</subsection>
+			
+			<subsection name ="Result in the JCR repository">
+				<p>
+					Following our example, the resulting JCR structure can be : 		
+				</p>
+				<p>
+					<source><![CDATA[ 
+/mysite/page1	
+  /mysite/page1/pageInfo
+       graffito:title = "This is my page title"
+       graffito:description = "This is my page description"
+  ... other subnodes for page1 ... 
+							  ]]></source>		  
+				</p>						
+				<p>Creating a subnode like this example (mysite/page1/pageInfo) is the default
behaviour. See the section <a href="component-strategy.html">Reviewing the bean-descriptor</a>
to get other bean-field mapping strategies.</p>
+				
+			
+			</subsection>
 		</section>
 	</body>
 </document>

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/engine-introduction.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/engine-introduction.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/engine-introduction.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/engine-introduction.xml Sun Feb  5 14:38:38
2006
@@ -22,10 +22,7 @@
 	</properties>
 	<body>
 		<section name="The Persistence Manager">
-			<p>The main component in our framework is the Persistence manager. It converts an
object graph into JCR nodes and properties and vice versa.</p>
-			<subsection name="The API Overview">
-			 	<p>ADD API overview here</p>
-			</subsection>	
+			<p>The main component in our framework is the Persistence manager. It converts an
object graph into JCR nodes and properties and vice versa.</p>	
 			
 			<subsection name="How the Persistence Manager is working ?">
 				
@@ -49,6 +46,10 @@
 					Of course, all those "mapping types" imply different mapping algorithms.See the "Mapping
Strategies" section to get more information on the descriptor file.
 				</p>				
 			</subsection>
+			
+			<subsection name="The API Overview">
+				<p>[TO DO]</p>
+			</subsection>			
 						
 		</section>
 	</body>

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/index.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/index.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/index.xml Sun Feb  5 14:38:38 2006
@@ -25,7 +25,7 @@
 			<subsection name="Object/Content Mapping framework (ocm)">
 				<p>This Graffito subproject is an object/JCR persistence and query service. This
tools lets you to persist java objects into a JCR compliant repository - including association,
inheritance, polymorphism, composition, and the Java collections framework. Furthermore, this
jcr-mapping allows you to express queries in Java-based Criteria, as well as in JCR query
language.</p> 
 				
-				<p>In order to easily support the JCR specification, any content application managing
an high level object model can use this framework. For example, a classic Forum application
contains objets like "Forum", "Topic" and "Post". Now these data objects (pojo) can be managed
by our JCR mapping tools in order to persist them into a JCR compliant repository.</p>

+				<p>In order to easily support the JCR specification, any content application managing
an high level object model can use this framework. For example, a classic Forum application
contains objets like "Forum", "Topic" and "Post". Now, the data objects (pojo) can be managed
by our JCR mapping tools in order to persist them into a JCR compliant repository.</p>

 				
 				
 			</subsection>
@@ -37,12 +37,12 @@
 			</subsection>
 			<subsection name ="Preriquise">
 				<p>
-					Before using this JCR framework, you should review the JCR specication and implementation
like <a   href="http://incubator.apache.org/jackrabbit/">JackRabbit</a>. 
+					Before using this JCR framework, you should review the JCR specication and implementations
like <a   href="http://incubator.apache.org/jackrabbit/">JackRabbit</a>. 
 				</p>
 				
 			</subsection>
 			<subsection name="Download">
-				<p>There are no releases yet. See the menu 'Build a new application" for instructions
on how to download and build the Graffito JCR mapping sources.</p>	
+				<p>There are no releases yet. See the menu "Getting Started" for instructions on
how to download and build the Graffito JCR mapping sources.</p>	
 			</subsection>
 		</section>
 	</body>

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/introduction-strategies.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/introduction-strategies.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/introduction-strategies.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/introduction-strategies.xml Sun Feb  5
14:38:38 2006
@@ -24,7 +24,7 @@
 		<section name="Introduction to the Mapping Strategies">
 						
 			<p>
-				We are calling "Mapping strategies" the algorithm used to map bean fields into JCR nodes
and/or properties.
+				We are calling "Mapping strategy" the algorithm used by the Persistence Manager to map
a bean into JCR nodes and/or properties.
 				
 			</p>
 			
@@ -35,10 +35,10 @@
 					<li>The PageInfo class contains the title and the page description. We are using
the pageInfo here to see all mapping features (see the bean-descriptors). In real application,
this class is not necessary :-)</li>
 					<li>Each paragraph contains a path and a text field.</li>
 				</ul>	
-				<p><img src="./images/sample-model-doc.png"  align="center"></img></p>
+				<p align="center"> <img src="./images/sample-model-doc.png" ></img></p>
 			</p>	
 			<p>
-				This object model could be too simple for real applications and it is uses here just
to simplify the description of the different mapping strategies. 
+				This object model could be too simple for real applications and it is used here just
to simplify the description of the different mapping strategies. 
 			</p>	
 			<p>Based on that object model, we can define the following java classes :</p>
 			
@@ -83,10 +83,9 @@
 			</source>	
 			
 			
-			<p>
-				... and the class-descriptors can be : 	
-			</p>	
-			
+			<subsection name="The Class descriptor">
+				<p>When you decide to map a bean class, you have to create a new class descriptor
entry in the Persistence Manager descriptor file.</p>			
+				<p>Here are the class-descriptors required to map the classes Page, PageInfo and
Paragraph :</p>
 			<source><![CDATA[ 				
 <class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Page" jcrNodeType="graffito:page">
 	<field-descriptor fieldName="path" path="true" />
@@ -126,9 +125,8 @@
 			<p>It is possible to have another kind of jcr structure by using other mapping strategies.
You can see the section "Advance Mapping strategies" to get more information on that.</p>
 			
 			
-			<subsection name="The Class descriptor">
-				<p>When you decide to map a bean class, you have to create a new class descriptor
entry in the Persistence Manager descriptor file.</p>
-				<p>Here is a basic class descriptor example : </p>
+
+				<p>Now, let's go back to the class-descriptor.</p>
 				<source><![CDATA[ 
 <class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Paragraph" jcrNodeType="nt:unstructured">
 	<field-descriptor fieldName="path" path="true" />
@@ -139,7 +137,7 @@
 				<p>This class descriptor maps the class "org.apache.portals.graffito.jcr.testmodel.Paragraph"
to the JCR type "nt:unstructured". Each field-descriptors maps one bean attribute to a JCR
property. You can find more information on the field-descriptors in the page <a href="atomic-strategy.html">Mapping
Atomic fields</a>. 
 				</p>	
 				<p>
-					It is also possible to map a bean class to a specific JCR custom node type. The following
class-descriptor map the class "org.apache.portals.graffito.jcr.testmodel.Paragraph" to the
node type "graffito:paragraph".	
+					It is also possible to map a bean class to a specific JCR node type. The following class-descriptor
map the class "org.apache.portals.graffito.jcr.testmodel.Paragraph" to the node type "graffito:paragraph".

 				</p>
 				<source><![CDATA[ 				
 <class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Paragraph" jcrNodeType="graffito:paragraph">
@@ -164,7 +162,8 @@
 			    mandatory="true" onParentVersion="COPY" protected="false" multiple="false" />
 </nodeType>
 				]]></source>
-				<p>We are currently building a node type management tools which can import the
node types from the class-descriptors.</p>
+				<p>
+					Of course, node types "Graffito:Page" and "Graffito:PageInfo" are alse required. 		
	We are currently building a node type management tools which can import the node types from
the class-descriptors.</p>
 			</subsection>
 			<subsection name ="The path Field">
 				<p>

Modified: incubator/graffito/trunk/jcr/jcr-mapping/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/xdocs/navigation.xml?rev=375122&r1=375121&r2=375122&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/xdocs/navigation.xml (original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/xdocs/navigation.xml Sun Feb  5 14:38:38 2006
@@ -50,7 +50,7 @@
 			<item name="Introduction" href="introduction-advanced-strategies.html"/>
 			<item name="Inheritance" href="inheritance-strategy.html"/>
 			<item name="Reviewing the bean-descriptor" href="component-strategy.html"/>				
	
-			<item name="Reviewing the collection-descriptor" href="collection-strategy.html"/>
+			
 			<item name="Adding Extra JCR Nodes" href="extra-nodes-strategy.html"/>
 			
 			



Mime
View raw message