jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (JCR-2267) jcr:createdBy and jcr:lastModifiedBy are not automatically set, causing JCR 1.0 client code to fail when creating nt:folder or nt:file nodes
Date Thu, 20 Aug 2009 10:45:15 GMT

     [ https://issues.apache.org/jira/browse/JCR-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tobias Bocanegra reopened JCR-2267:
-----------------------------------


When creating new nodes with auto-create properties that are unknown to the spi client, the
following exception is thrown:

javax.jcr.RepositoryException: createFromDefinition not implemented for: {http://www.jcp.org/jcr/1.0}created

This happens for example, when accessing a JCR 1.0 repository with a 2.0 client and adding
new nt:file nodes.
IMO, if the property can't be initialized by the spi client, the creation of the auto-created
propererties should 
be delegated to the repository upon the save call, 


> jcr:createdBy and jcr:lastModifiedBy are not automatically set, causing JCR 1.0 client
code to fail when creating nt:folder or nt:file nodes
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2267
>                 URL: https://issues.apache.org/jira/browse/JCR-2267
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr2spi
>            Reporter: Stefan Guggisberg
>
> the following properties were introduced in JCR 2.0:
> jcr:createdBy
> jcr:lastModifiedBy
> they're declared as autocreated and don't specify a default.
> the following code throws on save():
>     parentFolderNode.addNode("foo", "nt:folder");
>     session.save();
> ==>
> Caused by: javax.jcr.RepositoryException: createFromDefinition not implemented for: {http://www.jcp.org/jcr/1.0}createdBy
> 	at org.apache.jackrabbit.spi2davex.QValueFactoryImpl.computeAutoValues(QValueFactoryImpl.java:257)
> 	at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.computeSystemGeneratedPropertyValues(SessionItemStateManager.java:687)
> 	at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(SessionItemStateManager.java:601)
> 	at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.visit(SessionItemStateManager.java:262)
> 	at org.apache.jackrabbit.jcr2spi.operation.AddNode.accept(AddNode.java:69)
> 	at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.execute(SessionItemStateManager.java:228)
> 	at org.apache.jackrabbit.jcr2spi.NodeImpl.createNode(NodeImpl.java:1294)
> 	at org.apache.jackrabbit.jcr2spi.NodeImpl.addNode(NodeImpl.java:183)
>        ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message