aem

Is it possible to get a reference to the vanity URL used after redirection?

倖福魔咒の 提交于 2019-12-12 03:17:27
问题 I have a page http://localhost:4502/content/project/en/mypage.html and it has couple of vanity URLs set as /content/project/vanity-1 /content/project/vanity-2 So any request from the above two vanity URLs are being redirected to /mypage.html . Is it possible to get the vanity URL request from where the page is redirected to? i.e how can I find from which vanity URL the request is coming from? request.getRequestURL() gives me . ./mypage.html but I need to get the vanity URL request. 回答1: You

CQ5.5 order standard HTTP filters deployed as OSGI components

删除回忆录丶 提交于 2019-12-12 03:02:57
问题 In CQ5.5 How I can order 2 standard HTTP Filters deployed as OSGI components? The issue is that the 2 filters have to run in order where FilterA should run first and then FilterB in sequence. How I can order my 2 filters in sequence? Do you know if there is any OSGI or SCR property with which I can order the 2 filter so that one should run after another? For example: Filter A @Component @Service @org.apache.felix.scr.annotations.Properties({ @Property(name = "pattern", value = "/.*"),

How to create instance of WCMUsePojo in my Prosper spec?

孤人 提交于 2019-12-12 01:57:37
问题 I have a functioning WCMUsePojo Groovy class which is called from a sightly html component. I am trying to create an instance of my WCMUsePojo class for testing based on the content from the Prosper setup method. It's basically the same type of question as How can I create an instance of WCMUsePojo in a servlet for a specific page? But I don't see it answered and this is specifically about how to unit test methods in WCMUsePojo classes within the Prosper framework. Is there a Java or Groovy

CQ 5.6 - Rich Text Editor for end users (not for authors)

若如初见. 提交于 2019-12-12 01:36:46
问题 Is there any way to customize the TextArea field as a Rich Text editor and make it usable by end users. I see a documentation from Adobe on "Configuring the Rich Text Editor". I think this is only for the authors who customizes the text content in pages. My requirement is to show the same Rich UI editor for the users to type texts with formats, alignments etc. Any advice would be greatly appreciated.. -Nith 回答1: If its needed for end user, feel free to use any opensource/paid richtext editor.

Adding additional Metadata field in AEM-DAM

你。 提交于 2019-12-12 00:47:00
问题 I want to add a custom metadata field in DAM assets, is there any way to add custom metadata apart from overlaying a workflow or writing custom workflow? 回答1: Metadata profiles is the way to add default properties to assets on upload. Metadata profiles are linked to assets at folder level. You could have different default properties for assets based on folder they are uploaded to. For e.g. attached default tags based on folder Checkout this link for the detailed documentation on how to add

Unit test WCMUsePOJO class

点点圈 提交于 2019-12-11 17:18:41
问题 I am writing unit test cases for following class which extends WCMUsePOJO. Now, this class is using a getSlingScriptHelper method shown below. public class ConstantsServiceProvider extends WCMUsePojo { private static final Logger logger = LoggerFactory.getLogger(ConstantsServiceProvider.class); private String var1; @Override public void activate() throws Exception { ConstantsService constantsService = getSlingScriptHelper().getService(ConstantsService.class); if(constantsService != null) {

AEM 6.3 Using OSGi R6 Annotations and Sling Models

≯℡__Kan透↙ 提交于 2019-12-11 16:59:08
问题 I am trying to create an OSGi Service using OSGi R6 annotations and then injecting it in the Sling Model class like this: package com.aem.sites.models; import javax.annotation.PostConstruct; import javax.inject.Inject; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.aem.sites.services.WeatherService; @Model(adaptables=Resource.class) public class Banner { final static Logger

How to parse AEM DAM JSON InputStream and create JSON Object

放肆的年华 提交于 2019-12-11 16:58:59
问题 I have a requirement where-in I have to read the JSON file which exists in AEM DAM. So, I have created a query to read the JSON file in inputStream. With the below line of code, i could get the JSON file in Input Stream. Now, I need to know If there is any standard library to read the input stream and create the JSON Object? InputStream is = asset.getOriginal().getStream(); 回答1: There are many libraries for serializing/deserializing JSON in java, the most notable is Google’s Gson: https:/

Which Testing framework will suit for Adobe CQ5 Project?

风流意气都作罢 提交于 2019-12-11 14:14:32
问题 Which testing framework will suit for a Adobe CQ5 Project which is having some part of code in Java and some part of code in JSP for the CQ5 components? 回答1: There are some details of testing of apache sling components on the Sling Testing page, which will suit components within a CQ5 project There are remote tests that can be deployed to a running CQ5 server and executed remotely (using curl for example) There are also integration tests that create a sling launchpad instance and test against

How to make RSS Feed Generator for ASRP Blog Posts in AEM 6.2

放肆的年华 提交于 2019-12-11 14:03:55
问题 Am looking for generate RSS feed from ASRP blog Posts from AEM to Integrate in Third Party Plugin, does AEM have any OOTB solution for this ? or we need to create a custom RSS feed generator ? any help would be appreciated. Thanks 回答1: As per the Adobe Forum Thread, RSS OOTB feature is currently unavailable for AEM 6.1/ 6.2 Communities. So, you can create custom polling importer and do your stuff. To create custom importer: You need to define two properties in your importer class: You can