sling

cq5 accessing osgi servlet through Url

扶醉桌前 提交于 2019-12-08 05:11:14
问题 I am trying to access following sling servlet using http://localhost:4502/sling/test-services/planet.html But, it is giving 404 error, not sure what I am doing wrong here. @Component @Service(value=javax.servlet.Servlet.class) @Properties({ @Property(name="service.description", value="HTML renderer for Planet resources"), @Property(name="service.vendor", value="The Apache Software Foundation"), @Property(name="sling.servlet.resourceTypes", value="sling/test-services/planet"), @Property(name=

How do I access the properties of a data-sly-list item in Sightly?

流过昼夜 提交于 2019-12-08 04:26:23
问题 I am using Sightly with Sling 8 ( not AEM ). I have the following template: <div data-sly-list.child="${resource.listChildren}"> ${child.name} | ${child.path} | ${child.properties['jcr:title'] || 'no title'} </div> The output ( for a single child ) is hello_world | /content/blog/posts/hello_world | no title I know there is a jcr:title property on the child resource as I have confirmed it using an HTTP call. How can I access the properties on the child object? 回答1: The child is a Resource

How does AEM resolve the JSON extension?

こ雲淡風輕ζ 提交于 2019-12-07 12:25:29
问题 In CQ, if I request a resource such as localhost:4502/content/geometrixx/en.json , I would get the node information in JSON format. The same applies for the XML extension as well. My question is, where is it implemented that the node information is rendered in JSON format if the URL extension is json ? Basically, the extension is just simply text and another part of the URL structure. Simply appending json won't magically fetch the information in JSON format. Obviously, one would have to use

Adobe CQ : Regarding Session in Event Listener

烈酒焚心 提交于 2019-12-06 07:11:40
I have a question regarding event listener. We have a event listener which listen to delete node event and perform some activity say "send email". While code review i found this, although this code is working fine i am not convinced with the session being handled here : @Activate protected void activate(ComponentContext context) { try{ final String path="/content/dam/"; Session session = repository.loginAdministrative(repository.getDefaultWorkspace()); observationManager = session.getWorkspace().getObservationManager(); observationManager.addEventListener(this, Event.PROPERTY_REMOVED, path,

How to add additional element to htmlparser generator

☆樱花仙子☆ 提交于 2019-12-06 06:45:30
问题 I want to rewrite links in attributes of span tags with sling rewrite pipeline. The htmlparser generator only calls "a, link, script, img, form, body" elements. How can I add additional element like span to my transformer? An example configuration would be great! I read that a generator-htmlparser node should be created with the includeTags property, but it doesn't work! I tried to create this node under /apps/MY_APP/config/rewriter. There is also an other generatorType (html-generator),

Is it possible to place variables into a resource path within a sling servlet?

馋奶兔 提交于 2019-12-06 05:03:10
问题 We are trying to provide a clean URI structure for external endpoints to pull json information from CQ5. For example, if you want to fetch information about a particular users history (assuming you have permissions etc), ideally we would like the endpoint to be able to do the following: /bin/api/user/abc123/phone/555-klondike-5/history.json In the URI, we would specifying /bin/api/user/{username}/phone/{phoneNumber}/history.json so that it is very easy to leverage the dispatcher to invalidate

AEM 6.1 Sightly basic form submit and redirect to same page

喜欢而已 提交于 2019-12-06 02:30:13
问题 I am trying to do the following on AEM 6.1: Develop a simple form (3 input fields) Process the submitted values, And redirect to the same page with processed values/result I am able to submit the values to a servlet, and process them (business logic), and the result to a requestparamter so i can retrieve them on the UI. But i am stuck at these: Redirecting to the same page And retrieving the request parameters and display them using Sightly. Code Snippets: Servlet @SlingServlet( methods = {

How does AEM resolve the JSON extension?

谁说胖子不能爱 提交于 2019-12-06 00:12:48
In CQ, if I request a resource such as localhost:4502/content/geometrixx/en.json , I would get the node information in JSON format. The same applies for the XML extension as well. My question is, where is it implemented that the node information is rendered in JSON format if the URL extension is json ? Basically, the extension is just simply text and another part of the URL structure. Simply appending json won't magically fetch the information in JSON format. Obviously, one would have to use this information to write logic for returning the node information in JSON. I'm trying to learn about

how sling rewriter works clarification

北城余情 提交于 2019-12-05 19:46:05
I am trying to understand how sling url rewrite works. I'm following this url - http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration/ Steps I've done in publish environment - /etc/map.publish/http: jcr: primaryType: "sling:OrderedFolder", home: { sling:internalRedirect: ["/content/geometrixx/en.html"], jcr:primaryType: "sling:Mapping", sling:match: "localhost:4503/$" }, localhost.4503: { sling:internalRedirect: ["/content/geometrixx/en"], jcr:primaryType: "sling:Mapping", redirect: { sling:internalRedirect: ["/content/geometrixx/en/$1","/$1"], jcr:primaryType:

How to debug Groovy code via the remote Java application debugging in Eclipse

随声附和 提交于 2019-12-05 14:07:41
I'm struggling to debug an application that builds as a Sling bundle. The application is almost entirely Groovy code (I have the Groovy Eclipse plug-in), and Eclipse (using Maven) is building the .jar and installing it in Sling without any problems. However, it's not able to debug. I have followed instructions to set up remote debugging, which I gather is necessary for debugging Sling apps - specifically, I launch Sling with the following command: java -Xdebug -Xnoagent -Djava.io.tmpdir=/c/Users/nickgolding1/temp -Xmx1024m -Xrunjdwp:transport=dt_socket,address=30303,server=y,suspend=n -jar org