aem

Jquery AJAX: No 'Access-Control-Allow-Origin' header is present on the requested resource

夙愿已清 提交于 2019-11-29 06:12:51
问题 I am trying to post data to an API from my localhost:4502 port. When i tried to post data to this API using POSTMAN the data got added in the backend by providing the Basic Authorization key. The same i am trying to implement here in the Ajax Jquery call, but getting an CORS error. First time in jquery i am trying to post the data, please help here, what i can add. I have got the API key to for the Basic Authorization as a Username and Password can be left blank. <script src="https://ajax

Google Client API in OSGI

非 Y 不嫁゛ 提交于 2019-11-28 14:18:09
I'm having trouble providing the dependencies needed for OAuth Client Library for Java within an OSGI application framework (AEM). https://developers.google.com/api-client-library/java/google-oauth-java-client/setup I don't want to manually convert each dependency to an OSGI bundle, BND. So I'm using maven-bundle-plugin to embed these into my bundle. My process so far has been to watch the error.log for messages about 'Unresolved constraint in bundle.' Then track down the missing package, add the maven dependency, and add it to the Embed-Dependency section. That seemed to work for google-http

Unable to deploy SlingServlet in CQ

荒凉一梦 提交于 2019-11-28 14:01:16
I'm trying to create a servlet in CQ to access some back-end services. Then from my page will make an AJAX call to get the response from servlet. @Component(immediate = true, metatype = false, label = "feedServlet") @Service(Servlet.class) @Properties(value = { @org.apache.felix.scr.annotations.Property(name = "sling.servlet.methods", value = "POST"), @org.apache.felix.scr.annotations.Property(name = "sling.servlet.resourceTypes", value ="/bin/feedServlet/"), @org.apache.felix.scr.annotations.Property(name = "sling.servlet.selectors", value ="POST"), @org.apache.felix.scr.annotations.Property

Limiting allowed components in a template in cq5

浪尽此生 提交于 2019-11-28 12:47:04
I have a template that I want to limit to only using a certain subset of components. I've created the template, set the components I want to use in design mode and everything looks great, but when I export that template and install it on another cq5 instance the component list that I've set for that template vanish. Any idea how to get them to stick? The above answer is correct, but if you need more info, as part of the template implementation, you can define the list of components that will be rendered in the sidekick for your template by defining the following property. components="[/libs

Add dynamic pathfield(rootPath) for cq5 component

故事扮演 提交于 2019-11-28 11:49:35
How can we add a dynamic pathfield(rootPath) for a cq5 component? Are there any example references? I think you should use custom widget plugin. First, add property plugins to your pathfield in the dialog.xml : <myPathComponent jcr:primaryType="cq:Widget" fieldLabel="My path component" plugins="customRootPathPlugin" xtype="pathfield" /> Then create custom ExtJS plugin. In order to do that, create new JS file, and add it to clientlib with cq.wcm.edit category. Plugin can look like that: (function($) { var plugin = CQ.Ext.extend(CQ.Ext.emptyFn, { init: function(widget) { var locale = "en"; //

Google Client API in OSGI

家住魔仙堡 提交于 2019-11-28 10:50:04
问题 I'm having trouble providing the dependencies needed for OAuth Client Library for Java within an OSGI application framework (AEM). https://developers.google.com/api-client-library/java/google-oauth-java-client/setup I don't want to manually convert each dependency to an OSGI bundle, BND. So I'm using maven-bundle-plugin to embed these into my bundle. My process so far has been to watch the error.log for messages about 'Unresolved constraint in bundle.' Then track down the missing package, add

Limiting allowed components in a template in cq5

[亡魂溺海] 提交于 2019-11-27 07:10:50
问题 I have a template that I want to limit to only using a certain subset of components. I've created the template, set the components I want to use in design mode and everything looks great, but when I export that template and install it on another cq5 instance the component list that I've set for that template vanish. Any idea how to get them to stick? 回答1: The above answer is correct, but if you need more info, as part of the template implementation, you can define the list of components that

Add dynamic pathfield(rootPath) for cq5 component

核能气质少年 提交于 2019-11-27 06:38:19
问题 How can we add a dynamic pathfield(rootPath) for a cq5 component? Are there any example references? 回答1: I think you should use custom widget plugin. First, add property plugins to your pathfield in the dialog.xml : <myPathComponent jcr:primaryType="cq:Widget" fieldLabel="My path component" plugins="customRootPathPlugin" xtype="pathfield" /> Then create custom ExtJS plugin. In order to do that, create new JS file, and add it to clientlib with cq.wcm.edit category. Plugin can look like that:

How to use/understand AEM Sling Resource Merger, override and Overlay concepts

微笑、不失礼 提交于 2019-11-27 03:05:37
问题 Am trying to understand the AEM Sling Resource Merger concept. As per the Adobe docs examples Override (Configuring your Page Properties), Overlay (Customizing the Consoles (touch-optimized UI)) am getting confused how to use this, can any one explain with simple component to understand it in more better way. 回答1: Here you go with an explanation Overlay: When you overlay a component in AEM means that copy component from /libs/ folder to /apps/.. folder. And you can impose your own definitions

ResourceResolverFactory getServiceResourceResolver throws Exception in AEM 6.1

走远了吗. 提交于 2019-11-26 22:53:39
I want to write some data to AEM, and the below code works fine for me in AEM 6.0 but not in AEM 6.1 , always throws a Login Exception as follows: " Login Exception when obtaining a CRX User for the Service:'writeService'.org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle group.tti.commons-service [395] and sub service writeService " OSGI Config: Code in my class: import javax.jcr.Session; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceResolverFactory; .... @Reference private ResourceResolverFactory factory;