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
3
votes
3 answers

In AEM 6.2, how do you create a static page template on a site that already has editable page templates?

I'm having trouble creating a static page template on our site that already has editable pages. I'm not sure if I'm just creating the template wrong, missing a required call, or if config templates exist that AEM doesn't check for templates in…
Koblinski
  • 61
  • 1
  • 9
3
votes
2 answers

@Reference Session is showing unsatisfied error

I'm using a sling servlet. In that I'm using javax.jcr.Session as a reference. After taking a build and when I see in system/console/components, I'm seeing the following error Reference session ["Unsatisfied","Service Name: …
Vijay
  • 53
  • 12
3
votes
2 answers

Cannot derive user name for bundle with any system user in AEM

With an AEM 6.1 environment, I am trying to avoid the deprecated method getAdministrativeResourceResolver for getting the resource resolver in a java class. I created system users and used existing system users that fit the right criteria…
Lizzy
  • 91
  • 1
  • 7
3
votes
1 answer

How does AEM resolve the JSON extension?

In CQ, if I request a resource such as localhost:4502/content/geometrixx/en.json, I would get the node information in JSON format. The same applies for the XML extension as well. My question is, where is it implemented that the node information is…
Shashi
  • 746
  • 10
  • 39
3
votes
1 answer

how can I use OSGI service in different package

Lets say I have Bundle A, and it has an Interface HelloWorld and function helloWorld() Now, in another bundle B, I'm implementing as follows @Service(HelloWorld.class) @Component(immediate = true) public class Test1Impl implements HelloWorld { …
3
votes
3 answers

AEM: How to get administrative resource resolver, since getAdministrativeResourceResolver(Map authenticationInfo) is deprecated?

I have to get administrative prevailed org.apache.sling.api.resource.ResourceResolver. But the API, ResourceResolverFactory.getAdministrativeResourceResolver(Map authenticationInfo) is depricated.
Dileepa
  • 1,019
  • 1
  • 15
  • 40
3
votes
5 answers

How do I use a sling service in sightly page without using javascript?

I have to use a sling service that I created e.g. @Component @Service public class SearchServiceImpl implements SearchService { public SearchResults search() { SearchResults results = new SearchResults(); ..... return results; …
Kinjal Darji
  • 37
  • 1
  • 7
3
votes
2 answers

Change HTTP status code for page in Adobe CQ5 (AEM)

I'm trying to support a CQ5 (5.5) installation developed by an outside firm for my company. It appears that my company wanted a pretty 404 page that looked like the rest of the site, and using the custom Sling 404.jsp error handler to redirect to a…
Michael Oryl
  • 20,856
  • 14
  • 77
  • 117
3
votes
1 answer

Sling Models, No Adaptable Class found, Ignoring

I am trying to get the simplest Sling Model example registered on my system, AEM6.0 SP2. package com.company.services.osgi.entities; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import…
Cris Rockwell
  • 904
  • 2
  • 16
  • 30
3
votes
1 answer

Customizing CQ / AEM Authentication

What exactly do you have to do to authenticate users against an external source while accessing pages on a CQ publish instance? From what I have read, a custom AuthenticationHandler can be used for this. The AuthenticationHandler can be configured…
3
votes
1 answer

AEM Servlet response writter removing links

In AEM, I'm trying to write a JSON object that contains a string object via a get servlet, like this: response.setContentType("application/json"); response.setCharacterEncoding("UTF-8"); response.getWriter().write(jsonObject.toString()); Response…
Alex Theys
  • 31
  • 2
3
votes
1 answer

Getting error while using adaptTo method of Sling while using Sling Models

We are trying a sample sling model implementation in AEM 6.0. The sling model class without the imports is like this : @Model(adaptables = Resource.class) public class Header { @Inject private String link; @Inject private String…
iAMintoAEM
  • 71
  • 6
3
votes
1 answer

Ways of registering a Sling Servlet - Adobe AEM/CQ

There are two ways of registering Sling Servlet as per the documentation First is @SlingServlet @SlingServlet( resourceTypes = "sling/servlet/default", selectors = "hello", extensions = "html", methods = "GET") public class…
Sandeep Kumar
  • 1,758
  • 1
  • 22
  • 39
3
votes
2 answers

Custom Sling POST Servlet not working

I have a Servlet that is responding to GET requests as expected. The problem is that POST requests are not getting handled by my Servlet, rather by SlingPostServlet according to /system/console/requests . My Servlet is using the SCR…
Cris Rockwell
  • 904
  • 2
  • 16
  • 30
3
votes
2 answers

How to create a system user (rep:SystemUser) in AEM 6.1?

On AEM 6.1.. I am trying to create a System User (rep:SystemUser). Can anyone help me? I need this system-user to map to a service in OSGI that i want to use to Write some data to aem content. I can see the "system users" in CRX at this location:…
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73