Issue displaying a property in a JSP under jcr:content
Hi all,
Having those cq5 trials and tribulations over the last couple of days and would appreciated some help in regards to a problem I have. I must say I'm pretty new to CQ5 but have read through the documentation. I am using version 5.2.
Requirement:
Content editors can edit a field of text from the WCM.
Page is rendered as json, with no HTML markup displaying that piece of text.
Currently, I have it set up so I have a standard page setup editable by the WCM, with a seperate JSP (json.jsp) in the component (that the page is based on) which is called by:
/content/test/page.json.html
This is fine when displaying children of the current content. I can get the current node, it's children and some properties. However, I cannot see things under a par-sys element in the jcr:content for that page. Another thing making this a bit tricky is that when I load this page in the WCM (the JSON page), I get a loading image in the tools menu, so cannot customise content, therefore having to use a main page to edit, and a seperate JSON view to render the content as JSON. When I edit in the main page with a component (extended from par-base) inside a par-sys (called main-stage), my content displays on this page, but when trying to display in the JSON view it cannot see this data.
Doing things like:
Set<String> keys = (Set <String>) currentPage.getProperties().keySet ();
out.write ("main-stage" + properties + "\n\n");
for (String key : keys) {
out.write("key: " + key + "\n");
}
I cannot see the jcr:content, just the following:
key: sling:resourceType
key: jcr:uuid
key: jcr:mixinTypes
key: jcr:title
key: cq:parentPath
key: cq:lastReplicationAction
key: jcr:baseVersion
key: jcr:isCheckedOut
key: cq:lastModifiedBy
key: cq:template
key: jcr:primaryType
key: jcr:predecessors
key: jcr:versionHistory
key: cq:lastReplicatedBy
key: cq:name
key: cq:lastModified
key: cq:childrenOrder
key: cq:lastReplicated
key: cq:siblingOrder
path: /content/test/glossary/g/test5
cq:siblingOrder: null
properties.get below:
main-stage: null
main-stage/term: null
main-stage/text: null
main-stage/text/text: null
main-stage/text/text: null
and:
<cq:include path="main-stage/text" resourceType="/apps/test/components/term" />
Renders the item, but it cannot find the data so returns the default text back.
I appreciate I may not be doing things the correct way, so all feedback would be welcome, but essentially, I'm trying to display a property under jcr:content in a JSP and failing badly.
Thanks in advance,
Luke