adobe / aem-eclipse-developer-tools

The Eclipse plugin that brings you the full connection to the Adobe Experience Manager, with auto-sync and project creation wizard.
Apache License 2.0
35 stars 23 forks source link

JCR properties view: cq namespace not being added to .content.xml #81

Closed ghost closed 4 years ago

ghost commented 6 years ago

OS: macOS Sierra 10.12.6 Eclipse: Neon.3 Release (4.6.3)

screen shot 2017-10-20 at 11 22 16 am

Failed reading file at /wknd-sites-guide.ui.apps/src/main/content/jcr_root/apps/wknd/components/structure/footer/_cq_htmlTag/.content.xml java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 23; The prefix "cq" for attribute "cq:htmlTag" associated with an element type "jcr:root" is not bound.

Steps to replicate: -Visit https://helpx.adobe.com/experience-manager/kt/sites/using/getting-started-wknd-tutorial-develop/part3.html (repo & content package can be downloaded from there) -At the "Update Header and Footer markup" section, you should receive this error when trying to add the cq:tagName property to the cq:htmlTag node using the JCR Properties pane.

rsendhil commented 6 years ago

I am getting exactly the same error. I was wondering if anyone found a solution to this problem please.

rombert commented 6 years ago

@jakegarelick @testofwill22 - do do you add the property? If you're editing the .content.xml file manually you also need to add the cq namespace, for instance:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Component">
...
</jcr:root>
ghost commented 6 years ago

@rombert thanks for following up on this - I add the property by using the JCR Properties pane.

I am guessing that the cq namespace is not added because this project uses Sling IDE Tooling which CQ is not a part of...?

As a user I would expect that the namespace would be added automatically.

rombert commented 6 years ago

It's a fair point that namespaces should be added automatically. Even though the Sling IDE tooling is not aware of CQ-specific stuff, we can always look at the server to find out the specific namespaces.

rombert commented 6 years ago

I've added this in the Sling tracker as SLING-7391 - Adding a namespaced property using the JCR properties view should ensure the namespace is present in the file.

This won't make the next release though, I'm close to cutting it after unblocking some release hurdles at the ASF, and likely I will have to invest some time in code signing on the Adobe side as well, so the scope is quite limited.

ghost commented 6 years ago

Thanks Robert. This seems to be a little over my head but I'll see if I can make a contribution.

rombert commented 6 years ago

That would be awesome! If you want to give it a try feel free to ask here or (preferrably) users@sling.apache.org for any kind of questions.

rsendhil commented 6 years ago

Thanks Rombert. Adding the cq namespace manually fixed the issue. I was using the Sling IDE tooling as Jake mentioned. I opened up the .content.xml using the default eclipse editor and changed it. Many thanks for your support gents.

rombert commented 6 years ago

Glad to hear you could at least fix the situation manually. Hopefully we'll have a proper fix in the future.