Re: Getting SlingHttpServletRequest in a HTTP Whiteboard

2020-11-17 Thread Julian Sedding
Hey Roy No this is not possible. The SlingHttpServletRequest is only available once you're "inside" the SlingMainServlet, i.e. in filters or servlets registered within Sling. The HTTP Whiteboard is pure OSGi and filters registered that way are executed before the SlingMainServlet. The order of

Re: An issue when trying to use the i18n bundle

2020-04-26 Thread Julian Sedding
> GET http://localhost:8123/libs/languages HTTP/1.1// Also tried > http://localhost:8123/libs/languages/* and a few others > Content-Type: text/json // Tried some other content types there > Host: localhost:8123 > Content-Length: 0 >

Re: An issue when trying to use the i18n bundle

2020-04-24 Thread Julian Sedding
Hi I noticed that you set jcr:primaryType=mix:language. It should be jcr:mixinTypes. Also no need to set the jcr:primaryType=nt:file, it should be set automatically. Setting it again explicitly might actually cause issues. So just try posting ./jcr:mixinTypes=mix:language ./jcr:language=en If

Re: Sling 12 with Composite Node Store

2020-03-31 Thread Julian Sedding
Hi Andy I have not done this before, I'm just trying to extrapolate from looking at the code. In your above config, I think the following config "org.apache.jackrabbit.oak.segment.SegmentNodeStoreService~global" should be "org.apache.jackrabbit.oak.segment.SegmentNodeStoreFactory~global".

Re: Sling XML Namespace

2020-02-13 Thread Julian Sedding
Hi John XML namespace names are usually URIs, supposedly to avoid collisions. However, they are not required to be a URI nor are they required to point to an actual document. The Wikipedia article on XML namespaces has more detail: https://en.wikipedia.org/wiki/XML_namespace#Namespace_names The

Re: Executing xpath query with number in path

2019-09-05 Thread Julian Sedding
Hi Roy Like others said before, ISO9075 is what you need. You only need to encode the first digit. The encoding is simple enough to remember (if used regularly ;) ): 0: _x0030_ 1: _x0031_ 2: _x0032_ ... Your query would thus become:

Re: Flexible adaptable not resulting in instantiation of correct model

2019-06-12 Thread Julian Sedding
Hi Liam Based on the fact that the @Self injection should provide a Resource object, I assume your model is adaptable from a Resource (it would help to provide the class including its @Model annotation). The way this feature is implemented, I assume that it does not work for adapting Resource

Re: Multiple threads on same resource resolver

2019-03-29 Thread Julian Sedding
Hi Roy Do your Site objects reference a resource resolver instance, e.g. via a resource? If they do then it's likely the warning comes from this RR being used concurrently. Other than that (bar closing the RRs in the thread), I can't see anything obviously wrong with your last code snippet.

Re: Upgrading to Oak 1.10.0 for Sling10

2019-02-25 Thread Julian Sedding
Hi Marc >From your log, I suspect that the "sling" and "slingevent" Namespaces are (not yet?) registered when the repository is being initialized. During repository initialization all installed OSGi bundles are inspected in order to see whether they contribute namespaces or node-type definitions

Re: How to create a namespace mapping from a remote test?

2019-02-08 Thread Julian Sedding
Hi Christian I can see two options. However, both require deploying a custom bundle. 1. The JCR Content Loader has support for installing *.cnd files[0]. I.e. a (very slim) bundle could be installed to register a namespace declared in a cnd file. 2. Deploy a custom bundle with a servlet that

Re: Segment Tar based Sling clustering

2018-11-19 Thread Julian Sedding
Hi Stepan This question is better suited for the Jackrabbit Oak list. But here's my take anyways: I am pretty sure that option 2 is not possible, because Segment Tar assumes that the files are private to a single VM instance. If I understand you correctly, in option 3 you are considering to

Re: JCR Observation, Type ResourceResolver & idle JCR sessions

2018-08-27 Thread Julian Sedding
Hi Jörg I would argue that a new ResourceResolver for each "onEvent" call would be advisable. Not only to avoid the problem you observe, but also to avoid the risk of the session being used concurrently from multiple threads. Not sure if JCR event hanlders may be called concurrently though. The

Re: [ANN] New Apache Sling PMC Chair: Robert Munteanu

2017-11-17 Thread Julian Sedding
Congratulations Robert! Regards Julian On Thu, Nov 16, 2017 at 5:29 PM, Roy Teeuwen wrote: > Congratulations Robert! > > Greets, > Roy > >> On 16 Nov 2017, at 15:25, Carsten Ziegeler wrote: >> >> Hi, >> >> it's my pleasure to announce that Robert took up

Re: Export content as JSON ready to be imported

2017-04-04 Thread Julian Sedding
Hi Guillaume AFAIK Jackrabbit FileVault uses a similar approach. I'm not super familiar with the code, but you may find interesting details if you look at the classes JackrabbitACLImporter[0] and/or JcrACLManagement[1]. The order of ACEs is significant. IIRC later entries "override" earlier ones

Re: How to change run mode in Sling8

2017-01-11 Thread Julian Sedding
Why are you running the war file on Tomcat? It's not wrong of course. However, I believe that most users use the standalone jar and therefore help may be more readily available for that setup. Regards Julian On Wed, Jan 11, 2017 at 4:19 AM, lancedolan wrote: > I cannot

Re: Read cache contents being continuously sent from primary to cold standby?

2016-11-08 Thread Julian Sedding
Hi John I think you might have more luck with this question on the jackrabbit users list. Sling uses Jackrabbit Oak under the hood, but the real expertise is over there. Regards Julian On Tue, Nov 8, 2016 at 8:08 PM, John Logan wrote: > Hi, > > Is there anyone who can

Re: OO style inheritance of master website to child websites

2016-10-20 Thread Julian Sedding
The "Superimposing Resource Provider"[0] was created for this (or a similar) use-case. YMMV. Regards Julian [0] https://github.com/apache/sling/tree/trunk/contrib/extensions/superimposing On Thu, Oct 20, 2016 at 2:59 PM, Bertrand Delacretaz wrote: > Hi, > > On Thu, Oct

Re: launchpad with FileDataStore

2016-10-12 Thread Julian Sedding
Hi Mike > I can load the /system/console, but not the .explorer.html app. If I > set customBlobStore=B"false" it works correctly again. Are you referring to (a) configuration being changed in a running system? (b) configuration changed in previously initialised system and a subsequent restart?

Re: XPath Query

2016-10-11 Thread Julian Sedding
to be the element cq:PageContent (that > contains a parsys with some-component on) > > Greets, > Roy >> On 11 Oct 2016, at 14:54, Julian Sedding <jsedd...@gmail.com> wrote: >> >> Hi Roy >> >> I see, thanks for the pointer. I didn't know that was a

Re: XPath Query

2016-10-11 Thread Julian Sedding
gt; But they gave me a workable solution in the oak-dev channel, although it > should still work in the old way according to xpath :) > > The solution they provided: something like > /jcr:root/content/site//element(*,cq:PageContent)[parsys/some-component/@jcr:primaryType] > >

Re: Querying vs iterating

2016-06-20 Thread Julian Sedding
shouldn’t really matter in performance > to choose either for manually traverse myself or doing a query when looking > to see if a specific property name exists on the page, > because behind the scene it will most likely traverse itself then anyway, > right? > > Thanks! > Roy >&

Re: Querying vs iterating

2016-06-20 Thread Julian Sedding
Hi Roy >From you question ("hard to put an index to it") I assume that you are running on an Oak repository. If that is incorrect, my answer does not apply. Oak will always consider traversal as an alternative to existing indexes. For most queries the cost of traversal is so high that an index

Re: Using the resource resolver

2016-06-20 Thread Julian Sedding
Hi Ben In such cases it is advisable to pass in the ResourceResolver from the place where you need the Resource objects (or objects backed by live Resources). Otherwise you cannot close the ResourceResolver OR your objects are dead. > Is it a good pattern to have a method in each service that I

Re: Sorting of a JCR Query

2016-03-03 Thread Julian Sedding
Hello Roy XPath queries allow ordering by a property: /jcr:root/A//element(*, nt:unstructured) [ jcr:contains(property, ‘value’) ] order by @otherProperty descending If you want the child order, you should iterate over the child node using the API: NodeIterator children =

Re: Custom login form with a JSP

2016-01-13 Thread Julian Sedding
Hello Guillaume Maybe you cannot render the resource, because the "anonymous" user does not have read permissions? If you want to have a resource based login page, you need to allow "anonymous" read access. Hope this help! Regards Julian On Wed, Jan 13, 2016 at 4:15 PM, Guillaume Lucazeau

Re: How to reindex lucene

2016-01-06 Thread Julian Sedding
Hi Roy This relates more to Jackrabbit Oak then to Sling, so you might get better assistance there. The Lucene-Index implementation in Oak copies the index data from the repository to the local file system as an I/O optimization. Therefore the files on the file system are redundant. You can try

Re: How to reindex lucene

2016-01-06 Thread Julian Sedding
shes the reindexing the > error messages disappear. > > Shall I put this on the mailing list for Jackrabbit oak? > > Thanks! > Roy > >> On 06 Jan 2016, at 12:47, Julian Sedding <jsedd...@gmail.com> wrote: >> >> Hi Roy >> >> This relat

Re: How to reindex lucene

2016-01-06 Thread Julian Sedding
I missed the last two messages. The issue mentioned is fixed in 1.0.23 (you are running 10.0.22). Since Chetan fixed it he may know much better than I do if you may be observing the same issue ;) Regards Julian On Wed, Jan 6, 2016 at 1:15 PM, Julian Sedding <jsedd...@gmail.com> wrote: &g

Re: Uploaded file MIME type

2015-10-09 Thread Julian Sedding
Have you inspected your HTTP traffic, specifically the POST request that your client sends? Your client might be sending the image/x-png as a Content-Type header. Not 100% sure that the SlingPostServlet takes that into account, but I think it does. Regards Julian On Fri, Oct 9, 2015 at 9:38 PM,

Re: Control JcrInstaller (OsgiInstaller) Behavior of Bundle Updating vs Installing

2015-09-22 Thread Julian Sedding
Maybe this is abit far fetched. I get the impression that we are (need to be) moving from a "per artifact" towards a "deployment" paradigm. Approaches pioneered by crankstart and the provisioning model may become desirable (as an option) for the installer. By specifying the desired deployment

Re: Control JcrInstaller (OsgiInstaller) Behavior of Bundle Updating vs Installing

2015-09-22 Thread Julian Sedding
ood > plans on what / how to do it. We just need to implement them :) :) Regards Julian On Tue, Sep 22, 2015 at 9:36 AM, Carsten Ziegeler <cziege...@apache.org> wrote: > Am 22.09.15 um 08:36 schrieb Julian Sedding: >> Maybe this is abit far fetched. I get the impress

Re: Control JcrInstaller (OsgiInstaller) Behavior of Bundle Updating vs Installing

2015-09-22 Thread Julian Sedding
r contains the client's customizations. So yes, the challenge is to define an intuitive way of letting the old and new worlds coexist in harmony. Regards Julian On Tue, Sep 22, 2015 at 8:51 AM, Bertrand Delacretaz <bdelacre...@apache.org> wrote: > On Tue, Sep 22, 2015 at 8:36 AM, Ju

Re: Route mapping for dynamic resources in Sling

2015-03-09 Thread Julian Sedding
Hi Duy You may want to implement a ResourceProvider. It allows you to hook an arbitrary resource subtree into Sling's resource tree backed by your won logic. For the read-only case that's not even very complicated. Bertrand created a PlanetResourceProvider example some time ago[0]. That may be

Re: Replacing resolver.getResource() with sling:include

2015-02-04 Thread Julian Sedding
Hi Robert You could always do the following: sling:include path=%= resource.getPath() %.config.js resourceType=my/component/ Regards Julian On Wed, Feb 4, 2015 at 12:47 PM, Robert Munteanu romb...@apache.org wrote: Hi, I have a ResourceResolver.getResource call which I would like

Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread Julian Sedding
The class org.apache.sling.installer.provider.jcr.impl.JcrInstaller is by default configured to only take folders into account that are called install. In CQ/AEM folders may be called install or config. Regards Julian On Mon, Feb 2, 2015 at 1:54 PM, Bertrand Delacretaz bdelacre...@apache.org

Re: Make a JcrUtils created node writable from WebDAV?

2014-11-26 Thread Julian Sedding
/opt/sling/sling/org.apache.sling.launchpad-8-SNAPSHOT-standalone.jar -c /var/lib/sling -p 8090 -a 0.0.0.0 -Bruce From: Julian Sedding jsedd...@gmail.commailto:jsedd...@gmail.com Reply-To: users@sling.apache.orgmailto:users@sling.apache.org users@sling.apache.orgmailto:users@sling.apache.org

Re: looking for feedback

2014-11-25 Thread Julian Sedding
Hi Jason You should be able to create a txt.jsp file and call your resource with the txt extension. I.e. /content/foo.txt. This is assuming that your resource is /content/foo and not /content/foo.html. Implementing a servlet is (largely) equivalent to implementing a JSP. So choose whichever is

Re: Make a JcrUtils created node writable from WebDAV?

2014-11-25 Thread Julian Sedding
Hi Bruce You could try authenticating your WebDAV connection with the admin credentials. If that works, it's likely to be an issue with the setup of your JCR permissions. You may well be connecting as anonymous currently and therefore be denied writes (I'm not familiar with the vanilla Sling

Re: Script language independent overrides

2014-08-22 Thread Julian Sedding
The approach mentioned by Carsten has two drawbacks: * it changes the selectors seen by any scripts included further down the include stack (IIRC this was the reason why sling:call/ was introduced in the first place) * resourceResolution has to be done again, even though we know we want to render

Re: Script language independent overrides

2014-08-22 Thread Julian Sedding
Yes, I would be in favour of deprecating sling:call/. It never felt very slingish. If we can also get rid of sling:eval/, I believe we could even simplify the ServletResolver and remove the methods that were presumably added to support these tags. One option could be to extend the sling:call/ tag

Re: Script language independent overrides

2014-08-22 Thread Julian Sedding
-08-22 12:51 GMT+02:00 Julian Sedding jsedd...@gmail.com: Yes, I would be in favour of deprecating sling:call/. It never felt very slingish. If we can also get rid of sling:eval/, I believe we could even simplify the ServletResolver and remove the methods that were presumably added to support

Re: Delayed node creation for audit logging

2013-04-05 Thread Julian Sedding
Hi Lukas While the Jobs are automatically queued, these queues are persistent. As I understand you are looking into batching several small writes into one big write. Thus I don't think a job queue will help you, as jobs are persisted, I assume using rather small writes. Depending on what your

Re: Resolving adds repetetivly resource to the resource path

2013-02-05 Thread Julian Sedding
Hi Ulrich Looking at the Recent Requests trace you provided, I would suspect that your topnav.jsp has an include on itself. This results in endless recursion, which is evident by the error you get. I would expect the error message to be a RecursionTooDeepException, indicating that the nesting of

Re: Resolving adds repetetivly resource to the resource path

2013-02-05 Thread Julian Sedding
Julian Sedding jsedd...@gmail.com hat am 5. Februar 2013 um 09:28 geschrieben: Hi Ulrich Looking at the Recent Requests trace you provided, I would suspect that your topnav.jsp has an include on itself. This results in endless recursion, which is evident by the error you get. I would expect

Re: Resource Resolving basic questions

2013-01-28 Thread Julian Sedding
Hello Ulrich Just a small thing I spotted: If you request the URI /content/mywebsite/en/products/navimage.png, the script at /apps/mywebsite/components/contentpage/navimage.png.java will not help you. It might help you, if you were requesting /content/mywebsite/en/products.navimage.png (note

Re: Multi-tenancy support in Sling - SLING-2656

2012-11-12 Thread Julian Sedding
Hi Amit Thanks for taking a stab at multi-tenancy support. I have looked at your patch and I re-read Felix' draft spec on the wiki[0]. The code and the spec leave me with some thoughts. Sorry for the lengthy reply, the thoughts are still pretty fresh in my mind. The spec states that

Re: Multi-tenancy support in Sling - SLING-2656

2012-11-12 Thread Julian Sedding
Hi Felix On Mon, Nov 12, 2012 at 10:55 AM, Felix Meschberger fmesc...@adobe.com wrote: Hi Julian Am 12.11.2012 um 10:33 schrieb Julian Sedding: Hi Amit Thanks for taking a stab at multi-tenancy support. I have looked at your patch and I re-read Felix' draft spec on the wiki[0]. The code

Re: Multi-tenancy support in Sling - SLING-2656

2012-11-12 Thread Julian Sedding
Hi Alex On Mon, Nov 12, 2012 at 1:07 PM, Alexander Klimetschek aklim...@adobe.com wrote: On 12.11.2012, at 10:55, Felix Meschberger fmesc...@adobe.com wrote: Considering that most requests to websites are anonymous, I suggest that multi-tenancy support should only care about the resource being

Re: mix:versionable on an nt:file node

2012-05-11 Thread Julian Sedding
Hi Günther On Mac, I copy files in the Terminal in order to avoid the ._* metadata files. That worked fine for me with WebDAV and Jackrabbit/Sling so far. Regarding your question: whether documents are indexed or not depends on your configuration, namely the textFilterClasses option of your

Re: SlingPostServlet - Real-world concerns and general thoughts. Discussion encouraged!

2012-05-02 Thread Julian Sedding
Hi David This is an interesting question and I consider the concerns you mention absolutely valid. I have been thinking about this problem before, but never got around to implementing/prototyping my ideas. In a SlingPostProcessor, the changes should not yet be persisted, so it should be possible

Re: creating or giving users full write access?

2011-07-28 Thread Julian Sedding
. Is there a group that has full write access by default that I could add the users to? On Jul 27, 2011, at 12:39 PM, Julian Sedding wrote: Hi Craig Your newly created user is probably doesn't have any permissions and is not in a group from which it could inherit permissions. Did you see

Re: creating or giving users full write access?

2011-07-27 Thread Julian Sedding
Hi Craig Your newly created user is probably doesn't have any permissions and is not in a group from which it could inherit permissions. Did you see the documentation about managing permissions[0] in Sling? Regards Julian [0]

Re: Changing the extension with sling:include

2011-07-17 Thread Julian Sedding
Hi Phil You can simply do sling:include path=.json/ if you want the current resource rendered as json or in your case sling:include path=%=child.getPath()%.json/ (optionally with resourceType attribute). Note: the default json rendering servlet sets the Content-Type header to application/json.

Re: Beginners question with Sling.

2011-07-08 Thread Julian Sedding
Hi Phil Check out the integration tests, as Bertrand suggested. In the class AbstractAuthenticatedTest[0] there is pretty much the same code you're trying to write. I think that should get you going. Regards Julian [0]

Re: serve static file?

2011-05-12 Thread Julian Sedding
will be served from CDN eventually. So, I'm not concerned with performance. On Thu, May 12, 2011 at 6:30 AM, Julian Sedding jsedd...@gmail.com wrote: Hi Sam Why would you want to do this? If it's for performance reasons, did you measure if there is actually a problem? If you request

Re: implicit sling:resourceType?

2011-03-03 Thread Julian Sedding
Hi Sam I think the RequestDispatcherOptions[0] might be what you're looking for. It allows you to control certain aspects of re-dispatching (forwarding and including) a request, including forcing a different resource type. You could use this API in a servlet registered for the edit selector, as

Re: alias or reference?

2010-11-08 Thread Julian Sedding
Hi Sam Regarding SLING-1778: it's not feasible to leverage the SLING-1778 features for all aspects within CQ5, as some of the CQ5 features directly access the JCR API and thus the ResourceProvider magic happening in Sling is not effective. This is especially true for page nodes. If the nodes