incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r159738 - in incubator/graffito/trunk/jcr-mapping: ./ repotest/repository/meta/ repotest/repository/nodetypes/ repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/ repotest/workspaces/default/index/ src/conf/convertertest/ src/conf/repotest/ src/test/org/apache/portals/graffito/jcr/session/impl/ src/test/org/apache/portals/graffito/jcr/testconverter/ src/test/org/apache/portals/graffito/jcr/testmodel/
Date Fri, 01 Apr 2005 21:36:59 GMT
Author: clombart
Date: Fri Apr  1 13:36:57 2005
New Revision: 159738

URL: http://svn.apache.org/viewcvs?view=rev&rev=159738
Log:

* Continue to work on the jcr-mapping prototype : add a new sample converter (DocumentConverter).
Now, w* Create a new subproject : graffito commons which contains common classes used in other
Graffito projects :
- Common exception
- Common util classes

Added:
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Content.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Document.java
Removed:
    incubator/graffito/trunk/jcr-mapping/src/conf/repotest/
Modified:
    incubator/graffito/trunk/jcr-mapping/.classpath
    incubator/graffito/trunk/jcr-mapping/project.xml
    incubator/graffito/trunk/jcr-mapping/repotest/repository/meta/rep.properties
    incubator/graffito/trunk/jcr-mapping/repotest/repository/nodetypes/custom_nodetypes.xml
    incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/.node.xml
    incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/index/segments
    incubator/graffito/trunk/jcr-mapping/src/conf/convertertest/converters.xml
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/DocumentConverter.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/FolderConverter.java

Modified: incubator/graffito/trunk/jcr-mapping/.classpath
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/.classpath?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/.classpath (original)
+++ incubator/graffito/trunk/jcr-mapping/.classpath Fri Apr  1 13:36:57 2005
@@ -9,6 +9,8 @@
   </classpathentry>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
   </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/graffito/jars/graffito-commons-1.0-a1-dev.jar">
+  </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/jackrabbit/jars/jackrabbit-0.16.2-dev.jar">
   </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/concurrent/jars/concurrent-1.3.4.jar">

Modified: incubator/graffito/trunk/jcr-mapping/project.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/project.xml?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/project.xml (original)
+++ incubator/graffito/trunk/jcr-mapping/project.xml Fri Apr  1 13:36:57 2005
@@ -36,7 +36,12 @@
 
   
   <dependencies> 
-	
+
+    <dependency>  
+      <id>graffito-commons</id>
+      <groupId>graffito</groupId>
+      <version>1.0-a1-dev</version>
+    </dependency>
     <dependency>
       <groupId>jackrabbit</groupId>
       <artifactId>jackrabbit</artifactId>

Modified: incubator/graffito/trunk/jcr-mapping/repotest/repository/meta/rep.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/repotest/repository/meta/rep.properties?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/repotest/repository/meta/rep.properties (original)
+++ incubator/graffito/trunk/jcr-mapping/repotest/repository/meta/rep.properties Fri Apr 
1 13:36:57 2005
@@ -1,6 +1,6 @@
-#Wed Mar 30 10:20:11 CEST 2005
+#Fri Apr 01 23:18:30 CEST 2005
 jcr.specification.version=0.16.2
-jcr.repository.stats.nodes.count=1
+jcr.repository.stats.nodes.count=3
 query.jcrpath=true
 query.xpath.pos.index=true
 jcr.repository.version=0.16.2
@@ -13,7 +13,7 @@
 query.jcrscore=true
 option.observation.supported=true
 query.xpath.doc.order=true
-jcr.repository.stats.properties.count=41
+jcr.repository.stats.properties.count=156
 jcr.repository.vendor=Apache Software Foundation
 option.transactions.supported=true
 level.1.supported=true

Modified: incubator/graffito/trunk/jcr-mapping/repotest/repository/nodetypes/custom_nodetypes.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/repotest/repository/nodetypes/custom_nodetypes.xml?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/repotest/repository/nodetypes/custom_nodetypes.xml
(original)
+++ incubator/graffito/trunk/jcr-mapping/repotest/repository/nodetypes/custom_nodetypes.xml
Fri Apr  1 13:36:57 2005
@@ -69,6 +69,17 @@
             <supertype>nt:folder</supertype>
         </supertypes>
         <propertyDef name="graffito:description" requiredType="String" autoCreate="false"
mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>	
+        <propertyDef name="graffito:title" requiredType="String" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>	
+        <propertyDef name="graffito:lastmodified" requiredType="Date" autoCreate="false"
mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>	
+    </nodeType>    
+
+
+    <nodeType name="graffito:file"  isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+        <supertypes>
+            <supertype>nt:file</supertype>
+        </supertypes>
+        <propertyDef name="graffito:description" requiredType="String" autoCreate="false"
mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>	
+        <propertyDef name="graffito:title" requiredType="String" autoCreate="false" mandatory="true"
onParentVersion="COPY" protected="false" multiple="false"/>	
     </nodeType>    
 
 </nodeTypes>

Modified: incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/.node.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/.node.xml?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/.node.xml
(original)
+++ incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/data/cafe/babe/cafebabecafebabecafebabe/.node.xml
Fri Apr  1 13:36:57 2005
@@ -11,7 +11,9 @@
 	<nodes>
 		<node name="{http://www.jcp.org/jcr/1.0}system" uuid="deadbeef-cafe-babe-cafe-babecafebabe">
 		</node>
-		<node name="{}test" uuid="0b0d3027-7aea-4a42-8ef0-8cb5da4876fe">
+		<node name="{}test" uuid="b88a0dc1-67b4-4dff-b36d-4e5a70360cc3">
+		</node>
+		<node name="{}testdoc" uuid="36183bcf-032a-45c1-beb1-93718d1bdf93">
 		</node>
 	</nodes>
 </node>

Modified: incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/index/segments
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/repotest/workspaces/default/index/segments?view=diff&r1=159737&r2=159738
==============================================================================
Binary files - no diff available.

Modified: incubator/graffito/trunk/jcr-mapping/src/conf/convertertest/converters.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/conf/convertertest/converters.xml?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/conf/convertertest/converters.xml (original)
+++ incubator/graffito/trunk/jcr-mapping/src/conf/convertertest/converters.xml Fri Apr  1
13:36:57 2005
@@ -1,3 +1,4 @@
 <converters>	
 	<converter class="org.apache.portals.graffito.jcr.testmodel.Folder" converterClass="org.apache.portals.graffito.jcr.testconverter.FolderConverter"
/>		
+    <converter class="org.apache.portals.graffito.jcr.testmodel.Document" converterClass="org.apache.portals.graffito.jcr.testconverter.DocumentConverter"
/>			
 </converters>

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/session/impl/JcrSessionTest.java
Fri Apr  1 13:36:57 2005
@@ -30,6 +30,8 @@
 import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
 import org.apache.portals.graffito.jcr.session.JcrSession;
 import org.apache.portals.graffito.jcr.session.impl.JcrSessionImpl;
+import org.apache.portals.graffito.jcr.testmodel.Content;
+import org.apache.portals.graffito.jcr.testmodel.Document;
 import org.apache.portals.graffito.jcr.testmodel.Folder;
 
 import junit.framework.Test;
@@ -88,10 +90,10 @@
 
     /**
      * 
-     * Test for insert,update,retrieve POJO from/to jcr repository 
+     * Test for Folder object 
      *
      */
-    public void testInsertUpdateRetrieve()
+    public void testFolder()
     {
         try
         {
@@ -107,7 +109,9 @@
             Folder folder = new Folder();
             folder.setCreationDate(new Date());
             folder.setDescription("Folder description");
+            folder.setTitle("Folder Title");
             folder.setLastModified(new Date());
+            
             folder.setName("TestFolder");
             folder.setTitle("Folder Title");
 
@@ -146,8 +150,78 @@
         catch (Exception e)
         {
             e.printStackTrace();
-            fail("Unable to find the repository : " + e);
+            fail("Exception occurs during the unit test : " + e);
         }
-
     }
+    
+    /**
+     * 
+     * Test for document object 
+     *
+     */
+    public void testDocument()
+    {
+        try
+        {
+
+            if (jcrSession.itemExists("/testdoc"))
+            {
+                jcrSession.remove("/testdoc");
+            }
+
+            // --------------------------------------------------------------------------------
+            // Create and store a document in the repository
+            // --------------------------------------------------------------------------------
+            Document document = new Document();
+            document.setCreationDate(new Date());
+            document.setDescription("Document description");
+            document.setTitle("Document Title");
+            document.setLastModified(new Date());           
+            document.setName("testdoc");
+            
+            Content content = new Content();
+            content.setContent("test".getBytes());
+            document.setContentType("plain/text");
+            content.setEncoding("utf-8");
+            document.setContent(content);            
+            
+            jcrSession.insert("/testdoc", document);
+
+            // --------------------------------------------------------------------------------
+            // Check the jcr node structure
+            // --------------------------------------------------------------------------------
+            Session session = jcrSession.getSession();
+            Node documentNode = (Node) session.getItem("/testdoc");
+            assertNotNull("Document node is null", documentNode);
+            assertTrue("Incorrect primary type", documentNode.getPrimaryNodeType().getName().equals("graffito:file"));
+            assertTrue("Incorrect Name for '/testdoc'", documentNode.getName().equals("testdoc"));
+
+            Property description = documentNode.getProperty("graffito:description");
+            assertNotNull("document description  is null", description);
+            assertTrue("Incorrect description for '/testdoc'", description.getString().equals("Document
description"));
+
+            // --------------------------------------------------------------------------------
+            // Get the object
+            // --------------------------------------------------------------------------------
          
+            document = (Document) jcrSession.getObject(Document.class, "/testdoc");
+            assertNotNull("Folder object is null", document);
+            assertTrue("Incorrect description for folder object", document.getDescription().equals("Document
description"));
+
+            // --------------------------------------------------------------------------------
+            // Update the object
+            // --------------------------------------------------------------------------------
          
+            document.setDescription("new document description");
+            jcrSession.update("/testdoc", document);
+
+            assertTrue("Incorrect description for document object", ((Property) session.getItem("/testdoc/graffito:description"))
+                    .getString().equals("new document description"));
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            fail("Exception occurs during the unit test : " + e);
+        }
+
+    }    
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/DocumentConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/DocumentConverter.java?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/DocumentConverter.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/DocumentConverter.java
Fri Apr  1 13:36:57 2005
@@ -15,6 +15,10 @@
  */
 package org.apache.portals.graffito.jcr.testconverter;
 
+import java.util.Calendar;
+
+import javax.jcr.BinaryValue;
+import javax.jcr.DateValue;
 import javax.jcr.Node;
 import javax.jcr.Session;
 import javax.jcr.StringValue;
@@ -22,7 +26,11 @@
 import org.apache.portals.graffito.jcr.converter.Converter;
 import org.apache.portals.graffito.jcr.exception.JcrMappingException;
 import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
+import org.apache.portals.graffito.jcr.testmodel.Content;
+import org.apache.portals.graffito.jcr.testmodel.Document;
 import org.apache.portals.graffito.jcr.testmodel.Folder;
+import org.apache.portals.graffito.util.StreamUtil;
+import org.apache.portals.graffito.util.UriUtil;
 
 /**
  * Converter for a test folder
@@ -41,13 +49,21 @@
     {
         try 
         {
-           Folder folder = (Folder) object; 
+           Document document = (Document) object; 
            String parentPath = RepositoryUtil.getParentPath(path);
            String nodeName = RepositoryUtil.getNodeName(path);
                
            Node parentNode = (Node) session.getItem(parentPath);
-           Node folderNode = parentNode.addNode(nodeName,"graffito:folder");
-           folderNode.setProperty("graffito:description", new StringValue(folder.getDescription()));
+           Node documentNode = parentNode.addNode(nodeName,"graffito:file");
+           documentNode.setProperty("graffito:description", new StringValue(document.getDescription()));
          
+           documentNode.setProperty("graffito:title", new StringValue(document.getTitle()));
          
+           
+           Node contentNode = documentNode.addNode("jcr:content", "nt:resource");       
  
+           contentNode.setProperty("jcr:encoding", document.getContent().getEncoding());
+           contentNode.setProperty("jcr:mimeType", document.getContentType());
+           contentNode.setProperty("jcr:data", new BinaryValue(document.getContent().getContentByte()));
+           contentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
+           
            parentNode.save();
             
         }
@@ -62,15 +78,25 @@
      * 
      * @see org.apache.portals.graffito.jcr.converter.Converter#update(javax.jcr.Session,
java.lang.String, java.lang.Object)
      */
+    
     public void update(Session session, String path, Object object) throws JcrMappingException
     {
         try 
         {
-           Folder folder = (Folder) object; 
-           Node folderNode = (Node) session.getItem(path);               
-           folderNode.setProperty("graffito:description", new StringValue(folder.getDescription()));
+           Document document = (Document) object; 
+           Node documentNode = (Node) session.getItem(path);               
+           
+           documentNode.setProperty("graffito:description", new StringValue(document.getDescription()));
          
+           documentNode.setProperty("graffito:title", new StringValue(document.getTitle()));
          
            
-           folderNode.save();
+           Node contentNode = documentNode.getNode("jcr:content");
+           contentNode.setProperty("jcr:encoding", document.getContent().getEncoding());
+           contentNode.setProperty("jcr:mimeType", document.getContentType());
+           contentNode.setProperty("jcr:data", new BinaryValue(document.getContent().getContentByte()));
+           contentNode.setProperty("jcr:lastModified", new DateValue(Calendar.getInstance()));
+           
+           
+           documentNode.save();
             
         }
         catch(Exception e)
@@ -88,12 +114,23 @@
     {
         try 
         {
-           Folder folder = new Folder(); 
+           Document document = new Document();
+           Content content = new Content();
                
-           Node folderNode = (Node) session.getItem(path);
-           folder.setDescription(folderNode.getProperty("graffito:description").getString());
-           folder.setCreationDate(folderNode.getProperty("jcr:created").getDate().getTime());
-           return folder;
+           Node documentNode = (Node) session.getItem(path);
+           document.setDescription(documentNode.getProperty("graffito:description").getString());
+           document.setTitle(documentNode.getProperty("graffito:title").getString());
+           document.setCreationDate(documentNode.getProperty("jcr:created").getDate().getTime());
+           
+           Node contentNode = documentNode.getNode("jcr:content");
+           document.setContentType(contentNode.getProperty("jcr:mimeType").getString());
+           document.setLastModified(contentNode.getProperty("jcr:lastModified").getDate().getTime());
+           document.setName(documentNode.getName());
+           
+           content.setEncoding(contentNode.getProperty("jcr:encoding").getString());    
      
+           content.setContent(StreamUtil.getContentByte(contentNode.getProperty("jcr:data").getStream()));
+           document.setContent(content);
+           return document;
            
             
         }

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/FolderConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/FolderConverter.java?view=diff&r1=159737&r2=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/FolderConverter.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testconverter/FolderConverter.java
Fri Apr  1 13:36:57 2005
@@ -15,6 +15,9 @@
  */
 package org.apache.portals.graffito.jcr.testconverter;
 
+import java.util.Calendar;
+
+import javax.jcr.DateValue;
 import javax.jcr.Node;
 import javax.jcr.Session;
 import javax.jcr.StringValue;
@@ -47,7 +50,13 @@
                
            Node parentNode = (Node) session.getItem(parentPath);
            Node folderNode = parentNode.addNode(nodeName,"graffito:folder");
-           folderNode.setProperty("graffito:description", new StringValue(folder.getDescription()));
+           folderNode.setProperty("graffito:description", new StringValue(folder.getDescription()));
          
+           folderNode.setProperty("graffito:title", new StringValue(folder.getTitle()));
+           
+           Calendar calendar = Calendar.getInstance();
+           calendar.setTime(folder.getLastModified());
+           folderNode.setProperty("graffito:lastmodified", new DateValue(calendar));
+           
            parentNode.save();
             
         }
@@ -69,6 +78,11 @@
            Folder folder = (Folder) object; 
            Node folderNode = (Node) session.getItem(path);               
            folderNode.setProperty("graffito:description", new StringValue(folder.getDescription()));
+           folderNode.setProperty("graffito:title", new StringValue(folder.getTitle()));
+           
+           Calendar calendar = Calendar.getInstance();
+           calendar.setTime(folder.getLastModified());
+           folderNode.setProperty("graffito:lastmodified", new DateValue(calendar));
            
            folderNode.save();
             
@@ -91,8 +105,11 @@
            Folder folder = new Folder(); 
                
            Node folderNode = (Node) session.getItem(path);
-           folder.setDescription(folderNode.getProperty("graffito:description").getString());
+           folder.setName(folderNode.getName());
+           folder.setDescription(folderNode.getProperty("graffito:description").getString());
  
+           folder.setTitle(folderNode.getProperty("graffito:title").getString());
            folder.setCreationDate(folderNode.getProperty("jcr:created").getDate().getTime());
+           folder.setLastModified(folderNode.getProperty("graffito:lastmodified").getDate().getTime());
            return folder;
            
             

Added: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Content.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Content.java?view=auto&rev=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Content.java
(added)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Content.java
Fri Apr  1 13:36:57 2005
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+package org.apache.portals.graffito.jcr.testmodel;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import java.io.UnsupportedEncodingException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+
+/**
+ * Content object
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ */
+public class Content 
+{
+    protected final static Log log = LogFactory.getLog(Content.class);
+  
+    protected Long contentId;    
+   
+    protected byte[] content;
+    
+    protected String encoding;
+
+
+    /**
+     * @return Returns the content.
+     */
+    public InputStream getContentStream()
+    {
+        return new ByteArrayInputStream(content);        
+    }
+
+    /**
+     * @return Returns the content.
+     */
+    public byte[] getContentByte()
+    {
+        
+        return content;
+    }
+
+
+    /**
+     * @param stream The content to set.
+     */
+    public void setContent(byte[] stream)
+    {
+        
+        content = stream;
+
+    }
+        
+    /**
+     * @return Returns the encoding.
+     */
+    public String getEncoding()
+    {
+        return encoding;
+    }
+    
+    /**
+     * @param encoding The encoding to set.
+     */
+    public void setEncoding(String encoding)
+    {
+        this.encoding = encoding;
+    }
+}
+
+

Added: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Document.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Document.java?view=auto&rev=159738
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Document.java
(added)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Document.java
Fri Apr  1 13:36:57 2005
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * 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.
+ */
+package org.apache.portals.graffito.jcr.testmodel;
+
+
+import java.util.*;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * CMS VersionnedDocument implementation.
+ *
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * 
+ */
+public class Document extends CmsObject
+{
+    protected final static Log log =  LogFactory.getLog(Document.class);
+    
+    protected long size;
+    protected String contentType;   
+        
+    protected Content content;
+
+
+    /** 
+     * @see org.apache.portals.graffito.model.Document#getContentType()
+     */
+    public String getContentType()
+    {
+        return this.contentType;
+    }
+
+    /**
+     * @see org.apache.portals.graffito.model.Document#setContentType(java.lang.String)
+     */
+    public void setContentType(String contentType)
+    {
+        this.contentType = contentType;
+    }
+
+
+    /**
+     * 
+     * @see org.apache.portals.graffito.model.Document#getSize()
+     */
+    public long getSize()
+    {
+        return size;
+    }
+
+    /**
+     * 
+     * @see org.apache.portals.graffito.model.Document#setSize(long)
+     */
+    public void setSize(long size)
+    {
+        this.size = size;
+    }
+
+    
+    public Content getContent()
+    {
+        return content;
+    }
+    public void setContent(Content content)
+    {
+        this.content = content;
+    }
+}
+



Mime
View raw message