sling

how sling rewriter works clarification

我与影子孤独终老i 提交于 2020-01-02 09:30:12
问题 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

Adobe CQ : Regarding Session in Event Listener

a 夏天 提交于 2020-01-02 09:19:10
问题 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

How to Set UTF-8 response on doPost() call?

你。 提交于 2019-12-25 08:34:40
问题 I Am trying to have a JSON response back to the page with UTF-8 data, as it is what i have posted from the Form to my osgi servlet. The Servlet code is as shown below: import org.json.simple.JSONArray; import org.json.simple.JSONObject; @SlingServlet(paths="/bin/JsonOsgiCall", methods = "POST", metatype=true) public class JsonOsgiCall extends org.apache.sling.api.servlets.SlingAllMethodsServlet { private static final long serialVersionUID = 2598426539166788515L; protected final Logger log =

Sightly Implicit Objects

故事扮演 提交于 2019-12-25 02:45:12
问题 I am trying to implement my own version of WCM's navigation component, whose logic can be found here, subbing my own logic instead: import java.util.*; import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageFilter; import com.adobe.cq.sightly.WCMUsePojo; public class Navigation extends WCMUsePojo{ private Iterator<Page> items; @Override public void activate() throws Exception { Page navRootPage = getCurrentPage().getAbsoluteParent(2); items = navRootPage.listChildren(new PageFilter());

How to render a simple JSP page in CQ?

↘锁芯ラ 提交于 2019-12-25 01:34:28
问题 We have deployed an AngularJS app to CQ5. At the moment, the views for this app are just static HTML files and stored underneath, say, /apps/myapp/views/ : /apps/myapp/views/list.html /apps/myapp/views/view.html etc. Angular then sends AJAX requests to the server and loads and renders these views as needed. We want to add some dynamic content to these pages. For example: <% if (isGordonFreeman()) { %> <button>Launch the Hadron Collider!</button> <% } %> How can this be done in CQ? 回答1: You

AEM 6.3 - ResourceResolverFactory is null in Service and throwing LoginException in Sling Model class

♀尐吖头ヾ 提交于 2019-12-24 19:03:01
问题 1) I am trying to inject ResourceResolverFactory in SlingModel class like this: package com.aem.sites.models; import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; import org.apache.sling.api.resource.LoginException; import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceResolverFactory; import org.apache.sling

How to display values in a List of a SlingModel using Sightly

拈花ヽ惹草 提交于 2019-12-24 17:16:13
问题 I am not able to display values in a lit that are part of a POJO/SlingModel. Please help. Desired Output Commodity 1 Product 1, Product 2, Product 3 Commodity 2 Product 2, Product 4, Product 5 Sightly Code <!-- LIST :: SLING MODEL -- FINAL --> <div data-sly- use.model="${'com.tti.tticommons.service.models.LeadTimeTrendsModel' @ rawJson=ws.JSON}" data-sly-unwrap> <div data-sly-list.commodity="${model.getProductsList}"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class=

Saving Data in JCR Node, what am I doing wrong?

為{幸葍}努か 提交于 2019-12-24 11:27:06
问题 I have created and deployed a bundle(Servlet) successfully that accepts username and password from user, now I want to save it in JCR Repository under /content/mydata/ I am getting Exception java.lang.IllegalArgumentException: relPath is not a relative path: {} {}oliver Here is my code public class CustomerJCRAccessImp implements CustomerService { @Reference protected SlingRepository repository; protected static final Logger log = LoggerFactory.getLogger(CustomerJCRAccessImp.class); public

Is there a way to format multi-valued properties vertically in a Jackrabbit filevault xml doc?

十年热恋 提交于 2019-12-24 07:48:42
问题 We use FileVault xml files in a git repo to configure our custom OSGi services running in our Adobe Experience Manager instance. This works out really well in many cases, but it seems like we have to list multi-valued properties horizontally, in a comma-only-separated string, like this: <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" aLongMultiValuedProperty="[first

Is there a way to format multi-valued properties vertically in a Jackrabbit filevault xml doc?

非 Y 不嫁゛ 提交于 2019-12-24 07:48:19
问题 We use FileVault xml files in a git repo to configure our custom OSGi services running in our Adobe Experience Manager instance. This works out really well in many cases, but it seems like we have to list multi-valued properties horizontally, in a comma-only-separated string, like this: <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" aLongMultiValuedProperty="[first