jsr-333
  1. jsr-333
  2. JSR_333-70

10.8.3 Updating Nodes Across Workspaces - clarify behaviour with mix:versionable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: spec
    • Labels:
      None

      Description

      discussing with jukka, we realized that updating a node from a clone in a different workspace skips children that are mix:versionable (should be simpleVersionable actually, see https://issues.apache.org/jira/browse/JCR-3585).

      we found nothing in the spec that explains this. i think its useful behaviour and could be clarified in section 10.8.3

      http://www.day.com/specs/jcr/2.0/10_Writing.html#10.8.3%20Updating%20Nodes%20Across%20Workspaces

        Activity

        Hide
        Peeter Piegaze added a comment -

        Yep, ok. I will put this in the spec and the javadoc.

        But, just remind me why this is reasonable behaviour?

        Show
        Peeter Piegaze added a comment - Yep, ok. I will put this in the spec and the javadoc. But, just remind me why this is reasonable behaviour?
        Hide
        dbu added a comment -

        we tried to build a publish workflow with the clone / update functionality. we have a node that represents a page. some child nodes are parts of that page. other child nodes represent child pages. the publish workflow should affect the page and all its element, but not its children.

        Show
        dbu added a comment - we tried to build a publish workflow with the clone / update functionality. we have a node that represents a page. some child nodes are parts of that page. other child nodes represent child pages. the publish workflow should affect the page and all its element, but not its children.
        Hide
        Peeter Piegaze added a comment -

        So, currently jackrabbit skips direct children if they are mix:versionable (but this should be mix:simpleVersionable) but it does not skip deeper mix:versionables within the subtree, is that correct?

        Show
        Peeter Piegaze added a comment - So, currently jackrabbit skips direct children if they are mix:versionable (but this should be mix:simpleVersionable) but it does not skip deeper mix:versionables within the subtree, is that correct?
        Hide
        Peeter Piegaze added a comment -

        I have changed the description of Node.update to the following

        If this node does have a corresponding node in the workspace srcWorkspace, then this method does the following:

        • Deletes all properties from this node.
        • Copies over all properties from the corresponding node.
        • Deletes all child nodes (and their subtrees) of this node that are not of type mix:simpleVersionable (or one of its subtypes, including mix:versionable).
        • Copies over all child nodes (and their subtrees) from the corresponding node that are not of type mix:simpleVersionable (or one of its subtypes, including mix:versionable).
        Show
        Peeter Piegaze added a comment - I have changed the description of Node.update to the following If this node does have a corresponding node in the workspace srcWorkspace, then this method does the following: Deletes all properties from this node. Copies over all properties from the corresponding node. Deletes all child nodes (and their subtrees) of this node that are not of type mix:simpleVersionable (or one of its subtypes, including mix:versionable). Copies over all child nodes (and their subtrees) from the corresponding node that are not of type mix:simpleVersionable (or one of its subtypes, including mix:versionable).
        Hide
        fazy added a comment - - edited

        "So, currently jackrabbit skips direct children if they are mix:versionable (but this should be mix:simpleVersionable) but it does not skip deeper mix:versionables within the subtree, is that correct?"

        Actually, I have had trouble producing/observing this behaviour (Jackrabbit 2.6):

        https://issues.apache.org/jira/browse/JCR-3593

        Show
        fazy added a comment - - edited "So, currently jackrabbit skips direct children if they are mix:versionable (but this should be mix:simpleVersionable) but it does not skip deeper mix:versionables within the subtree, is that correct?" Actually, I have had trouble producing/observing this behaviour (Jackrabbit 2.6): https://issues.apache.org/jira/browse/JCR-3593
        Hide
        fazy added a comment -

        Just another thing; I wonder if this behaviour merits its own mixin type, rather than mixing the functionality with mix:(simple)versionable?

        (I think) mix:versionable already implies mix:referenceable, which makes sense, but should it also imply a change in how updates are cascaded?

        Perhaps it would be better to introduce a new type, mix:updateCascade (or the opposite, mix:updateNoCascade might be necessary for backwards compatibility). That way, there is no need to define versionable nodes if versioning is not being used (or not supported) in order to get this behaviour.

        Show
        fazy added a comment - Just another thing; I wonder if this behaviour merits its own mixin type, rather than mixing the functionality with mix:(simple)versionable? (I think) mix:versionable already implies mix:referenceable, which makes sense, but should it also imply a change in how updates are cascaded? Perhaps it would be better to introduce a new type, mix:updateCascade (or the opposite, mix:updateNoCascade might be necessary for backwards compatibility). That way, there is no need to define versionable nodes if versioning is not being used (or not supported) in order to get this behaviour.

          People

          • Assignee:
            Unassigned
            Reporter:
            dbu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: