Questions tagged [sling]

Apache Sling is a web framework that uses Java Content Repository to store and manage content. It also uses OSGi (Apache Felix) for dynamic loading.

Description

Apache Sling is a web framework that uses a Java Content Repository , such as Apache Jackrabbit , to store and manage content.

Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.

The embedded Apache Felix OSGi framework and console provide a dynamic runtime environment, where code and content bundles can be loaded, unloaded and reconfigured at runtime.

As the first web framework dedicated to JSR-170 Java Content Repositories, Sling makes it very simple to implement simple applications, while providing an enterprise-level framework for more complex applications.

Links

863 questions
28
votes
3 answers

What is the purpose behind building of Apache Sling, Felix, Jackrabbit projects

I am asking a very basic question here. Question is I am using Apache Sling , Apache Jackrabbit, Apache Felix in my project as said by my instructor. I am trying to understand why these software is developed by Apache. I tried a lot on the…
devsda
  • 4,112
  • 9
  • 50
  • 87
15
votes
1 answer

Apache Sling - OSGI framework exception when starting in Windows

I received the following error message when starting Sling on Windows with Java 1.7 (see below). I'm using Sling 6 (http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-6-standalone.jar). Any idea what could be wrong? Last time I…
openad
  • 177
  • 1
  • 5
14
votes
3 answers

How to set a resource property

I have a Sling Resource object. What is the best way to set or update its property?
Tomek Rękawek
  • 9,204
  • 2
  • 27
  • 43
13
votes
6 answers

How to convert HTTP Request Body into JSON Object in Java

I am trying find a Java lib/api that will allow me to turn the contents of a HTTP Request POST body into a JSON object. Ideally I would like to use a Apache Sling library (as they are exposed in my container naturally). The closest I've found it:…
empire29
  • 3,729
  • 6
  • 45
  • 71
13
votes
4 answers

ResourceResolverFactory getServiceResourceResolver throws Exception in AEM 6.1

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…
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73
13
votes
7 answers

Determine runmode in Adobe CQ

How do I programmatically know which run-mode the instance is running? I created a custom tag that provides the config depending on the instance run-mode, but I can not determine the current run-mode. I found a method that returns a list of run-mods…
Hleb
  • 7,037
  • 12
  • 58
  • 117
11
votes
3 answers

Getting OSGi services from a bundle in Sling/CQ

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…
joelt
  • 2,672
  • 2
  • 24
  • 32
9
votes
2 answers

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

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:…
user1291536
  • 127
  • 1
  • 5
8
votes
1 answer

How CQ authenticate each request?

I'm aware of how AEM creates cookie called "login-token" after successful authentication . My question is how AEM validates this cookie in each request? Is there any filter available to intercept the request and then validate cookie? if not then how…
8
votes
2 answers

Get html output from a jcr node in CQ5

I wanted to know if there is a way to get the rendered HTML output of a Page node in CQ5 without hitting the actual url. I have the Page node and I want to get the rendered HTML output of that Page node programmatically in java and store it in a…
Rakesh
  • 4,264
  • 4
  • 32
  • 58
8
votes
1 answer

What's the purpose of resourceResolver.adaptTo(Session.class) in Apache Sling?

I am new to Apache Sling, CQ5, etc. In our codebase, we have a code snippet similar to this: void perform(SlingHttpServletRequest request, SlingHttpServletResponse response) { ResourceResolver resourceResolver = request.getResourceResolver(); …
TheFooProgrammer
  • 2,439
  • 5
  • 28
  • 43
7
votes
1 answer

OSGi container and application server container in AEM

In standalone AEM installation, Is felix OSGi container present inside jetty servlet container ? Or is the Jetty Server is installed as a bundle in Felix OSGi container ? Which one will start first when AEM is started ? And how will this change for…
Prashant Onkar
  • 414
  • 3
  • 15
7
votes
1 answer

Which config is applied when number of matched run modes is the same

I am using OSGI config files to define configuration for different environments, as specified in OSGI Configuration. I have configurations for multiple run modes saved in the same repository. The documentation states "If multiple configurations…
Shawn
  • 8,374
  • 5
  • 37
  • 60
7
votes
1 answer

Sling:alias vs vanityUrl in AEM

what is the main difference between vanity url and sling:alias? as per docs : here sling:alias – The property may be set on any resource to indicate an alias name for the resource. For example the resource /content/visitors may have the sling:alias…
Manan Kapoor
  • 675
  • 1
  • 11
  • 28
7
votes
2 answers

Why sling:OsgiConfig node not working in /etc/folder in AEM?

I have a component with properties as follows. @Component(immediate = true, metatype = true, label = "Conf Details") @Service(value = { LocationConfigurationUtil.class }) @Properties({ @Property(label = "location blueprint", name =…
Dileepa
  • 1,019
  • 1
  • 15
  • 40
1
2 3
57 58