adobe-consulting-services / acs-aem-samples Goto Github PK
View Code? Open in Web Editor NEWAEM Code Samples repository
Home Page: http://adobe-consulting-services.github.io/acs-aem-samples/
License: Apache License 2.0
AEM Code Samples repository
Home Page: http://adobe-consulting-services.github.io/acs-aem-samples/
License: Apache License 2.0
Running the Maven command with Maven Version 3.3.3
mvn clean install -PautoInstallBundle
results into the following error:
[ERROR] Failed to execute goal com.day.jcr.vault:content-package-maven-plugin:0.
0.23:package (default-package) on project acs-aem-samples-content: Execution def
ault-package of goal com.day.jcr.vault:content-package-maven-plugin:0.0.23:packa
ge failed: A required class was missing while executing com.day.jcr.vault:conten
t-package-maven-plugin:0.0.23:package: org/slf4j/helpers/MarkerIgnoringBase
When switching to Maven 3.0.5 everything is fine and the package is being deployed.
Is this a Maven issue or an issue here?
Hi @alexkli Could you take a look at:
And let me know if it makes sense, or if there are any efficiencies.
@andrewmkhoury any chance you have a sample sitting around?
These links 404
CQ Workflow Process
Wrapping Workflow Process
Hello,
I have implemented SlingRequestFilter for restricted DAM access. However, launches functionality in AEM has stopped working because of null pointer exception thrown at below line in bold. Could you please advise how I can resolve this or what possible scenario is throwing this exception.
_// Forcing false in this sample so else this will break AEM when installed
if (false && response.getContentType().contains("html")) {
// In this example, checking for html response type since the comments are HTML format and would break
// binary, json, etc. responses
// Write some more content to the response before this chain has executed
//response.getWriter().write("<!-- Written from the Sample Sling Filter BEFORE the next include -->");
// Proceed with the rest of the Filter chain
chain.doFilter(request, response);
// Write some more content to the response after this chain has executed
//response.getWriter().write("<!-- Written from the Sample Sling Filter AFTER the next include -->");
} else {
**chain.doFilter(request, response);**
}
}_
Log file attached.
Thank you,
Create examples for the undocumented QueryBuilder predicates
Would be nice to have a complete custom cloud service example in the repo
The docs provide their own example, which the example could definitely be based off of
Listener is unable to track node move, delete events. Raised a daycare 188141 and 191651 for same.
Today we encountered the problem, that the application behaved differently when called on a JCR resource than on wrapped resource (which is built according to the SampleResourceWrapper).
The application code looked like this:
ValueMap map = resource.adaptTo(ValueMap.class);
Date lastModified = map.get("cq:lastModified", Date.class);
When the resource is a JCR resource, a correct Date object is returned, if the Resource is a SampleResourceWrapper, null is returned (even if the property comes from the wrapped resource and is not injected by the wrapper).
It took us some time to track that back to SLING-6420 (which is likely to be part of AEM 6.3); and our solution was to change the ValueMapDecorator [1] to a CompositeValueMap, which provided the proper semantics.
So can you please adjust the sample?
Per @asanso
If you running AEM on Oak is better you leverage the new native Jaas Osgi native integration support [0] rather than TokenUtil.createCredentials (this create always a token cookie that is not necessary in some situations).
A good example might be the SlingFormAuthenticationHandler [1]
[0] http://felix.apache.org/documentation/subprojects/apache-felix-jaas.html
[1] http://svn.apache.org/repos/asf/sling/trunk/bundles/auth/form/src/main/java/org/apache/sling/auth/form/impl/FormAuthenticationHandler.java
SampleJsonHitWriter.java currently does
final Resource resource = hit.getResource();
final ValueMap properties = resource.adaptTo(ValueMap.class);
but it could use hit.getProperties()
right away, see the javadocs.
This also handles the common jcr:content
nodes and will return a ValueMap based on the jcr:content node, if present.
Hence line 84/85 can be changed from:
jsonWriter.key("key-to-use-in-json").value(properties.get("jcr:content/jcr:title",
"") + "(pulled from jcr:content node)");
to
jsonWriter.key("key-to-use-in-json").value(hit.getProperties().get("jcr:title", "") + "(pulled from jcr:content node)");
We have a felix filter handling the custom authentication in 6.1 similar to this acs aem sample filter. As per specification, Felix filter should get executed before Sling Engine. Thats happening in AEM 6.1 but NOT in AEM 6.2.
Steps to reproduce
04.01.2018 11:31:44.131 *INFO* [qtp1030969174-68] com.sample.project.core.filters.SampleServletFilter Calling Sample Servlet Filter
04.01.2018 11:31:44.132 *INFO* [qtp1030969174-68] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
04.01.2018 11:26:33.364 *INFO* [qtp774039123-271] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
04.01.2018 11:26:33.378 *INFO* [0:0:0:0:0:0:0:1 [1515083193376] GET /libs/granite/core/content/login.html HTTP/1.1] com.sample.project.core.filters.SampleServletFilter Calling Sample Servlet Filter
Tried with service.ranking
property also, but it doesn't seems to be making a difference in AEM 6.2.
Additional Information - We are not yet on AEM 6.3, but tried the filter with modifications . Seems like the behavior is same as AEM 6.2.
Any pointers for this would help.
I'm having trouble seeing any properties changed in my version of AEM 6.3. Am I missing something? They always come back null.
I just pulled down the latest for this project and am trying to build with Java 8 and Maven 3.1.1, and I get the following error on build. Any thoughts?
[ERROR] /Users/brett/Documents/clients/hs2/projects/acs-aem-samples/bundle/src/main/java/com/adobe/acs/samples/migration/impl/SampleContentReplicationHarnessImpl.java [1:1]: @Component : Class must have public default constructor: com.adobe.acs.samples.migration.impl.SampleContentReplicationHarnessImpl
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] ACS AEM Samples - Reactor Project ................. SUCCESS [0.176s]
[INFO] ACS AEM Samples Bundle ............................ FAILURE [3.299s]
[INFO] ACS AEM Samples Content Package ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.231s
[INFO] Finished at: Thu Oct 06 08:48:37 CDT 2016
[INFO] Final Memory: 23M/324M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-descriptor) on project acs-aem-samples-bundle: SCR Descriptor parsing had failures (see log) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-scr-plugin:1.20.0:scr (generate-scr-descriptor) on project acs-aem-samples-bundle: SCR Descriptor parsing had failures (see log)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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: org.apache.maven.plugin.MojoFailureException: SCR Descriptor parsing had failures (see log)
at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:251)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.felix.scrplugin.SCRDescriptorFailureException: SCR Descriptor parsing had failures (see log)
at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:223)
at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:237)
... 21 more
The {{content/pom.xml}} has an embed directive for the content-package plugin to embed the sample bundle. However, the bundle is not embedded, because there isn't a corresponding dependency definition. To further complicate matters, an old SNAPSHOT of the bundle is committed with the project sources at https://github.com/Adobe-Consulting-Services/acs-aem-samples/tree/master/content/src/main/content/jcr_root/apps/acs-samples/install.
This can be very confusing and is certainly nothing like the best-practices that a sample project should be demonstrating.
After fixing this locally, I still had to jump through some hoops to get the bundle to resolve on AEM 6.5. Maybe that's due to issues that have gone unnoticed in smoke tests due to this issue? Or maybe 6.5 is just not supported yet.
It would be nice to have a sample maintenance task.
Hi dudes,
i a veeeery fascinating project, stranger things have happened because some people didn't know about SlingPostProcessor ... https://sling.apache.org/apidocs/sling7/org/apache/sling/servlets/post/SlingPostProcessor.html
Maybe we should get a very veeerrrrrry nice example into ACS samples :-)
I'll try to open up a PR asap...
Sample code using TaskManager and Tasks
@SachinMali has example codes
Fork: https://github.com/davidjgonzalez/acs-aem-samples (master)
Then copy/paste Samples from: https://github.com/activecq/com.activecq.samples/tree/master/core/src/main/java/com/activecq/samples into the acs-aem-samples project.
Migration activities:
Before "migrating" a sample, add it to this comment (and ensure someone else hasn't already claimed the sample for migration)
Create a sample for MSM Liveactions
Unable to compile the code as i could not find the classes com.adobe.acs.samples.querybuilder.facets.SampleSearch and SampleSearchClient which are used in SampleFacetPredicateClientImpl .
Where could i find these classes .
Hi I have the AEM integration issue with our angular2 code. We want to use templates from Adobe AEM and those templates need to be binded with Angular2 component. So there is a need for RuntimeCompiler. With AOT it is not working but without AOT we are able to use Adobe AEM template in our Angular2 Components and compile it dynamically. please let us know how we can do that ?
In SampleResourceDecorator, it mentioned that an HttpServletRequest is no longer called, so a ThreadLocal Sling Filter may be used. However, in my own testing, the Resource Decorator is always called before the Filtering happens, therefore it always receives the default value of the ThreadLocal and not the value from the actual request.
Please switch to OSGi annotations (i.e. https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/adobe/acs/samples/servlets/impl/SampleSafeMethodsServlet.java)
AFAICT, there's no reason for com.adobe.acs.samples.events.impl.SampleJcrEventListener to be an @Service
. JCR EventListeners are not registered through the OSGi service registry and this class doesn't implement any other service interfaces.
Should probably remove this annotation and also the immediate=true
attribute from the @Component
annotation (since components which aren't services are automatically immediate).
Sample Sling Model
I nominate Matthias Wermund's (Acquity Group part of Accenture) ContentBuilder implementation to be included as a sample Replication Serializer:
https://github.com/mwmd/circuit14-aem-replication/tree/master/bundle/src/main/java/com/wmd/serialization/impl
Related SlideShare deck with other potential samples:
http://www.slideshare.net/mwmd/adobe-experience-manager-replication-deep-dive
Dear all,
We have completed an Angular2 project with the AoT and rollup tree-shaking. Now we would like to integrate this app into AEM, but we haven't found any example anywhere.
Do you guys have any ideas how to approach it - any examples we can look into?
Thanks, your help is much appreciated!
Best, Irman
Create org.apache.sling.event.jobs.consumer.JobExecutor example.
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.