jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nuescheler <david.nuesche...@gmail.com>
Subject Re: orderBefore behaviour
Date Wed, 03 Aug 2005 15:28:54 GMT
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()


View raw message