[
https://issues.apache.org/jira/browse/JCR-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498148
]
Christophe Lombart commented on JCR-922:
----------------------------------------
For the second problem, maybe 3 possibilities :
1/ Don't add the Lock info (lockowner, ...) in the pojo. This solution
requires a new method in the persistence managers (eg.
PersistenceManager.getLock(path)). This method returns the Wrapper Lock
object.
2/ JCR mixin node types can be added and removed at any time. That's the case
for the mix:lockable. Each field-descriptor, bean-descriptor and
collection-descriptor element can have a new attribute which specify the
associated mixin node type reference. If the mixin node type is not yet
assigned to the node, the mapping can be ignored for that attribute.
<class-descriptor className="...." >
<field-descriptor fieldName="path" path="true" />
<field-descriptor fieldName="title" jcrName="graffito:title"/>
<field-descriptor fieldName="lockOwner" jcrName="jcr:lockOwner"
mixintype="mix:lockable/>
</class-descriptor>
3/ Add a collection or a map in the pojo which will contain all available mixin
type properties. It should be possible to create a new collection converter
specific to mixin type property management.
In your specific case the first solution is interesting. What is the interest
to add lock info in the data value object ?
Other solutions are more interesting for a generic support of mixin node types.
I will create a new JIRA issue for this kind of support.
What do you think about that ? Maybe another solution ?
> jcr mapping layer (OCM) should expose lock owner
> ------------------------------------------------
>
> Key: JCR-922
> URL: https://issues.apache.org/jira/browse/JCR-922
> Project: Jackrabbit
> Issue Type: Improvement
> Components: jcr-mapping
> Affects Versions: 1.3
> Reporter: ruchi goel
> Assigned To: Christophe Lombart
> Fix For: 1.3
>
>
> jcr mapping layer 's persistencemanager.java does not expose an API for
> returning lockowner. Ideally , the following method
> public String lock(final String absPath, final boolean isDeep, final boolean
> isSessionScoped)
> should return a hashmap/String array containing locktoken as well as
> lockowner.
> I tried having lockowner as a field in my java object and mapping it to
> jcr:lockOwner , so that I can just use getLockOwner() . But the problem is
> this property gets introduced in the node only if the node is locked. So,
> when I try to insert a node , before I can even lock it , the insertion fails
> since there is no property like jcr:lockOwner till then .
> So, I feel there is need for the above API. It is ok to have it exposed via
> separate call in order to maintain backward compatability
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.