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

dialog constructs not working #16

Closed mikeyhendy closed 9 years ago

mikeyhendy commented 9 years ago

Neither classic or touch UI based dialogs work properly.

Classic: The dev tools won't allow the creation of a cq:Widget or cq:TabPanel underneath a cq:WidgetCollection. Importing the dialog created in CRXDE Lite from AEM instead of creating them in eclipse kind of works for classic, so long as you don't try and update it at any stage within Eclipse.

Touch: Creating a node with name of "cq:dialog" (type=cq:Dialog) gives the following synchronisation error to AEM: "Failed publishing path=/apps/training/components/content/topnav/cq::dialog, result=JcrResult[ success:false, exception: org.apache.sling.ide.transport.RepositoryException - javax.jcr.RepositoryException: Invalid path: /apps/training/components/content/topnav/cq::dialog]" Note the double ":" in error message. Importing the cq:dialog created in CRXDE Lite from AEM instead of creating them in eclipse doesn't work. Doesn't appear in folder. Not sure if it's relevant or not, however, looking at the project files within the eclipse project folder, you can see the cq:dialog being imported as "_cq_dialog/.content.xml" whereas "_cq_dialog.xml" seems to work better and is more consistent with the dialog node (dialog.xml).

rombert commented 9 years ago

Thanks for the report, I'll have a look

rombert commented 9 years ago

Importing the cq:dialog created in CRXDE Lite from AEM instead of creating them in eclipse doesn't work. Doesn't appear in folder. Not sure if it's relevant or not, however, looking at the project files within the eclipse project folder, you can see the cq:dialog being imported as "_cq_dialog/.content.xml" whereas "_cq_dialog.xml" seems to work better and is more consistent with the dialog node (dialog.xml).

That's consistent to how FileVault does it so there's nothing to change there. What is to change though is the fact that the content navigator does not properly display the nodes.

rombert commented 9 years ago

What is to change though is the fact that the content navigator does not properly display the nodes.

You've already opened #18 for that, so this task will track the rest of the problems.

rombert commented 9 years ago

The dev tools won't allow the creation of a cq:Widget or cq:TabPanel underneath a cq:WidgetCollection.

The error that I get is 'Cannot create child of cq:WidgetCollection with type cq:Widget (yet?)' . There's at least one unimplemented code path in JcrNode.createChild, so that's my next stop.

rombert commented 9 years ago

The node creation issue has been fixed in the Sling IDE Tooling project ( see SLING-3989: Content Navigator can't create full coverage nodes under partial coverage nodes ) and will be incorporated in the next AEM Developer Tools public release.

If you'd like to build a fix yourself, please follow the instructions from Sling IDE Tooling - building from source.

I still have to look into

Creating a node with name of "cq:dialog" (type=cq:Dialog)

rombert commented 9 years ago

I've also fixed the error with creating nodes with ':' in their names ( see SLING-3990: Content Navigator does not correctly escape os names for nodes with special characters ).

To my knowledge, this fixes all the issues listed in this bug so I'm going to close it. It would be great if you could build an SNAPSHOT version of the Sling IDE Tooling and validate that all works fine.

djessup commented 9 years ago

I've just built the Sling IDE Tools (r1630284) and then the AEM tools (0a8f6df911) using that snapshot but I'm still getting errors relating to the ":" encoding.

Are there any logs or debug info I could provide that would help track down where the issue is?

rombert commented 9 years ago

Can you give me the steps to reproduce and what the error log contains?

djessup commented 9 years ago

Sure, steps to reproduce:

  1. Create new project in Eclipse using the AEM Sample Multi-module Project w/ sample-project-archetype-7. All default options, server is a standard AEM6 SP1 instance
  2. In the ui.apps module create a new node in one of the components (e.g. /project.ui.apps/src/main/content/jcr_root/apps/project/components/content/servicecomponent)
  3. Set the name to cq:dialog and type to nt:unstructured
  4. Let the node auto-sync (or push it manually to the AEM server)

Results in this error: screen-shot-2014-10-09-at-7 09 54-pm

djessup commented 9 years ago

Also, for reference these are the plugin version I have - as mentioned the Sling IDE Tooling is from the SVN trunk and AEM Tools from the master branch of this repo screen-shot-2014-10-09-at-7 14 24-pm

Edit: As I posted this I realised I must have linked the wrong version of the Sling IDE Tooling, attempting to rebuild using 1.0.3-SNAPSHOT to see if that fixes it. Will post an update shortly.

rombert commented 9 years ago

Looks like you're using old versions of the Sling tooling. You have the release version ( 1.0.2 ) , but the version from trunk should have 1.0.3.xxxx . Can you try installing the Sling IDE Tooling again from a local build and validating that you have a 1.0.3.xxxx version ?

djessup commented 9 years ago

Confirmed this is indeed fixed with the latest Sling IDE Tools - apologies for my confusion!

One question, as I'm unfamiliar with Eclipse plugin development - to get my local build of the Sling IDE Tools to package into the AEM plugin artefact I had to modify the AEM reactor pom.xml to reference version 1.0.3-SNAPSHOT of the org.apache.sling.ide (one in <dependencies> and another in the Tycho target-platform-configuration) and

Then I had to modify the p2update category.xml as follows:

<feature url="features/org.apache.sling.ide.feature_0.0.0.qualifier.jar" id="org.apache.sling.ide.feature" version="0.0.0">
   <category name="sling"/>
</feature>
<feature url="features/org.apache.sling.ide.m2e-feature_0.0.0.qualifier.jar" id="org.apache.sling.ide.m2e-feature" version="0.0.0">
   <category name="sling"/>
</feature>

Is this the correct approach or is there a better way?

rombert commented 9 years ago

Thanks for confirming that it works.

As for pulling in new versions, I don't think that there's a better way, and the AEM Developer Tools will be tied to a release version of the Sling IDE Tooling. Once the next version of the Sling IDE Tooling is released, I'll reference it from the AEM Developer tooling.

However, you can install the Sling IDE Tooling from its own update site that you've built, there will be no conflicts.