sling

Is it possible to convert a simple grails application to OSGi bundle that can run in Adobe CQ? [closed]

随声附和 提交于 2019-12-11 05:30:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have a simple Grails 2.2.4 application that simply lists a bunch of items on a page. So I only have one controller and I'm not even using the database. Now, I want to convert this application into an OSGi sling bundle so that I can run it under Adobe CQ. when I prepare the Grails app it creates a WAR file..

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

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

Create a new mixin in sling

早过忘川 提交于 2019-12-11 03:34:59
问题 I am having trouble create a new custom type to the jackrabbit in apache sling using the below code. This worked fine straight on Jackrabbit but not on Apache Sling. Am I doing this correctly for sling? Thanks The following code gives me a "javax.jcr.InvalidItemStateException: Conflict". I am using a standalone sling and am the only user so there is definitely no conflict. Repository repository = JcrUtils.getRepository("http://localhost:8080/server"); Session session = repository.login(new

Advantages of deploying sling + jackrabbit on tomcat?

此生再无相见时 提交于 2019-12-10 22:29:51
问题 There are several guides how to deploy Apache Sling on Apache Tomcat. Why would you want to do that? As I understand it, this would mean you are deploying the OSGI container Felix within tomcat, and thus use a deployment system quite different from Tomcat. Even more confusing: within Felix Sling uses Jetty as servlet engine - thus you are deploying a servlet engine within a servlet engine. 8-} So, what is the point of doing this, instead of just running the launchpad as a Java standalone

OSGi component configurable via Apache Felix

ぐ巨炮叔叔 提交于 2019-12-10 18:34:37
问题 I'm a complete newb at this so I apologize in advance. I'm trying to create an OSGi component that simply shows a hello world message and is configurable via the input from felix. Then spits it out on a jsp page. I'm using scr annotations to help do this. Here is my java code package com.training.cq5.trainingApp; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr

Build Sling Failure: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test (default-integration-test)

╄→гoц情女王★ 提交于 2019-12-09 17:21:47
问题 im trying to build sling cause I need it for a project at the university. Can anyone tell me, how I can solve this error? [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 54.112s [INFO] Finished at: Sun Mar 25 18:51:41 CEST 2012 [INFO] Final Memory: 68M/165M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2

CQ5: 403 Forbidden occurs when call a Post servlet

一个人想着一个人 提交于 2019-12-09 13:11:20
问题 Hi I'm using this code to create a Post method for my CQ5 example application. package com.adobe.cq.sling; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.net.URL; import java.rmi.ServerException; import java.util.Dictionary; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr.annotations.Property; import org.apache

How do I access the properties of a data-sly-list item in Sightly?

牧云@^-^@ 提交于 2019-12-08 09:19:24
I am using Sightly with Sling 8 ( not AEM ). I have the following template: <div data-sly-list.child="${resource.listChildren}"> ${child.name} | ${child.path} | ${child.properties['jcr:title'] || 'no title'} </div> The output ( for a single child ) is hello_world | /content/blog/posts/hello_world | no title I know there is a jcr:title property on the child resource as I have confirmed it using an HTTP call. How can I access the properties on the child object? Alexander Klimetschek The child is a Resource which does not have getProperties() but has getValueMap() , so you should use: ${child