jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conoly, Brett" <Brett.Con...@digitalinsight.com>
Subject RE: Using an sql query and ORDER BY
Date Tue, 29 Apr 2008 13:13:01 GMT
Hmmm, you seem to be right, we have an optional property on our custom
nodetype that it seems to order on but I'm not sure why...this is the
property definition:

<propertyDefinition autoCreated="false" mandatory="false"
multiple="false" 	name="wc:restorePath" onParentVersion="COPY"
protected="false"
	requiredType="String"/>

As far as I can tell, there's really nothing that sets it apart to be
orderable.  
I've been looking around and found a mention of a mixin orderable but I
can't find any official documentation on it.

My custom nodetype actually extends the nt:file and has some custom
properties that we use.  I was thinking of possibly adding something
like this:

<nodeType hasOrderableChildNodes="false" isMixin="false" name="my:file"
primaryItemName="">
	<supertypes>
	      <supertype>nt:file</supertype>
		<!-- Possibly adding this -->
		<supertype>mix:orderable</supertype>
      </supertypes>
	<!--================================================-->
	<!-- This is what I'm thinking of adding -->
	<propertyDefinition name="jcr:name" requiredType="String"
autoCreated="true" orderable="true"/>
	<!--================================================-->
</nodeType>

My biggest question is, can you override properties like this to force
it to be orderable? And if not, will that mix:orderable work to allow me
to order it by the name or path?
Thanks in advance,
Brett

-----Original Message-----
From: Ard Schrijvers [mailto:a.schrijvers@onehippo.com] 
Sent: Monday, April 28, 2008 7:23 AM
To: users@jackrabbit.apache.org
Subject: RE: Using an sql query and ORDER BY

Hello,

It might be quite well possible that jcr:name is also a property which
does not end up in the index (I am not sure though, so should test it).
But, can you try to sort on any of the properties which are part of the
node, such as, my:title , and confirm that this works

-Ard

> 
> That makes sense, even though it still runs the query, but 
> even when I order by jcr:name or nt:file it still does not 
> return an ordered list of nodes... I could just be 
> misunderstanding the query syntax but nothing seems to be 
> working.  Do I have to set a certain property on the node in 
> order to make it sortable or should the query still be working?
> 
> SELECT * FROM nt:file WHERE jcr:path LIKE 'absNodePath %' 
> ORDER BY jcr:name
> 
> Thanks again
> 
> -----Original Message-----
> From: Julian Reschke [mailto:julian.reschke@gmx.de]
> Sent: Wednesday, April 23, 2008 10:20 AM
> To: users@jackrabbit.apache.org
> Subject: Re: Using an sql query and ORDER BY
> 
> Conoly, Brett wrote:
> > Anybody...?
> 
> As far as I understand, you can't order by jcr:path, as it's 
> a synthesized property.
> 
> BR, Julian
> 
> PS: which means the query parser probably should reject the query.
> 

Mime
View raw message