sling

How to debug Groovy code via the remote Java application debugging in Eclipse

拈花ヽ惹草 提交于 2019-12-12 09:44:39
问题 I'm struggling to debug an application that builds as a Sling bundle. The application is almost entirely Groovy code (I have the Groovy Eclipse plug-in), and Eclipse (using Maven) is building the .jar and installing it in Sling without any problems. However, it's not able to debug. I have followed instructions to set up remote debugging, which I gather is necessary for debugging Sling apps - specifically, I launch Sling with the following command: java -Xdebug -Xnoagent -Djava.io.tmpdir=/c

Getting OSGi services from a bundle in Sling/CQ

寵の児 提交于 2019-12-12 07:32:49
问题 I am using Day CQ. I want to store some data in a SQL Server DB, using the connection pool available in the Felix console. I can do this from a JSP, by using the "sling" object of type SlingScriptHelper defined in the defineObjects tag sling.getService(DataSourcePool.class). However, I want to use a servlet created in an OSGi bundle to handle requests from the client. The servlet doesn't have a defineObjects tag, so the "sling" object is not defined. I don't see a way to create a valid

How to programatically delete revisions of a page in CQ5?

南楼画角 提交于 2019-12-12 04:06:22
问题 In the current setup; we are trying to automate the process of creating the blueprint page, rolling it out to its live copies; and activating the live copy pages.Also; deactivation and deletion of pages is also done programmatically . All this is done via code using the com.day.cq.wcm.api.msm and com.day.cq.replication api. The problem we are facing right now is after deleting the blueprint and live copy pages programmatically ; if we again create the same page programmatically ; then; there

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

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 access the asset in workflow process step

假如想象 提交于 2019-12-11 10:35:36
问题 I am trying to write a workflow process step for the DAM update asset such that the uploaded asset will be sent to an external service that will modify the asset and then the modified asset can be sent to the Metadata extraction step. So I've added my process step to the DAM update asset like this: And my code looks like this so far: public void execute(WorkItem item, WorkflowSession wfsession,MetaDataMap args) throws WorkflowException { try { log.info("Here2 in execute method"); //ensure

How do I make a WebDav call using HttpClient?

心已入冬 提交于 2019-12-11 07:30:18
问题 Specifically I want to call MKCOL through HttpClient to create a folder for Apache Jackrabbit through the Sling REST API. I've tried variants of BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("MKCOL", restUrl); But no dice so far. I'm guessing this is less difficult than I'm making it. I also see there is MkColMethod for something like MkColMethod mkColMethod = new MkColMethod(restUrl); But I don't know how to utilize this. I think it may have worked with a

Access Sling's embbed Jackrabbit over RMI

本小妞迷上赌 提交于 2019-12-11 06:26:27
问题 I want to connect to the embedded Jackrabbit in Spring over RMI but can't figure out how. Is the RMI endpoint started? If not how do I start it? Thank you, Marty 回答1: http://wiki.apache.org/jackrabbit/RemoteAccess should provide the relevant info. 来源: https://stackoverflow.com/questions/12961025/access-slings-embbed-jackrabbit-over-rmi

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