icfnext / cq-component-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi, We are not able to compile "cq-component-maven-plugin" with Java11, It would be really great if you can guys can help us to resolve the issue.
Please find the error message below.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CQ Component Plugin ................................ SUCCESS [ 0.434 s]
[INFO] CQ Component Plugin Annotations .................... FAILURE [ 2.132 s]
[INFO] CQ Component Maven Plugin .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.745 s
[INFO] Finished at: 2020-07-12T17:34:25-07:00
[INFO] Final Memory: 13M/47M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project cq-component-annotations: Compilation failure: Compilation failure:
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :cq-component-annotations
Thanks
Muneeswar
Currently the Drop Target rendering does not allow for the production of a parameters
child resource under the drop target definition in the edit config. This means there is no way to indicate how resources should be instantiated (ie, what type they should be) when the drop target is used. If you are dragging and dropping components onto a page prior to using the drop target this is not a problem, but if you have baked in the components, using the drop target will not properly instantiate the underlying resource (or at least, it won't do it in the way you probably want it to).
Specifically I am recommending adding a parameters
attribute to the DropTarget
annotation which takes a list of @Parameter
annotations each having a name and value property and an optional namespace property (or we may be able to just reuse the @ContentProperty
annotation for this purpose)
autocomplete component in Granite UI supports a remote source for the options, see /libs/granite/ui/components/foundation/form/autocomplete/list/list.jsp:
* Example::
*
* /path.html?start={start}&end={end}&query={query}&my-other-param=param1
*
* If this property is not set, the items are read from the DataSource.
*/
- src (StringEL)
To use this feature the expected dialog field definition should be:
<options jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/autocomplete/list"
src="/path.html?start={start}&end={end}&query={query}" />
Corresponding plugin's annotation for Touch UI:
@Autocomplete(
...
optionsProperties = {
@Property(name='src', value='/path.html?...')
}
)
Hi Team.
Could you please provide some sample or annotation that we need to use for creating coral data picker using granite/ui/components/coral/foundation/form/datepicker resource type.
Thanks
Seran
For pages with @DateField properties, when creating a page and setting a date during the creation process in the TouchUI, the following error shows up in the error.log in addition to the UI error message that pops up when attempting to save the page:
ERROR [0:0:0:0:0:0:0:1 [1447362379123] POST /libs/wcm/core/content/sites/createpagewizard/_jcr_content HTTP/1.1] libs.cq.gui.components.siteadmin.admin.createpagewizard.page.POST$jsp Error occur creating a new page
javax.jcr.ValueFormatException: Invalid date 2015-11-12
at org.apache.jackrabbit.oak.plugins.value.ValueFactoryImpl.createValue(ValueFactoryImpl.java:232)
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:441)
at org.apache.jsp.libs.cq.gui.components.siteadmin.admin.createpagewizard.page.POST_jsp.writeContent(POST_jsp.java:124)
In ValueFactoryImpl.createValue it looks like it's running the following for dates:
if (ISO8601.parse(value) == null) {
throw new ValueFormatException("Invalid date " + value);
}
Currently, the DateField is set with the default storedFormat = "YYYY-MM-DD".
You can test how this fails in the groovy console:
(org.apache.jackrabbit.util.ISO8601.parse("2015-11-12") == null) ? "FAIL" : "SUCCESS"
However, the following succeeds:
(org.apache.jackrabbit.util.ISO8601.parse("2015-11-12T00:00:00.000-06:00") == null) ? "FAIL" : "SUCCESS"
If I update the DateField annotation to override the storedFormat then the page can be created without the error:
@DateField(storedFormat="YYYY-MM-DDThh:mm:ss.SSSZ")
So, for now we can override the storedFormat, but I'm guessing we probably want to change the default in the DateField annotation.
Whenever a Dialog Field Set is being used, the allowBlank property for that field set is always set to 'false' even though there might not be any properties inside that field set that are required.
This happens for Classic UI, not sure about Touch UI. I am using the latest release (4.1.2).
Complimenting the suppressTouchUIDialog
property, I am hereby requesting the addition of a suppressClassicUIDialog
property to the @Component
annotation. This property would default to false
. When set to true
it would suppress the creation of a dialog.xml file for the annotated component.
The presence of "validator" property for Classic-UI dialog is causing the following Js error and prevents any validation from occurring:
Uncaught TypeError: j.checkValidity is not a function
So, here is an example of our annotations usage:
@DialogField(
name = "xyz",
additionalProperties = {
@Property(name = "validator", value = "function(fieldName){" + " return MtFeedback_checkMultipleEmails(fieldName,'CC');" + "}"),
@Property(name = "validation", value = "mt.email.address"),
}
And in effect, with the above annotation logic, Touch-UI should have a "validation" property but not "validator". And, conversely Classic-UI should have "validator" but not "validation".
Generation of "granite/ui/components/foundation/form/hidden" form field is not supported for TouchUI. Nothing is produces by the code below:
@Hidden @DialogField(name = "./showControls@TypeHint", value = "Boolean")
default String isShowControlsType() { return "Boolean"; }
Expected output of the plugin:
<showControls cq:hideOnEdit="{Boolean}false" cq:showOnCreate="{Boolean}true"
disabled="{Boolean}false" jcr:primaryType="nt:unstructured"
name="./showControls@TypeHint" renderReadOnly="{Boolean}true"
required="{Boolean}false" sling:resourceType="granite/ui/components/foundation/form/hidden"
value="Boolean"
/>
Workaround: adding a sling:resourceType
explicitly helps but it makes declarations cumbersome.
I am using citytechinc cq complonent plugin to create components in AEM using Java classes. When I use following dropdown with hardcoded option, it works fine.
`@ValueMapValue
private String stores;
@DialogField(fieldLabel = "Stores", ranking = 10) @Selection(type = Selection.SELECT, options = {
@Option(text = "Store1", value = "556"),
@Option(text = "Store2 n Barrels", value = "475"),
@Option(text = "Store3 Hive", value = "2547"),
})
public String getStores() {
return stores;
}`
But I use following dropdown to load it dynamically using a servlet. The dropdown remains empty on the AEM dialog.
`@ValueMapValue
private String stores;
@DialogField(fieldLabel = "Stores", ranking = 10)
@Selection(type = Selection.SELECT, dataSource = "/bin/store/storeoptions.json")
public String getStores() {
return stores;
}`
Following is my servlet
`@Component(service = Servlet.class,
property = {
"sling.servlet.methods=" + HttpConstants.METHOD_GET,
"sling.servlet.paths=" + "/bin/store/storeoptions"
})
public class StoreOptionsServlet extends SlingAllMethodsServlet {
@Override
protected void doGet(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws IOException {
resp.setContentType("application/json");
List<OptionItem> options = new ArrayList<>();
options.add(new OptionItem("25365", "Store1"));
options.add(new OptionItem("16726", "Store2"));
options.add(new OptionItem("31280", "Store3"));
// Add more options as needed
resp.getWriter().write(new Gson().toJson(options));
}
}`
Any help is appriciated.
To better support the Sling resource merger mechanisms used in the Touch UI users should be able to set the name of the tab node to be produced via the @Tab
annotation so that expected tabs can be overridden without relying on the titles of the tabs matching.
Would be nice since it seems like Adobe is moving towards the Touch UI interface to start creating and deploying the cq:dialog.xml as part of the dialog.xml creation process. Thanks!
Current there is no way to add custom and missing plugins to an RTE without overriding the @richtexteditor annotation. Ideally I would like to be able to add any annotations regardless of whether or not they have been explicitly prepared for.
If that is not possible, the InsertVariablePlugin should be explicitly added as an option:
https://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.rte.plugins.InsertVariablePlugin
If you have a component class layout such as this:
MyParentComponent
@DialogFieldSet( namePrefix = "child1" ) private MyChildComponent childComponent1;
@DialogFieldSet( namePrefix = "child2" ) private myChildComponent childComponent2;MyChildComponent
@DialogFieldSet private someOtherComponent otherComponent
And attempt to build this nested layout, the following error occurs:
java.lang.NullPointerException
at com.citytechinc.cq.component.dialog.dialogfieldset.DialogFieldSetWidgetMaker.buildWidgetCollection(DialogFieldSetWidgetMaker.java:110)
at com.citytechinc.cq.component.dialog.dialogfieldset.DialogFieldSetWidgetMaker.make(DialogFieldSetWidgetMaker.java:75)
at com.citytechinc.cq.component.dialog.factory.WidgetFactory.make(WidgetFactory.java:61)
at com.citytechinc.cq.component.dialog.factory.DialogFactory.make(DialogFactory.java:127)
at com.citytechinc.cq.component.dialog.util.DialogUtil.buildDialogsFromClassList(DialogUtil.java:176)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.buildArchiveFileForProjectAndClassList(ComponentMojoUtil.java:239)
at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:100)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
...
I believe this is related to the fact that DialogFieldSet objects do not get built with a name parameter that is populated. The maker is attempting to build a name for the properties in the nested dialog field set and name is null for the DialogFieldSet, so an NPE occurs.
Expose a requestSuffix input to the Html5SmartImage annotation. This will produce the requestSuffix configuration of the Html5SmartImage widget
Looking at the granite ui documentation you can see that there is a granite:data node that turns properties into html data attributes for use in client side javascript.
There is currently no way to express this using bedrock annotations.
The HtmlTag should have support for additional properties.
It should be possible to produce the following XML using the HtmlTag annotation:
<cq:htmlTag jcr:primaryType="nt:unstructured"
cq:tagName="nav"
class="component breadcrumb"
aria-label="Breadcrumb"
additionalAttributeName="additionalAttributeValue"/>
The above XML is valid and it results in adding all of the non-standard attributes to the component decoration tag.
Adobe documentation mentions that properties other than 'cq:tagName' and 'class' will be added as HTML attributes with the same String value as provided.
https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/decoration-tag.html
Hello,
we have a multi-module project. Each module contains a set of components(with dialog) and dependencies to other modules. After compilation we have a set of dialogs not only from current module but also from other modules.
To exclude this unwanted dependencies from construction process we can use excludeDependencies but we should maintain this list of exclusions and validate generated dialogs every time for every module after any dependency changes.
To facilitate this process and prevent from generation of unwanted dialogs we can intend includeDependencies option where we could specify dependencies from which we desire to compile dialogs and skip other related dependencies. Pull request with implementation was created here - pull 69.
Description of implementation:
Thanks for considering this request
@michaelhodgdon @pmichelotti
I am getting an error from the plugin as it tries to gather annotations during Scanning for Components
step.
org.reflections.ReflectionsException: could not get type for name com.mynamespace.ComponentClassType
at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:378)
at org.reflections.ReflectionUtils.forNames(ReflectionUtils.java:387)
at org.reflections.Reflections.getTypesAnnotatedWith(Reflections.java:351)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.getAllComponentAnnotations(ComponentMojoUtil.java:465)
at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:87)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
In my case, the ComponentClassType
extends an abstract base class which extends the AbstractComponent. I am wondering if this is a known issue in org.reflections where Reflections.getSubTypesOf(Object.class)
should be used rather than whatever is being used.
Are there any known workarounds?
I'm using the TagInputField like this:
@DialogField(
tab = 1,
name = "./tags",
fieldLabel="Product tags"
)
@TagInputField(
displayTitles = true,
namespaces = @TagNameSpace(value = "default", maximum = 10)
)
private final String[] tags;
And when building, the following error is being thrown:
java.lang.NullPointerException
at com.citytechinc.cq.component.xml.XmlWriter.sanatize(XmlWriter.java:155)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:75)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.createElement(XmlWriter.java:133)
at com.citytechinc.cq.component.xml.XmlWriter.makeDocument(XmlWriter.java:147)
at com.citytechinc.cq.component.xml.XmlWriter.writeXml(XmlWriter.java:54)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.writeElementToFile(ComponentMojoUtil.java:626)
at com.citytechinc.cq.component.dialog.util.DialogUtil.writeDialogToFile(DialogUtil.java:78)
at com.citytechinc.cq.component.dialog.util.DialogUtil.buildDialogsFromClassList(DialogUtil.java:178)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.buildArchiveFileForProjectAndClassList(ComponentMojoUtil.java:239)
at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:100)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Failed to notify spy org.netbeans.modules.maven.event.NbEventSpy: null
I have a complex field declared in a component's model:
@DialogField @DialogFieldSet(namePrefix = "ctaButton/", title = "CTA Button", collapsible = true) @Optional @Inject private CtaButton ctaButton;
This class has fields declared like:
`@Model(adaptables = Resource.class )
public class CtaButton implements JacksonSerializable {
@DialogField(fieldLabel="Visible", fieldDescription = "Check to make CTA Button visible")
@CheckBox(inputValue = "true", title = "Visible", text = "Check to make CTA Button visible")
@Inject @Optional
private Boolean visible = false;
...
}
`
Note, that name is not specified explicitly. Generated XML for the Classic UI is OK:
<visible allowBlank="{Boolean}true" checked="{Boolean}false" disabled="{Boolean}false" fieldDescription="Check to make CTA Button visible" fieldLabel="Visible" hideLabel="{Boolean}false" inputValue="true" jcr:primaryType="cq:Widget" name="./ctaButton/visible" xtype="checkbox"/>
For Touch UI:
<visible cq:hideOnEdit="{Boolean}false" cq:showOnCreate="{Boolean}true" disabled="{Boolean}false" fieldDescription="Check to make CTA Button visible" fieldLabel="Visible" jcr:primaryType="nt:unstructured" name="ctaButton/" renderReadOnly="{Boolean}true" required="{Boolean}false" sling:resourceType="granite/ui/components/foundation/form/checkbox" text="Check to make CTA Button visible" title="Visible"/>
Note, that 'visible' is not appended to 'ctaButton/' and there is no leading './'. However, name is set properly when there is no namePrefix in DialogFieldSet but values are then stored on upper level which is not always desired.
Workaround is to specify the field name explicitly, like:
name='./visible'
Tried with 4.1.2 and cloned from develop branch.
Empty Text is such a commonly configured additional parameter that it would be worth adding as a top level DialogField parameter.
Currently we default all dialogs to the Tabs layout in the Touch UI to match the Classic UI. A number of other layouts are available such as the column layout. Users should be able to chose what layout they want for their dialog as well as nested elements like dialog field sets.
Currently the touchUI dialog annotation generates dialog using Coral 2 resource types. can there be support for coral3 resourcetypes be added.
I get the following warning message when I run my AEM Maven project with multiple threads:
[INFO] --------------------------[ content-package ]---------------------------
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that have goals not marked *
[WARNING] * as @threadSafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in de.viega.web.aem:viega-aem-package:
[WARNING] com.day.jcr.vault:content-package-maven-plugin:0.5.1
[WARNING] com.citytechinc.cq.cq-component-plugin:cq-component-maven-plugin:7.0.0
[WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[WARNING] *****************************************************************
Maven command:
mvn clean verify -T 4
When setting useCoral3Dialogs=true configuration for the cq-component-maven-plugin, existing Tab inclusions, via @tab(touchUIPath=...) stop working.
<plugin>
<groupId>com.citytechinc.cq.cq-component-plugin</groupId>
<artifactId>cq-component-maven-plugin</artifactId>
<version>${component.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>component</goal>
</goals>
</execution>
</executions>
<configuration>
<componentPathBase>jcr_root/apps/company/components</componentPathBase>
<defaultComponentGroup>Company Name</defaultComponentGroup>
<transformerName>lower-case</transformerName>
<useCoral3Dialogs>true</useCoral3Dialogs>
<additionalFeatures>
<additionalFeature>rte-touchui</additionalFeature>
</additionalFeatures>
</configuration>
</plugin>
The issue is that the path property does not get written to the xml node corresponding to the item node with sling:resourceType granite/ui/components/foundation/include, e.g. (with 6.4.1-SNAPSHOT)
<items jcr:primaryType="nt:unstructured">
<tabs jcr:primaryType="nt:unstructured" maximized="{Boolean}true" sling:resourceType="granite/ui/components/coral/foundation/tabs">
<items jcr:primaryType="nt:unstructured">
<basic cq:hideOnEdit="{Boolean}false" cq:showOnCreate="{Boolean}true" jcr:primaryType="nt:unstructured" margin="{Boolean}true" maximized="{Boolean}false" sling:resourceType="granite/ui/components/foundation/include"/>
</items>
</tabs>
</items>
I've confirmed this behavior in 6.0.0, 6.1.0, 6.4.0, and develop (6.4.1-SNAPSHOT).
Issue appears to have been introduced in com.citytechinc.cq.component.touchuidialog.layout.tabs.TabsLayoutCoral3Maker, commit # e4989ad, with the change from
// Create all Tabs
List<FixedColumnsLayoutElement> tabs = new ArrayList<FixedColumnsLayoutElement>();
for (FixedColumnsLayoutElementParameters currentLayoutElementParams : tabParametersList) {
if (currentLayoutElementParams != null) {
tabs.add(new FixedColumnsLayoutElement(currentLayoutElementParams));
}
}
to
// Create all Tabs
for (ContainerParameters tabContainerParameters : tabContainerParametersList) {
if (tabContainerParameters != null) {
tabs.add(new Container(tabContainerParameters));
}
}
FixedColumnsLayoutElement class includes a getPath() method.
Container class does not have a getPath() method.
That method is critical for the XMLWriter when determining what xml attributes / node properties are applicable for the current element.
Based on the last several months of commits, it looks like there's an effort to move completely to containers for 6.3+, due to the increased coral3 dialog usage, so instead of suggesting a reversion of e4989ad, I'm suggesting an update to com.citytechinc.cq.component.touchuidialog.container.Container and com.citytechinc.cq.component.touchuidialog.container.Section.
See https://github.com/d-wells/cq-component-maven-plugin/pull/1/commits
There seems to be some dependency on how your maven project is setup. E.g. if you have a backend module and FE module, in which module should you declare the plugin and dependencies?
I'll happily update the docs but I haven't been able to figure this out.
We are facing issue with excludedDependencies - property, as it's not excluding classes from dependency project.
Problem:
cq-component-maven-plugin generates and injects component dialogs for all identified classes in common project folder, as site1 have dependency of common again it's generates and injects component dialogs for classes exposed from common below site1 folder, so it's duplicating components.
we have added excludedDependencies property in configuration in site1 ui pom.xml.
But still the component dialogs are generated as a duplicate in site1.
Help us to get this issue resolved.
Project Structure:
@1) xyz-common[xyz-common-core, xyz-common-ui]
@2) xyz-site1[xyz-site1-core, xyz-site1-ui]
@3) xyz-site2[xyz-site2-core, xyz-site2-ui]
<excludedDependencies>
<dependency>
<groupId>com.xyz.common</groupId>
<artifactId>xyz-common-core</artifactId>
</dependency>
</excludedDependencies>
Since some components don't need to be edited, there should be a way to suppress generating the dialog.xml and _cq_dialog.xml files.
There is a 'suppressTouchUIDialog' property on the Component annotation, but it only suppresses generation of the _cq_dialog.xml file and the dialog.xml is still there, even if there are no widgets to include inside the dialog.
Either providing another property to suppress generating dialog.xml or just not generating the files if there is nothing to show in the dialogs would fix the issue.
The Plugin does not compile because the maven repository does not contain gradle-base-services-groovy in version 1.6. The minimum version for all of the gradle dependencies is 2.1.
Pull Request #64 fixes this error. Please pull.
Use Case: PathFields inside MultiCompositeField (cq-library) must have their widths set manually as they do not auto adjust appropriately, especially when not on the first tab of the dialog.
The width property appears to only be available through additionalProperties in the DialogField annotation. However, when width is added there it is not reflected on fields with the PathField Annotation.
The following is written in the Java Annotations:
@DialogField(fieldLabel = "Path", required = true, additionalProperties = {
@FieldProperty(name = "width", value = "230"),
})
@PathField(rootPath = PathConstants.PATH_CONTENT_START, showTitleInTree = true)
private String path;
The resulting xml for this line looks like this:
<path allowBlank="{Boolean}false" escapeAmp="{Boolean}false" fieldLabel="Path" hideLabel="{Boolean}false" hideTrigger="{Boolean}false" jcr:primaryType="cq:Widget" name="path" parBrowse="{Boolean}false" rootPath="/content/" rootTitle="Websites" showTitleInTree="{Boolean}true" xtype="pathfield"/>
but I expected to see width="230" included.
Note that there are other properties which may need to be included on PathFields using additionalProperties in the future.
Hi,
We are using AEM 6.5, uber jar version 6.5.0 and using cq-component-maven-plugin 6.4.0 for dialog creation.
When dialog created by extend feature from another class, a tab node of gets created of
sling:resourceType: "granite/ui/components/coral/foundation/tabs"
in addition to sling:resourceType: granite/ui/components/foundation/section created by @tab annotation.
Can you please let us know if we are missing anything here?
Thanks
When used the same in AEM 6.3, uber jar 6.3 and with cq-component-maven-plugin 5.0.0 with @tab annotation, node with gets created with below resourceType.
sling:resourceType: granite/ui/components/foundation/section
Users should have the option of using the new cq/gui/components/common/tagspicker
resource type for Touch UI tag input fields as opposed to the legacy granite/ui/components/foundation/form/autocomplete
resource type. This should be enabled via a feature flag to support backwards compatibility.
Touch UI drastically changes how dialogs work in situations where components inherit from each other. These changes are not in line with the paradigm exposed by the component plugin currently. Updates should be made to allow more granular control over the merged dialogs.
Hi,
I am using AEM 6.5 and using cq-component-maven-plugin for dialog creation.
@switch anotation is not working as expected when used with 6.5 uber jar and 6.4.0 cq-component-maven-plugin.
The offText and onText values doesn't display in the dialog.
Thanks
Addition of a @DialogFields
annotation. This would behave similar to the @DialogFieldSet
annotation in that it would annotate a member whose type is an annotated Class however instead of inserting the Class's widgets in a dialog field set the widgets would be inserted inline amongst those of the containing Class.
When using @selection to create a drop down field a new node called "item" is being added next to the datasource node and this causes the drop down field to not load options. It does not make the datasource work.
This only happens when Service Pack 1 is installed for AEM 6.1.
I've attached a screenshot highlighting the extra node item that needs to be removed and another screenshot of a working drop down field where the datasource works.
Complimenting the generateTouchUiDialogs
configuration I am hereby requesting the addition of a generateClassicUiDialogs
configuration to the plugin. This property would default to true
. When set to false
it would suppress creation of dialog.xml files for all annotated components.
Recently upgraded our AEM servers to 6.3 sp3cfp1 and the rich text dialog field errors out on AEMs validation (file /libs/cq/gui/components/authoring/dialog/richtext/clientlibs/rte/coralui3/js/validation.js line 84). It's missing a data property called 'rteinstance'. This makes the RTE dialog field un-editable along with breaking some other dialog options. We are using the Rich Text Editor Widget (com.citytechinc.cq.component.annotations.widgets.RichTextEditor).
There is a typo on this page
http://code.digitalatolson.com/cq-component-maven-plugin/configuration.html
The following
excludedDependencies
should be changed to
excludeDependencies
according to the mojo field name
Currently, trying to do this ends in an error
@DialogField(fieldLabel = "Combo", additionalProperties = [@Property(name="granite:id", value="test"])
@Selection(type = Selection.SELECT, options=[
@Option(text="Option 1", value="option1"),
@Option(text="Option 2", value="option2")
])
@Inject
String combo
Particularly the part about "granite:id"
is what causes issues.
[INFO] --- cq-component-maven-plugin:4.1.0-SNAPSHOT:component (default) @ XXXXXX ---
ERROR: 'Namespace for prefix 'granite' has not been declared.'
[ERROR] java.lang.RuntimeException: Namespace for prefix 'granite' has not been declared.
javax.xml.transform.TransformerException: java.lang.RuntimeException: Namespace for prefix 'granite' has not been declared.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:755)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)
at com.citytechinc.cq.component.xml.XmlWriter.writeXml(XmlWriter.java:76)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.writeElementToFile(ComponentMojoUtil.java:660)
at com.citytechinc.cq.component.dialog.util.DialogUtil.writeDialogToFile(DialogUtil.java:82)
at com.citytechinc.cq.component.dialog.util.DialogUtil.buildDialogsFromClassList(DialogUtil.java:156)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.buildArchiveFileForProjectAndClassList(ComponentMojoUtil.java:246)
at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Namespace for prefix 'granite' has not been declared.
at com.sun.org.apache.xml.internal.serializer.SerializerBase.getNamespaceURI(SerializerBase.java:914)
at com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute(SerializerBase.java:431)
at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.addAttribute(ToUnknownStream.java:316)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:201)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:136)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:98)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:702)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:746)
... 29 more
---------
java.lang.RuntimeException: Namespace for prefix 'granite' has not been declared.
at com.sun.org.apache.xml.internal.serializer.SerializerBase.getNamespaceURI(SerializerBase.java:914)
at com.sun.org.apache.xml.internal.serializer.SerializerBase.addAttribute(SerializerBase.java:431)
at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.addAttribute(ToUnknownStream.java:316)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:201)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:230)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:136)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:98)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:702)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:746)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359)
at com.citytechinc.cq.component.xml.XmlWriter.writeXml(XmlWriter.java:76)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.writeElementToFile(ComponentMojoUtil.java:660)
at com.citytechinc.cq.component.dialog.util.DialogUtil.writeDialogToFile(DialogUtil.java:82)
at com.citytechinc.cq.component.dialog.util.DialogUtil.buildDialogsFromClassList(DialogUtil.java:156)
at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.buildArchiveFileForProjectAndClassList(ComponentMojoUtil.java:246)
at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:113)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Why would I want to be doing this instead of using cssClass?
In order to set an element id in touch ui on the select list so that I can listen for events with javascript in some custom client libs, cssClass would have the same effect and currently works ("granite:class" doesn't!) but this should work too.
see below for more of an idea of the kinds of things we can set via properties in touch ui.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.