jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Strasser (JIRA)" <j...@apache.org>
Subject [jira] Closed: (JCR-85) Missing primaryType PropertyState on version history creation
Date Tue, 29 Mar 2005 08:19:16 GMT
     [ http://issues.apache.org/jira/browse/JCR-85?page=history ]
     
Tobias Strasser closed JCR-85:
------------------------------

    Resolution: Invalid

the existance of a jcr:primaryType property state is not part of the consistency of a persistence
manager. this would be redundant, since the nodetypename is also stored in the respective
node state. IMO, the jcr:primaryType property should be dynamically generated out of the information
in the node state and not to be stored seperately in the persistence manager as property state.


> Missing primaryType PropertyState on version history creation
> -------------------------------------------------------------
>
>          Key: JCR-85
>          URL: http://issues.apache.org/jira/browse/JCR-85
>      Project: Jackrabbit
>         Type: Bug
>     Reporter: Edgar Poce

>
> When a version history is created the changelog passed to the persistent manager does
not contain a primaryType PropertyState for each NodeState added.
> e.g. run NodeAddMixinTest.testAddSuccessfully() and check the ChangeLog in the PersistenceManager
> Code that checks the sanity in the PersistenceManager
>     /**
>      * Checks sanity
>      * 
>      * @param changeLog
>      */
>     private void checkSanity(ChangeLog changeLog) throws ItemStateException
>     {
>         /*
>          * check that every NodeState has its primaryType PropertyState
>          */
>         QName primaryType = Constants.JCR_PRIMARYTYPE;
>         Iterator newNodes = changeLog.addedStates();
>         while (newNodes.hasNext())
>         {
>             ItemState state = (ItemState) newNodes.next();
>             if (state.isNode())
>             {
>                 NodeState nodeState = (NodeState) state;
>                 try
>                 {
>                     if (changeLog.get(new PropertyId(nodeState.getUUID(),
>                                                      primaryType)) == null)
>                     {
>                         String msg = "No primary type for node: "
>                                 + nodeState.getUUID();
>                         log.error(msg);
>                         throw new ItemStateException(msg);
>                     }
>                 } catch (NoSuchItemStateException e)
>                 {
>                     String msg = "No primary type for node: "
>                             + nodeState.getUUID();
>                     log.error(msg);
>                     throw new ItemStateException(msg);
>                 }
>             }
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message