aem

navigation component using sightly

允我心安 提交于 2019-12-11 06:16:54
问题 I am trying to make use of Navigation api for making a global header component @http://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/foundation/Navigation.html I have a sightly html that is able to get me the reference to the "item" <div data-sly-unwrap data-sly-use.navitems="${'Helper'}"></div> <ul data-sly-list="${navitems.navigationIterator}"> <li> ${itemList.count} :: ${item.page.properties.jcr:primaryType} :: ${item.title} ${item.navigation.element.properties.Type} </li> Helper

AEM 6.3 - Multifield using Sling Model

三世轮回 提交于 2019-12-11 06:09:57
问题 I am trying to create a Coral UI 3 multifield and use Sling Models. Here is how the dialog looks like: Here is the code : package com.aem.sites.models; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.apache.log4j.Logger; import com.aem.sites.models.Header; @Model

AEM 6.3, maven-bundle-plugin automate OSGi SCR metadata for OSGi annotated classes

二次信任 提交于 2019-12-11 06:06:48
问题 I am trying to unit test my OSGI R6 annotated classes. I found out that I have to specify some info in the maven-bundle-plugin: http://felix.apache.org/documentation/faqs/apache-felix-bundle-plugin-faq.html#use-scr-metadata-generated-by-bnd-in-unit-tests --> Use SCR metadata generated by BND in Unit Tests. If I invalidate cache in Intellij and restart and try to execute my test again it fails. If I manually trigger the manifest goal of the maven-bundle-plugin and run the test it succeeds, can

CQ - Writing Server-side JUnit tests

我的梦境 提交于 2019-12-11 04:59:01
问题 I've been trying to write a JUnit test case for one of my Java class which creates a page with some given properties in CQ. For it, it need to get reference of SlingRepository and ResourceResolverFactory. I was using this to get an idea on how to achieve this. In the document it says that a POST to "http://$HOST:$PORT/system/sling/junit/" path is used to execute tests on server side. But in CQ I get a 404 error for this path. Is there any alternative URL in CQ for this? Or will really

Disable component editing in CQ/AEM

让人想犯罪 __ 提交于 2019-12-11 04:12:58
问题 I've got a variety of situations where I have a component A which uses cq:include to include component B. Both A and B are editable and have dialogs. However, when B is included in A, I'd like to disable direct editing of component B - I'll manage the authoring through A's dialog. I've seen a couple methods that accomplish this. The first is <% IncludeOptions.getOptions(request, true).forceSameContext(true); %> and the second is <% slingRequest.setAttribute(ComponentContext.BYPASS_COMPONENT

How to force dispatcher cache urls with get parameters

↘锁芯ラ 提交于 2019-12-11 04:08:03
问题 As I understood after reading these links: How to find out what does dispatcher cache? http://docs.adobe.com/docs/en/dispatcher.html The Dispatcher always requests the document directly from the AEM instance in the following cases: If the HTTP method is not GET. Other common methods are POST for form data and HEAD for the HTTP header. If the request URI contains a question mark "?". This usually indicates a dynamic page, such as a search result, which does not need to be cached. The file

Access to a property in a specific resource via sightly

谁都会走 提交于 2019-12-11 04:07:27
问题 I want to access to a specific property in resource. The main resource hat two children and the app is in the first one. I want to get a property from the second child. Can i find something like : ${resource.parent.child[1].valueMap.title} Thanks! 回答1: To start - note that the order of the children may not be guaranteed , unless you're using sling:OrderedFolder or some other ordered type. So trying to get the "second" child may not even make sense. Having said that, there may some valid use

Multiple bundle versions deployed in one OSGi instance

烈酒焚心 提交于 2019-12-11 03:33:05
问题 I have three applications deployed in CQ which all depend on one bundle (say 'core'). Core is undergoing a major face lift and there is a requirement to define the dependency of all three application on different versions of core, e.g. A will have dependency on core 1.0 B will have dependency on core 1.5 C will have dependency on core 2.0 Is it possible to do this? 回答1: OSGi (which CQ itself is embedded in) supports multiple versions of packages deployed at the same time. You could deploy the

Event handler for delete child component in AEM/CQ

[亡魂溺海] 提交于 2019-12-11 02:45:13
问题 How can I add an event handler for my Adobe AEM6 component that triggers when a child component is deleted? There are several listeners that I can attach event handlers to, listed in the documentation for cq:listeners but unfortunately there isn't one for afterchilddelete. I've tried adding a cq:childEditConfig node to the component but, at least in AEM6, the handler doesn't fire: <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq

Not able to show image on dialog box in AEM

纵饮孤独 提交于 2019-12-11 02:35:59
问题 I am trying to create a dialog with image preview on it. I am able to create dialog with all the fields but i am facing issue with image. I have seen the image component where you can drag drop image but i need the image to be shown when i open dialog component. Is there any component for this without drag drop. I have tried with html5smartimage image but not working. Please see code below: <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr=