Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Templates query have no <children> elements

Avatar

Former Community Member
same query for meetings returns correctly number of childer,
but for templates I get xml that only have

<node href="https://forums.adobe.com/accounts/bkf/my-account-id/templates"
type="cr:folder">

<name>templates</name>

<properties>

<property name="cr:owner" type="string">

<value>...</value>

</property>

<property name="jcr:created" type="date">

<value>2009-02-17T23:33:22.804-05:00</value>

</property>

</properties>

</node>

url:




https://na2.connectnow.acrobat.com//app/content/accounts/bkf/my-account-id/templates/?gak=lalala




but same url for meetings:


https://na2.connectnow.acrobat.com//app/content/accounts/bkf/my-account-id/meetings/?gak=lalala



returns all children along with container folder metadata
etc ..



so Java code throws NPE when trying to iterate through
templates :





Element children = (Element)
repository.getElementsByTagName("children").item(0);
//children is null

NodeList nodes = children.getElementsByTagName("node");

--

error:

error listing templates

java.lang.NullPointerException

at AFCS$AccountManager.listItems(AFCS.java:290)

at AFCS$AccountManager.listTemplates(AFCS.java:343)

at AFCS.main(AFCS.java:668)





3 Replies

Avatar

Employee
you are correct.



all the other scripts are fine when no <children> tag
is present, but the Java version chokes. I'll fix it for next
version (and I wish I used XPath or a better XML parser for this
but I tried to limit the dependencies from external jars where
possible)



thanks for reporting the problem.

Avatar

Former Community Member
so as I understand template call should return one child?
since I do have one default template?

Avatar

Employee
the default template is not in your template folder (is a
"global" template for SDK rooms)