james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r952601 - in /james/imap/trunk/jcr/src/main: java/org/apache/james/imap/jcr/mail/ java/org/apache/james/imap/jcr/mail/model/ java/org/apache/james/imap/jcr/user/ resources/org/apache/james/imap/jcr/
Date Tue, 08 Jun 2010 10:40:43 GMT
Author: norman
Date: Tue Jun  8 10:40:43 2010
New Revision: 952601

URL: http://svn.apache.org/viewvc?rev=952601&view=rev
Log:
Use mixins for node types. (IMAP-152). Thx to Ian Boston for the patch..

Modified:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
    james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java?rev=952601&r1=952600&r2=952601&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
Tue Jun  8 10:40:43 2010
@@ -255,10 +255,11 @@ public class JCRMailboxMapper extends Ab
                         for (int i = 0; i < nameParts.length; i++) {
                            String part = nameParts[i];
                            if (i == 1) {
-                               node = JcrUtils.getOrAddNode(node, String.valueOf(part.charAt(0)),
"jamesMailbox:mailbox");   
+                               node = JcrUtils.getOrAddNode(node, String.valueOf(part.charAt(0)),
"nt:unstructured");   
 
                            } 
-                           node = JcrUtils.getOrAddNode(node, part, "jamesMailbox:mailbox");
  
+                           node = JcrUtils.getOrAddNode(node, part, "nt:unstructured");
+                           node.addMixin("jamesMailbox:mailbox");
                            
                         }
                         jcrMailbox.merge(node);

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java?rev=952601&r1=952600&r2=952601&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
Tue Jun  8 10:40:43 2010
@@ -450,7 +450,8 @@ public class JCRMessageMapper extends Ab
                 locker.execute(new NodeLockedExecution<Void>() {
 
                     public Void execute(Node node) throws RepositoryException {
-                        Node messageNode = node.addNode(String.valueOf(membership.getUid()),"jamesMailbox:message");
+                        Node messageNode = node.addNode(String.valueOf(membership.getUid()),"nt:file");
+                        messageNode.addMixin("jamesMailbox:message");
                         try {
                             membership.merge(messageNode);
                         } catch (IOException e) {

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java?rev=952601&r1=952600&r2=952601&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
Tue Jun  8 10:40:43 2010
@@ -362,7 +362,8 @@ public class JCRMessage extends Abstract
         // add headers to the message again
         for (int i = 0; i < newHeaders.size(); i++) {
             JCRHeader header = (JCRHeader) newHeaders.get(i);
-            Node headerNode = node.addNode("messageHeader", HEADER_NODE_TYPE);
+            Node headerNode = node.addNode("messageHeader", "nt:unstructured");
+            headerNode.addMixin(HEADER_NODE_TYPE);
             header.merge(headerNode);
         }
       
@@ -381,7 +382,8 @@ public class JCRMessage extends Abstract
         // store new properties
         for (int i = 0; i < newProperites.size(); i++) {
             JCRProperty prop = (JCRProperty)newProperites.get(i);
-            Node propNode = node.addNode("messageProperty", PROPERTY_NODE_TYPE);
+            Node propNode = node.addNode("messageProperty", "nt:unstructured");
+            propNode.addMixin(PROPERTY_NODE_TYPE);
             prop.merge(propNode);
         }
       

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java?rev=952601&r1=952600&r2=952601&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
Tue Jun  8 10:40:43 2010
@@ -159,7 +159,8 @@ public class JCRSubscriptionMapper exten
                 // This is needed to minimize the child nodes a bit
                 Node userNode = JcrUtils.getOrAddNode(subscriptionsNode, String.valueOf(username.charAt(0)));
                 userNode = JcrUtils.getOrAddNode(userNode, String.valueOf(username));
-                node = JcrUtils.getOrAddNode(userNode, mailbox, "jamesMailbox:subscription");
+                node = JcrUtils.getOrAddNode(userNode, mailbox, "nt:unstructured");
+                node.addMixin("jamesMailbox:subscription");
             } else {
                 node = sub.getNode();
             }

Modified: james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd?rev=952601&r1=952600&r2=952601&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd (original)
+++ james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd Tue Jun  8
10:40:43 2010
@@ -17,22 +17,26 @@
 
 <jamesMailbox = 'http://james.apache.org/imap/jcr/'>
 
-[jamesMailbox:subscription] > nt:base
+[jamesMailbox:subscription] > mix:created
+    mixin
     - jamesMailbox:subscriptionUsername (STRING) mandatory
     - jamesMailbox:subscriptionMailbox (STRING) mandatory
 
-[jamesMailbox:messageHeader] > nt:base
+[jamesMailbox:messageHeader] > mix:created
+    mixin
     - jamesMailbox:headerFieldName (STRING) mandatory
     - jamesMailbox:headerValue(STRING) mandatory
     - jamesMailbox:headerLineNumber (LONG) mandatory
 
-[jamesMailbox:messageProperty] > nt:base
+[jamesMailbox:messageProperty] > mix:created
+    mixin
     - jamesMailbox:propertyNamespace (STRING) mandatory
     - jamesMailbox:propertyLocalName (STRING) mandatory
     - jamesMailbox:propertyValue(STRING) mandatory
     - jamesMailbox:propertyOrder (Long) mandatory
    
-[jamesMailbox:message] >  mix:referenceable, nt:file
+[jamesMailbox:message] >  mix:referenceable, mix:created, mix:created
+    mixin
     - jamesMailbox:mailboxUUID (String) mandatory
     - jamesMailbox:uid (LONG) mandatory
     - jamesMailbox:size (LONG) mandatory
@@ -46,11 +50,12 @@
     - jamesMailbox:messageBodyStartOctet (LONG) mandatory
     - jamesMailbox:messageTextualLineCount (LONG)
     - jamesMailbox:messageSubType (String) mandatory
-    + messageHeader (jamesMailbox:messageHeader)  multiple
-    + messageProperty (jamesMailbox:messageProperty) multiple
+    + messageHeader (nt:unstructured)  multiple
+    + messageProperty (nt:unstructured) multiple
 
-[jamesMailbox:mailbox] >  mix:referenceable, mix:lockable, nt:folder
+[jamesMailbox:mailbox] >  mix:referenceable, mix:lockable, mix:created
+    mixin
     - jamesMailbox:mailboxUidValidity (LONG) 
     - jamesMailbox:mailboxName (STRING) 
     - jamesMailbox:mailboxLastUid (LONG) 
-    + * (nt:folder) multiple
+    + * (nt:unstructured) multiple



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message