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
0
votes
2 answers

Sling - Returning a method with multiple parameters

I've got a pretty simple code snippet that is really giving me some trouble. I've got a very simple method that hits the "URL" parameter and when there is a value it is returned. When it hits the "fragment" parameter it doesn't return anything and…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
0 answers

Why my bundle not able to use background services?

I am working on a project in which I used Adobe CQ5. In the mean while I have to use background service in my class i.e., SlingRepository. For that I used Reference Annotation @Reference protected SlingRepository repository; When I deploy this…
devsda
  • 4,112
  • 9
  • 50
  • 87
0
votes
2 answers

How to activate OSGI bundle?

I am working in Adobe CQ5. I made my project that contains only implementation, and the project title is Web Crawler. And that project is started by one class that simply adds initial seeds. I made OSGI bundle of my project and I deploy that…
devsda
  • 4,112
  • 9
  • 50
  • 87
0
votes
1 answer

Get child nodes returning cannot loop error

I've got a pretty basic snippet of code that gets the currentNode of an object and looks through to get it's child nodes. Except for some reason this isn't working and I can't figure out why. getChildNodes() is suppose to return an iterable list of…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
1 answer

Sling server side Testing

I have deployed an OSGI bundle which is currently using a running FTP Server import some files , and saved the data in the Resource ( JCR / FS ) as provided . For the time being considering JCR , I have written sling unit test bundle which returns…
Raja
  • 305
  • 2
  • 4
  • 14
0
votes
1 answer

Why am I receiving "check if the declared type is right and if the method exists" when retrieving page properties for sling?

This code snippet is supposed to get the page properties in sling. Why am I receiving this error: Please check if the declared type is right and if the method exists. private String properties; public void setProperties(String properties){ …
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
1 answer

Sling - accessing properties via pageContext

To my understanding pageContext has access to many methods like getPage, getRequest, etc. So wouldn't it be better to simply access what you need directly as oppose to using page context? The problem is I have no idea how you would do this. So say…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
1 answer

Extending ProfileImages servlet in cq5

I am trying to extend ProfileImages servlet from /libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/pro file/impl/ProfileImages.java and bundling as an OSGI service. I have the following…
user1130906
  • 101
  • 4
  • 16
0
votes
1 answer

Accessing file system resources using the Apache Sling Resource API

I want to access the file System using the sling resource API . I can access the JCR nodes but not don't know how to access the file System resource . How the resourceResolver will resolve the resource objects for filesystem ?
Raja
  • 305
  • 2
  • 4
  • 14
0
votes
1 answer

Sling - Loop through properties of a resource

I'm used to using nodes in sling and accustomed to looping through nodes with something like: NodeIterator headerNode = currentNode.getNodes(); //loop through and do something But how would I do this if I'm trying to loop through all the properties…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
2 answers

Java - Null check on currentNode

I'm pretty new to Java so bear with me. I've got a small bit of code that checks to see if a currentNode has a property of "fileReference" and returns its value. Except it doesn't seem like my null check is working because if nothing is in…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
2 answers

Processing form data with sling servlet

I'm trying to create a simple html form that is processed with a sling servlet. It's a very basic form with a couple input fields and my java class is pretty straightforward. All I'm trying to do is log the values from the form in my error log.…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51
0
votes
1 answer

How to restore acl policies using importXML in apache jackrabbit?

I am developing an apache sling WCMS. I export a subtree of the repository contents to an xml file using session.exportSystemView(...) and it works perfectly. When I restore the xml file, using session.ImportXML(...) all of data back completely…
Babak Behzadi
  • 1,236
  • 2
  • 16
  • 33
0
votes
1 answer

Apache Sling Cache Issue

I'm developing an apache sling WCMS Application and using BitKinex 3.2.3 to upload app files to the repository. I'm struggling with a weird problem, so when I upload new app files to /apps no change will be occurred to the application and the…
Babak Behzadi
  • 1,236
  • 2
  • 16
  • 33
0
votes
2 answers

Java cannot find symbol on variable

I'm pretty new to Java so bear with me. I can't for the life of me figure out why I'm getting a cannot find symbol error on resourceResolver.resolve. When on the line above it I'm defining the variable. Maybe this is something simple I'm missing but…
Delmon Young
  • 2,013
  • 5
  • 39
  • 51