aem

org.apache.sling.api.resource,version=[2.3,3) — Cannot be resolved

风格不统一 提交于 2019-12-24 03:07:15
问题 Hi I am not able to access content of my project, I have uploaded all the packages which are required to access content from CQ. Only thing I can see is org.apache.sling.api.resource,version=[2.3,3) -- Cannot be resolved Can this be the reason for exception and if yes please let me know how to resolve it. CQ version 5.6 回答1: The error message means that the OSGi framework is unable to supply a version >= 2.3 and < 3 of the org.apache.sling.api.resource Java package for a bundle B that wants

Case insensitive search in CQ5 using querybuilder

一世执手 提交于 2019-12-24 03:07:05
问题 Please suggest on how to implement case insensitive search using querybuilder in CQ5. My code is as below ... paramMap.put("1_property", searchType); paramMap.put("1_property.value", "%" + searchString + "%"); paramMap.put("1_property.operation", "like"); paramMap.put("2_property", "documentId"); paramMap.put("2_property.operation", "exists"); paramMap.put("3_orderby.sort", "asc"); paramMap.put("p.limit", "0"); searchType is the node property searchString is the string that needs to be

Reusing the CQ5 Form into the mywebsite components is not showing up the End of the Form section

本小妞迷上赌 提交于 2019-12-24 02:13:47
问题 I am trying to reuse the Form into my project components. I have copy pasted the entire form folder from "/libs/foundation/components/form" to my project "/apps/mywebsite/components/form" . But when i am trying to use the form from mywebsite in the parsys the from shows only Start of the from. Where as when i tried to use the form from the foundation in the same page parsys it shows both Start and End of the form. Observation: From the content, when i am using the foundation form the in the

Adobe CQ5 regex that will reject an entire string if either of 2 different substrings are found within the string

好久不见. 提交于 2019-12-23 23:14:16
问题 Adobe CQ5 dialog editor, regex property: I am regex challenged so forgive me, but it seems a simple task and I just can't seem to find the right fit elsewhere on the internet. Every suggestion that looks right just doesn't seem to work in adobe's regex field. I want the content admin to supply a relative URL to a "thank you" page. I don't need anything super fancy, I simply want to reject the admin's input if "http" or ".com" is found anywhere within the text supplied by the admin. Examples

ResourceResolverFactory is NULL (Adobe Experience Manager AEM)

ぃ、小莉子 提交于 2019-12-23 14:59:33
问题 I am trying to get a reference to the ResourceResolver from the ResourceResolverFactory as follows: @Reference private ResourceResolverFactory resourceResolverFactory; public void someMethod() { Map<String, Object> authenticationMap = new HashMap<String, Object>(); authenticationMap.put(ResourceResolverFactory.USER, "user"); authenticationMap.put(ResourceResolverFactory.PASSWORD, "pwd"); //This line returns NullPointerException ResourceResolver resourceResolver = resourceResolverFactory

User permissions API in CQ

拈花ヽ惹草 提交于 2019-12-23 06:31:11
问题 Consider creating a standalone java program for creating user/group with the access permission. So my question is, Is there any APIs available for setting user-permissions in CQ ? 回答1: There is a JCR access control management api that can be used to read and assign access control policies. There is also a jackrabbit UserManager accessible from within CQ for creating users/groups. There are some code examples on the User Management page of the JackRabbit wiki. Essentially, you need to cast the

selectionchanged event is not working

让人想犯罪 __ 提交于 2019-12-23 05:36:05
问题 I have two felds in my dialog, one is text field(leftpadding) and another is dropdown with four options(option 1, option 2, option 3, option 4).My requirement is to display/enable the textfiled when the user selects option 3 and option 4 only. I added listeners(selectionchanged) node to the dropdown field. loadcontent event is firing but selectionchanged is not working fine. Please find below for the code snippet selectionchanged: function(field,value){ var layoutoption = ""; layoutoption =

How to cancel page activation programmatically?

荒凉一梦 提交于 2019-12-23 05:32:29
问题 I would like to cancel the activation of some page, when x!=y is met. I am trying to do this with EventHandler . The author clicks on activate Page in the sidekick , and my EventHandler gets a replication event and tests if x!=y . If this is met, the page activation has to be canceled. My question is how do I cancel the page activation? @Component(immediate = true, label = "TEST") @Service @Property(name = "event.topics", value = { ReplicationAction.EVENT_TOPIC }) public class EventHandler

Pass json data to servlet (doPost) with Jquery $.ajax

淺唱寂寞╮ 提交于 2019-12-23 04:05:42
问题 i'm learning about calls to ajax so i'm trying to get the value of ('#abcd') (a html select). I'm using this line: abcdVal = combo.options[combo.selectedIndex].value When this value change i must store his value in a var like abcdVal for pass to servlet with: var data = {"text" : abcdVal}; j("#mybutton").click(function(){ j.ajax({method: 'POST', url: "/bin/company/repo", dataType: 'JSON', data: data, success:function(result){ alert(result); j("#demo").html(''); j('#demo').html(result); }}); }

Sling model unit tests: mock currentPage in SlingHttpServletRequest

冷暖自知 提交于 2019-12-23 03:57:12
问题 I am having some trouble testing a Sling model: the currentPage is not getting injected for some reason. My Sling model looks like this: @Model( adaptables = { SlingHttpServletRequest.class, Resource.class }, resourceType = MyModel.RESOURCE_TYPE) public class MyModel { public static final String RESOURCE_TYPE = "myproject/components/renderer"; @Inject private Page currentPage; // Model methods, etc. } I writing some JUnit tests for it, like so: @RunWith(MockitoJUnitRunner.class) public class