jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r555275 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: nodetype/ state/
Date Wed, 11 Jul 2007 13:58:52 GMT
Author: mreutegg
Date: Wed Jul 11 06:58:51 2007
New Revision: 555275

URL: http://svn.apache.org/viewvc?view=rev&rev=555275
Log:
JCR-1023: Only load item definition when required

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java?view=diff&rev=555275&r1=555274&r2=555275
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java
Wed Jul 11 06:58:51 2007
@@ -18,10 +18,6 @@
 
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QNodeDefinition;
-import org.apache.jackrabbit.spi.NodeInfo;
-import org.apache.jackrabbit.spi.PropertyInfo;
-import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
-import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
 import org.apache.jackrabbit.name.QName;
@@ -37,8 +33,6 @@
 
     public QNodeDefinition getRootNodeDefinition();
 
-    public QNodeDefinition getQNodeDefinition(NodeEntry nodeEntry, NodeInfo nodeInfo);
-
     public QNodeDefinition getQNodeDefinition(NodeState nodeState) throws RepositoryException;
 
     /**
@@ -70,8 +64,6 @@
      */
     public QNodeDefinition getQNodeDefinition(EffectiveNodeType ent, QName name, QName nodeTypeName)
             throws NoSuchNodeTypeException, ConstraintViolationException;
-
-    public QPropertyDefinition getQPropertyDefinition(PropertyEntry propertyEntry, PropertyInfo
propInfo);
 
     public QPropertyDefinition getQPropertyDefinition(PropertyState propertyState) throws
RepositoryException;
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java?view=diff&rev=555275&r1=555274&r2=555275
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
Wed Jul 11 06:58:51 2007
@@ -20,16 +20,12 @@
 import org.slf4j.LoggerFactory;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
-import org.apache.jackrabbit.spi.NodeInfo;
-import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.QItemDefinition;
-import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
-import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.name.QName;
 
 import javax.jcr.RepositoryException;
@@ -72,30 +68,6 @@
     /**
      * @inheritDoc
      */
-    public QNodeDefinition getQNodeDefinition(NodeEntry nodeEntry, NodeInfo nodeInfo) {
-        QNodeDefinition definition = null;
-        NodeEntry parent = nodeEntry.getParent();
-        if (parent == null) {
-            // special case for root state
-            definition = getRootNodeDefinition();
-        } else if (parent.isAvailable() && parent.getStatus() == Status.EXISTING)
{
-            // try to retrieve definition if the parent is available
-            try {
-                NodeState parentState = parent.getNodeState();
-                EffectiveNodeType ent = entProvider.getEffectiveNodeType(parentState);
-                EffectiveNodeType entTarget = getEffectiveNodeType(nodeInfo.getNodetype());
-                definition = getQNodeDefinition(ent, entTarget, nodeInfo.getQName());
-            } catch (RepositoryException e) {
-                // should not get here
-                log.warn("Internal error", e.getMessage());
-            }
-        }
-        return definition;
-    }
-
-    /**
-     * @inheritDoc
-     */
     public QNodeDefinition getQNodeDefinition(NodeState nodeState) throws RepositoryException
{
         QNodeDefinition definition;
         try {
@@ -141,33 +113,6 @@
     /**
      * @inheritDoc
      */
-    public QPropertyDefinition getQPropertyDefinition(PropertyEntry propertyEntry, PropertyInfo
propInfo) {
-        QPropertyDefinition definition = null;
-        NodeEntry parent = propertyEntry.getParent();
-        if (parent.isAvailable() && parent.getStatus() == Status.EXISTING) {
-            try {
-                NodeState parentState = parent.getNodeState();
-                EffectiveNodeType ent = entProvider.getEffectiveNodeType(parentState.getNodeTypeNames());
-                QPropertyDefinition defs[] = getQPropertyDefinitions(ent, propInfo.getQName(),
propInfo.getType(), propInfo.isMultiValued());
-                if (defs.length == 1) {
-                    definition = defs[0];
-                } else {
-                    definition = service.getPropertyDefinition(sessionInfo, propertyEntry.getId());
-                }
-            } catch (RepositoryException e) {
-                // should not get here
-                log.warn("Internal error", e.getMessage());
-            } catch (NodeTypeConflictException e) {
-                // should not get here
-                log.warn("Internal error", e.getMessage());
-            }
-        }
-        return definition;
-    }
-
-    /**
-     * @inheritDoc
-     */
     public QPropertyDefinition getQPropertyDefinition(PropertyState propertyState) throws
RepositoryException {
         QPropertyDefinition definition;
         try {
@@ -234,10 +179,9 @@
     /**
      *
      * @param ent
+     * @param entTarget
      * @param name
-     * @param nodeTypeName
      * @return
-     * @throws NoSuchNodeTypeException
      * @throws ConstraintViolationException
      */
     static QNodeDefinition getQNodeDefinition(EffectiveNodeType ent,

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?view=diff&rev=555275&r1=555274&r2=555275
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
Wed Jul 11 06:58:51 2007
@@ -86,16 +86,13 @@
      * @param entry
      * @param nInfo
      * @param isf
-     * @param definition
      * @param definitionProvider
      */
     protected NodeState(NodeEntry entry, NodeInfo nInfo, ItemStateFactory isf,
-                        QNodeDefinition definition,
                         ItemDefinitionProvider definitionProvider) {
         super(entry, isf, definitionProvider);
         this.nodeTypeName = nInfo.getNodetype();
         setMixinTypeNames(nInfo.getMixins());
-        this.definition = definition;
     }
 
     //----------------------------------------------------------< ItemState >---

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java?view=diff&rev=555275&r1=555274&r2=555275
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
Wed Jul 11 06:58:51 2007
@@ -83,16 +83,13 @@
      * @param entry
      * @param pInfo
      * @param isf
-     * @param definition
      * @param definitionProvider
      */
     protected PropertyState(PropertyEntry entry, PropertyInfo pInfo,
                             ItemStateFactory isf,
-                            QPropertyDefinition definition,
                             ItemDefinitionProvider definitionProvider) {
         super(entry, isf, definitionProvider);
         this.multiValued = pInfo.isMultiValued();
-        this.definition = definition;
         this.transientData = null;
         this.pInfo = pInfo;
     }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?view=diff&rev=555275&r1=555274&r2=555275
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Wed Jul 11 06:58:51 2007
@@ -24,8 +24,6 @@
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.RepositoryService;
-import org.apache.jackrabbit.spi.QNodeDefinition;
-import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
@@ -258,11 +256,8 @@
             parent.setUniqueID(uniqueID);
         }
 
-        // retrieve definition
-        QNodeDefinition definition = definitionProvider.getQNodeDefinition(entry, info);
-
         // now build the nodestate itself
-        NodeState state = new NodeState(entry, info, this, definition, definitionProvider);
+        NodeState state = new NodeState(entry, info, this, definitionProvider);
 
         // update NodeEntry from the information present in the NodeInfo (prop entries)
         List propNames = new ArrayList();
@@ -289,8 +284,6 @@
      *               <code>PropertyState</code>.
      * @param entry
      * @return the new <code>PropertyState</code>.
-     * @throws ItemNotFoundException
-     * @throws RepositoryException
      */
     private PropertyState createPropertyState(PropertyInfo info, PropertyEntry entry) {
         // make sure uuid part of id is correct
@@ -301,10 +294,8 @@
             parent.setUniqueID(uniqueID);
         }
 
-        QPropertyDefinition definition = definitionProvider.getQPropertyDefinition(entry,
info);
-
         // build the PropertyState
-        PropertyState state = new PropertyState(entry, info, this, definition, definitionProvider);
+        PropertyState state = new PropertyState(entry, info, this, definitionProvider);
 
         notifyCreated(state);
         return state;



Mime
View raw message