Hi,
Am Donnerstag, den 13.03.2008, 15:10 +0100 schrieb Bertrand Delacretaz:
> On Thu, Mar 13, 2008 at 2:47 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote:
>
> > ...The second option - using the node - you do
> >
> > var child = ...
> > var childNode = child.adaptTo(Packages.javax.jcr.Node);
> > if (childNode != null && childNode.hasProperty("title")) {
> > var titleString =
> > childNode.getProperty("title").getString();
> > }...
>
> This is IMHO ugly, and the Resource option that you suggest is quite
> involved as well for a simple thing.
ok, ok, I am biased ;-) you may write the second one as follows:
var child = ...
var childNode = child.adaptTo(Packages.javax.jcr.Node);
if (childNode != null) {
var titleString = childNode.title;
}
This is certainly less ugly.
Still we are bound to the Resource API, thus the adaptTo method remains.
Though I cannot see the uglyness (this may be why the old romans said
"de gustibus non est disputandum").
Regards
Felix