I thought I had cracked this, but I’ve discovered a bug. What we actually want is alphabetical listing of navons (rendered as hyperlinks to their landing pages) within each folder. To do that with a JCR-170 query, I came up with this:
SELECT rx:sys_contentid, rx:sys_contentstartdate
FROM rx:rffNavon
WHERE jcr:path LIKE '//Sites/External/PSD%'
AND NOT jcr:path LIKE '//Sites/External/PSD/%/%/%'
ORDER BY rx:displaytitle
That works fine, usually. The first condition in the WHERE clause finds navons in sub-folders of the specified folder, and the second condition filters out navons in sub-folders of those sub-folders (i.e. sub-sub-folders.) In other words, the above query finds navons, and lists them alphabatically, one level in the web site hierarchy at time.
But when I try it with a folder that contains sub-folders, but no sub-sub-folders (or at least none that have navons in them) it fails with an “unexpected exception” which then breaks any page that contains an autoslot that uses the query. Seemingly, you cannot search for NOT something if there are no items for it NOT to find! The following error message is displayed when testing this in the Rhythmyx Query Debugger:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ) near line 1, column 543 [select new map(c0.id.sys_contentid as rx¨sys_contentid, cs.m_contentStartDate as rx¨sys_contentstartdate, c0.displaytitle as rx¨displaytitle, c0.id.sys_revision as rx¨sys_revision, f.owner_id as sys_folderid) from com.percussion.cms.objectstore.PSComponentSummary as cs left outer join cs.parentFolders as f,com.percussion.services.generated.RffNavon as c0 where cs.m_contentId = c0.id.sys_contentid and cs.m_contentTypeId = 314 and c0.id.sys_revision = cs.m_currRevision and (f.owner_id in (314,346,348,349,362,317,315,316,345,347,350) AND ) order by c0.displaytitle asc]
I’m not hugely confident that this can be fixed if I report it to technical support. So I guess I am back to ask if anyone can think of an alternative way to trick Rhythmyx into allowing us to do an automatic site map listed alphabetically. Something like the following…
About Us
Contact Us
History
Mission Statement
News
2006
2007
2008
Science
Biology
Chemistry
Physics
… even if those sections and subsections are listed in a different order in the main navigation bars on the web site.
Andrew.