You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by David Nuescheler <da...@gmail.com> on 2005/08/03 17:28:54 UTC

Re: orderBefore behaviour

hi gennady,


> In specs 7.1.11 (Node.orderBefore method):
> "If this node does not support child node ordering, then a
> UnsupportedRepositoryOperationException thrown."
> But :
> "If a node type returns true on a call to
> NodeType.hasOrderableChildNodes(), then all nodes of that node
> type must support the method Node.orderBefore. If a node type
> returns false on a call to this method, then nodes of that node
> type may support Node.orderBefore."
> What should orderBefore method do if implementation support
> ordering independently on hasOrderableChildNodes() value
> check it and throw UnsupportedRepositoryOperationException
> if node.getPrimaryNodeType().hasOrderableChildNodes() == false
> or let method reorder child nodes?

personally, i think that repository should try to behave according to the
constraints expressed in the nodetypes. since a repository may not be able
to express all the constraints as nodetypes, in certain cases a repository
can choose to operate differently.

i would argue that the best practice employed by jackrabbit as the 
reference implementation could be used as a guidance. so, despite 
the fact that jackrabbit could theoretically order childnodes in every 
node, jackrabbit operates guided by .hasOrderableChildNodes()

regards,
david