Giter Club home page Giter Club logo

aem-component-generator's Introduction

AEM Component Generator

CircleCI

AEM Component Generator is a java project that enables developers to generate the base structure of an AEM component using a JSON configuration file specifying component and dialog properties and other configuration options.

Generated code includes:

  • cq:dialog for component properties
    • dialogshared/dialogglobal for shared/global component properties
    • Supports all basic field types, multifields, and image upload fields
  • Sling Model
    • Includes fully coded interface and implementation classes
    • Follows WCM Core component standards
    • Enables FE-only development for most authorable components
  • HTL file for rendering the component
    • Includes an object reference to the Sling Model
    • Includes the default WCM Core placeholder template for when the component is not yet configured
  • Stubbed clientlib (JS/CSS) following component client library patterns of WCM Core

Dependencies

The AEM Component Generator itself bundles all the dependencies it needs to execute. However, the generated code has dependencies on ACS AEM Commons version 4.2.0+ for the following sling model injector annotations.

  • @ChildResourceFromRequest for injecting child resources as model classes (e.g. image fields, composite multifields)
  • @SharedValueMapValue for injecting shared/global component property field values

How To Use

To see the AEM Component Generator in action, watch this video. Detailed steps for using the generator are found below.

Step 1: Clone the project from github.

Step 2: Update the demo config file (data-config.json) to your company defaults, removing references to NewCo/newco in the project-settings and group values.

Step 3: Build the project by running mvn clean install from the main project folder.

Step 4: Copy the generated component-generator-N.N.jar file (under the target folder) to a location from which you wish to generate AEM component code. Note that code will be generated at a relative path from which the generator is executed, which can be different from where the jar file is located.

Step 5: Copy the data-config.json file from this project to the same location and update with relevant configs for your component.

  • project-settings: contains configuration options related to your AEM project
  • project-settings.code-owner: the name of the company/user this code belongs to - will replace ${CODEOWNER} in the template files with this configured value
  • project-settings.copyright-year: the copyright year this code belongs to - will replace ${YEAR} in the template files with this configured value. If one is not specified, will default to the current year.
  • project-settings.bundle-path: path to the java code of your main bundle
  • project-settings.test-path: path to the java code of your test cases
  • project-settings.apps-path: path to the /apps root
  • project-settings.component-path: path to the project's components directory, relative to the /apps folder
  • project-settings.model-interface-pkg: Java package for the interface model objects
  • project-settings.model-impl-pkg: Java package for the implementation model objects
  • name: folder name for the component
  • title: human readable component name, also used as the title for dialogs
  • group: component group
  • type: component folder type - content, form, structure
  • options.js: whether to create an empty JS lib for the component (shared with CSS lib)
  • options.jstxt: whether to create the js.txt mapping file within the clientlib. Set to false when this file is not needed within your clientlib
  • options.css: whether to create an empty CSS lib for the component (shared with JS lib)
  • options.csstxt: whether to create the css.txt mapping file within the clientlib. Set to false when this file is not needed within your clientlib
  • options.html: whether to create a default HTML file for the component
  • options.html-content: generate dialog fields in the html file
  • options.slingmodel: whether to create a sling model for the component
    • Class name is derived from converting "name" prop above to camel case (e.g. "google-maps" -> GoogleMaps/GoogleMapsImpl)
    • Fields are derived from dialog properties (see below)
  • options.testclass: whether to create a test class for the component's sling model
    • Test methods will fail with reason as yet to be implemented.
  • options.junit-major-version: provide major version identifier of junit to generate test classes accordingly. Currently, 4 or 5 is supported.
  • options.content-exporter: whether to configure sling model for content export
  • options.model-adaptables: array of adaptables to include in the Sling Model ('request' and/or 'resource')
  • options.generic-javadoc: whether to create generic javadoc for the getters in the model interface
  • options.properties-tabs: properties to create tabs structure in standard dialog for this component. If empty, properties will be created without tab structure
    • options.properties-tabs[].id: the tab "name"
    • options.properties-tabs[].label: the "title" of the tab
    • options.properties-tabs[].fields: all the properties to be added in the tab.
  • options.properties-shared-tabs: shared properties to create tabs structure for this component in shared dialog. If empty, properties will be created without tab structure in shared dialog for this component.
    • options.properties-shared-tabs[].id: the tab "name"
    • options.properties-shared-tabs[].label: the "title" of the tab
    • options.properties-shared-tabs[].fields: all the properties to be added in the tab.
  • options.properties-global-tabs: global properties to create in tabs for this component in global dialog. If empty, properties will be created without tab structure in global dialog for this component.
    • options.properties-global-tabs[].id: the tab "name"
    • options.properties-global-tabs[].label: the "title" of the tab
    • options.properties-global-tabs[].fields: all the properties to be added in the tab.
  • options.properties: properties to create in standard dialog for this component. If empty, no standard dialog will be created. This sample includes one of every possible sling:resourceType
    • options.properties[].field: the property "name" and java variable name.
    • options.properties[].javadoc: the javadoc associated with the property
    • options.properties[].type: the property field type
    • options.properties[].label: the fieldLabel associated with the property
    • options.properties[].description: the fieldDescription associated with the property
    • options.properties[].items: any child items needed for the specified property type
    • options.properties[].attributes: any additional attributes to be associated with property in cq:dialog
    • options.properties[].model-name: (Multifield type Only) the name of the sling model class generated for a multifield property
    • options.properties[].use-existing-model: (Multifield type Only) whether or not to generate a new sling model for the multifield property
    • options.properties[].json-expose: by default, the content exporter will ignore all properties unless json-expose is set to true
    • options.properties[].json-property: the json key for the property to be used when content export is configured
  • options.properties-shared: properties to create in shared dialog for this component. If empty, no shared dialog will be created
  • options.properties-global: properties to create in global dialog for this component. If empty, no global dialog will be created

Step 6: To generate a component, navigate to the main folder of your AEM project and execute the following command. Note that paths specified in project-settings configs (above) will be relative to this location.

$ java -jar <jarfile> <configfile>
  • jarfile: path to component-generator-N.N.jar file (replacing N.N with the applicable numbers)
  • configfile: path to data-config.json file

Example:

$ java -jar scripts/compgen/component-generator-1.0.jar scripts/compgen/data-config.json

Successful component generation should result in output similar to the following:

[17:57:50.427 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/.content.xml
[17:57:50.441 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/_cq_dialog/.content.xml
[17:57:50.443 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/dialogglobal/.content.xml
[17:57:50.446 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/dialogshared/.content.xml
[17:57:50.447 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/clientlibs/.content.xml
[17:57:50.453 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/clientlibs/site/css/demo-comp.less
[17:57:50.454 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/clientlibs/site/js/demo-comp.js
[17:57:50.456 [INFO ] CommonUtils @93] - Created: ui.apps/src/main/content/jcr_root/apps/newco/components/content/demo-comp/demo-comp.html
[17:57:50.456 [INFO ] ComponentUtils @85] - --------------* Component 'demo-comp' successfully generated *--------------
[17:57:50.476 [INFO ] CommonUtils @93] - Created: core/src/main/java/com/newco/aem/base/core/models/DemoComp.java
[17:57:50.488 [INFO ] CommonUtils @93] - Created: core/src/main/java/com/newco/aem/base/core/models/impl/DemoCompImpl.java
[17:57:50.488 [INFO ] JavaCodeModel @103] - --------------* Sling Model successfully generated *--------------

Troubleshooting

JSON Export Failing

If you attempt to fetch your component's model json via a .model.json selector/extension and get the following error:

Invalid recursion selector value 'model'

Cannot serve request to /content/<site>/<path-to-page>/jcr:content/<path-to-component>.model.json in org.apache.sling.servlets.get.DefaultGetServlet

The most likely cause is that your sling model is not actually deployed to AEM. To validate, first check the bundles console in AEM at /system/console/bundles to validate that your java bundle containing the generated sling model is indeed on the server and in Active state. Assuming it is, check the Sling Models console at /system/console/status-slingmodels to validate that your sling model is deployed and running. The default demo-comp component produced by the data-config.json provided with the project should generate a fully deployable and functioning sling model. If you are experiencing this error with the demo component, the most likely cause is that either your build failed to deploy the java bundle to the AEM server, or the bundle deployed to the server but is not running.

Shared Property Injection Failing

If your logs have an error that looks like this:

Caused by: java.lang.IllegalArgumentException: No Sling Models Injector registered for source 'shared-component-properties-valuemap'.


This is because you do not have Shared Component Properties configured on your AEM instance. This often happens to people experimenting with the demo data-config.json provided with the project, which creates a component with both a shared and a global property for testing.

To resolve this issue, you can configure Shared Component Properties on your AEM instance if you plan to use that feature in your components. If you dont plan to use Shared Component Properties, however, empty out (or delete) the following values inside of the data-config.json file used to generate your component: properties-shared-tabs, properties-shared, properties-global-tabs, properties-global. Once this is complete, regenerate your component, which will remove any fields in your sling model attempting to be injected by @SharedValueMapValue.

Contributing

Originally developed and contributed by Bounteous.

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

aem-component-generator's People

Contributors

adamcin avatar avinashtalamanchi avatar brandonmaynard avatar brandonmaynardbounteous avatar brian-langeland avatar derthenier avatar hitmaninwis avatar karollewandowski avatar sudheerdvn avatar sujeet-singh avatar vladbailescu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aem-component-generator's Issues

Tab Feature in the Component Generator

I was trying to use the aem-component-generator and able to successfully generate dialog and sling models.

First of all, it is a great feature which makes our regular work easy to start on creating any new component. Thank you for making it available.

Most of the times, we have to create multiple tabs in the components, Do we have any options already available to create tabs in the dialog?

I have modified the code a little bit in my local and able to create the multiple tabs in the dialog and able to pull the same properties in sling model. but that is still in draft and might need to cover more test cases and finalize the approach. Would like to check if the feature is already planned and some one is working on it.

Error while trying to use component on page

Hi ,

I have created a basic component , but then when i try to use it on the page , shows the following error

image
My Bundle is active

Interface

package com.aem.geeks.core.models;

public interface Component {

String getFirstName();

String getLastName();

String getGender();

Integer getPhoneNo();

}

Java class

package com.aem.geeks.core.models.impl;

import javax.annotation.PostConstruct;

import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Via;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

import com.aem.geeks.core.models.Component;

@model(adaptables = SlingHttpServletRequest.class,
adapters = Component.class,
defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED)
public class Componentimpl implements Component {

@ValueMapValue
@Via("resource") @Default(values = "****")
String fname;

@ValueMapValue
@Default(values = "####")
String lname;

@ValueMapValue
String gender;

@ValueMapValue
Integer phno;

@PostConstruct
public void init() {
	// init
}

@Override
public String getFirstName() {
	return fname;
}

@Override
public String getLastName() {
	return lname;
}

@Override
public String getGender() {
	return gender;
}

@Override
public Integer getPhoneNo() {

	return phno;
}

}

Add generated clientlib files

Would it make sense to generate the clientlib definition in clientlibs/site? At the very least, we can stub the categories and dependencies like how we stub the isConfigured on the HTL.

Also, I think it would make sense to autogenerate the 'js.txt' and 'css.txt' files and include the paths/filenames for the autogenerated JS/CSS files as well. Thoughts?

Dialog radio button considered internal by OakPAL

The component generator is creating radio buttons with sling:resourceType="granite/ui/components/coral/foundation/form/radio". However, OakPAL is flagging this as an error.

[ERROR]    +- <MAJOR> /apps/aem-activate/components/content/demo-comp/cq:dialog/content/items/tabs/items/tab-1/items/column/items/radioTest/items/radio1 [restricted resource type]: /libs/granite/ui/components/coral/foundation/form/radio is implicitly marked INTERNAL [aem-activate.ui.apps-5.1.0-SNAPSHOT.zip]
[ERROR]    +- <MAJOR> /apps/aem-activate/components/content/demo-comp/cq:dialog/content/items/tabs/items/tab-1/items/column/items/radioTest/items/radio2 [restricted resource type]: /libs/granite/ui/components/coral/foundation/form/radio is implicitly marked INTERNAL [aem-activate.ui.apps-5.1.0-SNAPSHOT.zip]

Minor javadoc bug for mulitifields - unclosed "HTML" elements

When default javadocs are generated for multifields, the resulting javadoc can trigger a codestyle failure for "unclosed HTML".

e.g. @return List<String> is parsed as an unclosed <String> element

Looks like we need to HTML escape the javadocs

Maintained by Bounteous?

Would it make sense to have at least one Bounteous dev added as a maintainer for this project, being the original contributors?

Sling Error after component creation

I follow up all steps, but at the end I always get this error when I drop my component:
`Error during include of component '/apps/wdm/components/content/wdm-demo-comp'Error Message:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/wdm/components/content/wdm__002d__demo__002d__comp/wdm__002d__demo__002d__comp_html.java:
Line 28, column 1292 : Only a type can be imported. com.aem.wdm.train.core.models.WdmDemoComp resolves to a package
Line 44, column 1925 : WdmDemoComp cannot be resolved to a typeProcessing Info:

Page=/content/wdm/en/about-usResource Path=/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_compCell=wdm-demo-compCell Search Path=page|basicpage/root|responsivegrid/responsivegrid/wdm-demo-compComponent Path=/apps/wdm/components/content/wdm-demo-comp
Sling Request Progress:
0 TIMER_START{Request Processing}
2 COMMENT timer_end format is {,}
6 LOG Method=GET, PathInfo=null
7 TIMER_START{handleSecurity}
1072 TIMER_END{1063,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@db1ed68 returns true
1445 TIMER_START{ResourceResolution}
1593 TIMER_END{145,ResourceResolution} URI=/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp.html resolves to Resource=JcrNodeResource, type=wdm/components/content/wdm-demo-comp, superType=null, path=/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp
1607 LOG Resource Path Info: SlingRequestPathInfo: path='/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp', selectorString='null', extension='html', suffix='null'
1608 TIMER_START{ServletResolution}
1611 TIMER_START{resolveServlet(/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp)}
1627 TIMER_END{15,resolveServlet(/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp)} Using servlet /apps/wdm/components/content/wdm-demo-comp/wdm-demo-comp.html
1630 TIMER_END{21,ServletResolution} URI=/content/wdm/en/about-us/jcr:content/root/responsivegrid/wdm_demo_comp.html handled by Servlet=/apps/wdm/components/content/wdm-demo-comp/wdm-demo-comp.html
1636 LOG Applying Requestfilters
1638 LOG Calling filter: com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl
1643 LOG Calling filter: org.apache.sling.security.impl.ContentDispositionFilter
1645 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter
1646 LOG Calling filter: com.adobe.granite.httpcache.impl.InnerCacheFilter
1653 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
1655 LOG Calling filter: com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker
1657 LOG Calling filter: com.adobe.cq.history.impl.HistoryRequestFilter
1972 LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter
1987 LOG Calling filter: com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet
1991 LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter
1996 LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet
1999 LOG Calling filter: com.adobe.cq.social.commons.cors.CORSAuthenticationFilter
2003 LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
2005 LOG Calling filter: com.adobe.community.core.filters.LoggingFilter
2009 LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter
2012 LOG Calling filter: com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl
2233 LOG Calling filter: com.adobe.granite.csrf.impl.CSRFFilter
2238 LOG Calling filter: com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter
2286 LOG Calling filter: com.adobe.granite.requests.logging.impl.RequestLoggerImpl
2295 LOG Calling filter: com.adobe.granite.rest.impl.servlet.ApiResourceFilter
2352 LOG Calling filter: com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet
2355 LOG Calling filter: com.day.cq.wcm.core.impl.warp.TimeWarpFilter
2362 LOG Calling filter: com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler
2365 LOG Calling filter: com.day.cq.dam.core.impl.servlet.ActivityRecordHandler
2380 LOG Applying Componentfilters
2381 LOG Calling filter: com.day.cq.personalization.impl.TargetComponentFilter
2384 LOG Calling filter: com.day.cq.wcm.core.impl.PageLockFilter
2386 LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter
4731 LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html], order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobile: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=mobiledebug, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobiledebug: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=contentsync, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-contentsync: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), serializer=Config(type=htmlwriter, config={}))}
5891 LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter
5911 TIMER_START{/apps/wdm/components/content/wdm-demo-comp/wdm-demo-comp.html#0}
31059 LOG SCRIPT ERROR: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/wdm/components/content/wdm__002d__demo__002d__comp/wdm__002d__demo__002d__comp_html.java:/Line 28, column 1292 : Only a type can be imported. com.aem.wdm.train.core.models.WdmDemoComp resolves to a package/Line 44, column 1925 : WdmDemoComp cannot be resolved to a type
31095 TIMER_END{25182,/apps/wdm/components/content/wdm-demo-comp/wdm-demo-comp.html#0}
33061 TIMER_END{33059,Request Processing} Dumping SlingRequestProgressTracker Entries

Full Exception:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/wdm/components/content/wdm__002d__demo__002d__comp/wdm__002d__demo__002d__comp_html.java:
Line 28, column 1292 : Only a type can be imported. com.aem.wdm.train.core.models.WdmDemoComp resolves to a package
Line 44, column 1925 : WdmDemoComp cannot be resolved to a type
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278)
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:373)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.PageLockFilter.doFilter(PageLockFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:154)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:437)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:114)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:134)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:372)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.community.core.filters.LoggingFilter.doFilter(LoggingFilter.java:56)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:107)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:126)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:122)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:87)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:152)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:73)
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:83)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:234)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:120)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:328)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:96)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:72)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigurer.java:63)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:147)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1000)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:91)
at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:534)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/wdm/components/content/wdm__002d__demo__002d__comp/wdm__002d__demo__002d__comp_html.java:
Line 28, column 1292 : Only a type can be imported. com.aem.wdm.train.core.models.WdmDemoComp resolves to a package
Line 44, column 1925 : WdmDemoComp cannot be resolved to a type
at org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:183)
at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.internalCompile(SightlyScriptEngine.java:157)
at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptEngine.java:89)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:379)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
... 125 more
Caused by: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/wdm/components/content/wdm__002d__demo__002d__comp/wdm__002d__demo__002d__comp_html.java:
Line 28, column 1292 : Only a type can be imported. com.aem.wdm.train.core.models.WdmDemoComp resolves to a package
Line 44, column 1925 : WdmDemoComp cannot be resolved to a type
at org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService.compileSource(SightlyJavaCompilerService.java:173)
... 130 more

Day Communique 5 WCM Core Implementation / 5.11.218 ( (c) Adobe Systems Incorporated ) running on ApacheSling/2.6 (jetty/9.3.22.v20171030, Java HotSpot(TM) 64-Bit Server VM 1.8.0_161, Windows 10 10.0 amd64)`

No use provider could resolve identifier

i am taking data from json using js,servlet and htl in AEM but i am getting below error

org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier content/dam/employee/employees.json

i think there is issue with bundles ( but i have active bundles)in that i cant see my core files and also in target folder there is no data comping from backend only frontend data it there. Can you help me with this?

Support multifield-nested image fields in generated dialogs

Expected Behaviour

For the most part, an image field included in a composite multifield should support the same drag-drop behavior as an image field that is not included in a multifield.

Actual Behaviour

Currently, the generated image field supports file upload, but not drag-drop, and the component fails to render the uploaded image after submitting the dialog.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

For a standalone image field:

            {
                "field": "imageTest",
                "type": "image",
                "label": "Image Test",
                "json-expose": true
            },

the following dialog xml is generated:

<imageTest 
    fieldLabel="Image Test"
    jcr:primaryType="nt:unstructured"        
    sling:resourceType="cq/gui/components/authoring/dialog/fileupload"                                             
    name="./imageTest/file"
    allowUpload="{Boolean}false"
    autoStart="{Boolean}false"
    class="cq-droptarget"
    fileReferenceParameter="./imageTest/fileReference"
    mimeTypes="[image/gif,image/jpeg,image/png,image/webp,image/tiff,image/svg+xml]"
    multiple="{Boolean}false"
    title="Drag to select image"
    uploadUrl="${suffix.path}"
    useHTML5="{Boolean}true"                                          
/>
<imageTestResType
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/hidden"                                                     
    name="./imageTest/sling:resourceType"
    value="core/wcm/components/image/v2/image"
/>

For the same property config json nested in the items of a multifield, the following dialog xml is generated:

<imageTest 
    fieldLabel="Image Test"
    jcr:primaryType="nt:unstructured"                                                     
    name="./imageTest"                                                 
    sling:resourceType="cq/gui/components/authoring/dialog/fileupload"/>

Logs taken while reproducing problem

Additional features request

Could the project also support groovy + spock tests and a boolean flag whether to generate copyright comment or not? Thanks in advance

Replace @ConsumerType annotation from Bnd with OSGi?

Very interesting project.

I'm curious whether aQute.bnd.annotation.ConsumerType annotation should be replaced with org.osgi.annotation.versioning.ConsumerType.

This seems to be the case for the wcm-core-components?

Error during include of component '/apps/asset-share-commons/components/details/audio'

Error during include of component '/apps/asset-share-commons/components/details/audio'
Error Message:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.adobe.aem.commons.assetshare.components.details.Audio
Processing Info:
Page = /content/asset-share-commons/en/dark/details/audio
Resource Path = /content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113
Cell = audio
Cell Search Path = details-page|page|basicpage/root/main|responsivegrid/responsivegrid/audio
Component Path = /apps/asset-share-commons/components/details/audio
Sling Request Progress:
0 TIMER_START{Request Processing}
1 COMMENT timer_end format is {,}
5 LOG Method=GET, PathInfo=null
6 TIMER_START{handleSecurity}
3523 TIMER_END{3515,handleSecurity} authenticator org.apache.sling.auth.core.impl.SlingAuthenticator@663e80c3 returns true
202708 TIMER_START{ResourceResolution}
202852 TIMER_END{143,ResourceResolution} URI=/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113.html resolves to Resource=JcrNodeResource, type=asset-share-commons/components/details/audio, superType=null, path=/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113
202861 LOG Resource Path Info: SlingRequestPathInfo: path='/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113', selectorString='null', extension='html', suffix='null'
202861 TIMER_START{ServletResolution}
202864 TIMER_START{resolveServlet(/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113)}
202873 TIMER_END{8,resolveServlet(/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113)} Using servlet /apps/asset-share-commons/components/details/audio/audio.html
202876 TIMER_END{14,ServletResolution} URI=/content/asset-share-commons/en/dark/details/audio/jcr:content/root/main/responsivegrid/audio_850133113.html handled by Servlet=/apps/asset-share-commons/components/details/audio/audio.html
202885 LOG Applying Requestfilters
202890 LOG Calling filter: com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl
202895 LOG Calling filter: org.apache.sling.security.impl.ContentDispositionFilter
202897 LOG Calling filter: com.adobe.granite.csrf.impl.CSRFFilter
202902 LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter
202907 LOG Calling filter: com.adobe.granite.httpcache.impl.InnerCacheFilter
202910 LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter
202913 LOG Calling filter: com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker
202916 LOG Calling filter: com.adobe.cq.history.impl.HistoryRequestFilter
203158 LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter
203169 LOG Calling filter: com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet
203172 LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter
203176 LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet
203179 LOG Calling filter: com.adobe.cq.social.commons.cors.CORSAuthenticationFilter
203181 LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter
203184 LOG Calling filter: com.mb.microsites.core.filters.LoggingFilter
203273 LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter
203276 LOG Calling filter: com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl
203544 LOG Calling filter: com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter
203547 LOG Calling filter: com.adobe.granite.requests.logging.impl.RequestLoggerImpl
203552 LOG Calling filter: com.adobe.granite.rest.impl.servlet.ApiResourceFilter
203577 LOG Calling filter: com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet
203579 LOG Calling filter: com.day.cq.wcm.core.impl.warp.TimeWarpFilter
203586 LOG Calling filter: com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler
203590 LOG Calling filter: com.day.cq.dam.core.impl.servlet.ActivityRecordHandler
203600 LOG Applying Componentfilters
203603 LOG Calling filter: com.day.cq.personalization.impl.TargetComponentFilter
203605 LOG Calling filter: com.day.cq.wcm.core.impl.page.PageLockFilter
203608 LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter
204887 LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html], order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobile: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=mobiledebug, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-mobiledebug: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), Config(type=contentsync, config=JcrPropertyMap [node=Node[NodeDelegate{tree=/libs/cq/config/rewriter/default/transformer-contentsync: { jcr:primaryType = nt:unstructured, component-optional = true}}], values={jcr:primaryType=nt:unstructured, component-optional=true}]), serializer=Config(type=htmlwriter, config={}))}
205106 LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter
205116 TIMER_START{/apps/asset-share-commons/components/details/audio/audio.html#0}
210276 LOG SCRIPT ERROR: No use provider could resolve identifier com.adobe.aem.commons.assetshare.components.details.Audio
210325 TIMER_END{5207,/apps/asset-share-commons/components/details/audio/audio.html#0}
212501 TIMER_END{212500,Request Processing} Dumping SlingRequestProgressTracker Entries
Full Exception:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.adobe.aem.commons.assetshare.components.details.Audio
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278)
at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:373)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:76)
at com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:141)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:437)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.social.ugcbase.security.impl.SaferSlingPostServlet.doFilter(SaferSlingPostServlet.java:114)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:134)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.AuthoringUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:372)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:248)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.mb.microsites.core.filters.LoggingFilter.doFilter(LoggingFilter.java:56)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:107)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthenticationFilter.java:91)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:138)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:76)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.foundation.forms.FormsHandlingServletHelper.handleFilter(FormsHandlingServletHelper.java:226)
at com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlet.java:126)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:122)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.cq.mcm.campaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:87)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:81)
at com.adobe.granite.httpcache.impl.InnerCacheFilter.doFilter(InnerCacheFilter.java:60)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at com.adobe.granite.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:152)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
at com.adobe.granite.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:83)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)
at org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:244)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:123)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86)
at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:286)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:72)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigurer.java:63)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)
at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)
at org.apache.felix.http.base.internal.dispatch.Dispatcher$1.doFilter(Dispatcher.java:146)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1002)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:326)
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:97)
at org.apache.felix.http.base.internal.handler.PreprocessorHandler.handle(PreprocessorHandler.java:136)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)
at org.apache.felix.http.base.internal.whiteboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1012)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:91)
at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1668)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:502)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.sling.scripting.sightly.SightlyException: No use provider could resolve identifier com.adobe.aem.commons.assetshare.components.details.Audio
at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:80)
at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77)
at org.apache.sling.scripting.sightly.apps.asset__002d__share__002d__commons.components.details.audio.audio_html.render(audio_html.java:43)
at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50)
at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
... 132 more

Jackson dependency version too wide

Hi, there is a problem with jackson-databind dependency. Currently, it is defined as:

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>[2.9.9.1,)</version>
</dependency>

Today I tried to build the project and was getting an error that ObjectMapper class doesn't have configure() method.
This is because in jackson-databind 3.0 they moved configure methods to MapperBuilder.
Dependency should be less than 3.0.

Create Configuration for Code Owner

In all of our template text files, we have <CODEOWNER> and a manual step in the README.md to replace this value. We should make this a project setting configuration and programmatically replace this value with the configured value.

Once #9 is merged, I will create a PR for this change (I have the changes already coded but I was using #9's branch to avoid conflicts)

Generator dependency/ Pre-requisite

May I know what minimum version of AEM and acs commons is required for this to work? I tried to use component generator with AEM 6.6.3 and acs-aem-commons-content-3.14.12 there are few annotations that were not supported. I am getting error like follows:

com.adobe.acs.commons.models.injectors.annotation does not exist
[ERROR] symbol: class ChildResourceFromRequest
[ERROR] location: class com.company.components.impl.DemoCompImpl

I think README.md file should mention minimum requirements.

Error while including component on page

While including the generated component in my page im getting the below issue:
org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: No use provider could resolve identifier com.cognizant.core.models.DemoComp

The bundle is however in active state.

Issue in test case with help of Junit

Hi ,for the same component above , I am trying to write down a testcase with help of Junit , but there are errors throwing up

image
image
this is the error im getting

This is my test class.
package com.aem.geeks.core.models.impl;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.aem.geeks.core.models.Component;

import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.testing.mock.aem.junit5.AemContextExtension;

@ExtendWith(AemContextExtension.class)
class ComponentimplTest {
private final AemContext ctx = new AemContext();

@BeforeEach
void setUp() throws Exception {
	ctx.addModelsForClasses(Componentimpl.class);
    ctx.load().json("/com/aem/geeks/core/models/ComponentimplTest.json", "/content");
    
    
}


@Test
void testGetFirstName() {
	
	final String expected = "Jane";
	
	 ctx.currentResource("/content/component");
	    Component component = ctx.request().adaptTo(Component.class);

	    String actual = component.getFirstName();

	    assertEquals(expected, actual);
	
	
}

@Test
void testGetLastName() {
	final String expected = "Doe";
	
	 ctx.currentResource("/content/component");
	    Component component = ctx.request().adaptTo(Component.class);

	    String actual = component.getLastName();

	    assertEquals(expected, actual);
}

@Test
void testGetGender() {
	final String expected = "Female";
	
	 ctx.currentResource("/content/component");
	    Component component = ctx.request().adaptTo(Component.class);

	    String actual = component.getGender();

	    assertEquals(expected, actual);
}

@Test
void testGetPhoneNo() {
	fail("Not yet implemented");
}

}

Mock Json class
{
"component": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "aemgeeks/components/content/component",
"firstname": "Jane",
"lastname": "Doe",
"gender": "Female"

}

}

Originally posted by @Harshitha942 in #41 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.