Hello, So I've realized my previous question was dumb, ACLs always get returned when you provide a depth to the JSON servlet...
Considering the lack of responses, Re-importing exported JSON, including the priviliges, doesn't seem to be a feature that lots of people need, so I will try to patch the importer on my own :) I was wondering if pull requests on Github are the best way to submit patches to Sling, or if you prefer diff files attached to a ticket. Thank you, Guillaume 2017-03-20 11:50 GMT+01:00 Guillaume Lucazeau <[email protected]>: > Hello, > > I realized that when getting some content as JSON from the basic servlet, > I sometimes get the ACLs nodes. But this only happens in some environment, > not on my local environment nor with a simple Sling standalone jar. > > Can you confirm that I shouldn't get ACLs nodes when getting content as > JSON? > > Because that's why I asked how to handled those nodes during JSON import, > but I may have been mistaken by an unusual situation. > > Thank you, > Guillaume > > 2017-03-07 11:15 GMT+01:00 Guillaume Lucazeau <[email protected]>: > >> Hello, >> >> I'm having troubles finding where I should handle ACLs nodes. In your >> first e-mail you said >> > Not sure about ACLs though, it seems like they should be handled by the >> content importer. >> >> From what I see the content importer is the main entry point for content >> import and is handling JSON or XML content, content that can contain actual >> nodes and ACLs nodes. Therefore, I don't really understand how I could What >> did you have in mind? >> From my understanding, the DefaultContentCreator would have to be able to >> create ACLs node and properties. >> >> Any advice or suggestion on how to implement ACLs imports would be really >> helpful. >> >> Is that something already available in Adobe products built on top of >> Sling? >> >> Thank you very much for your help. >> >> Best regards, >> Guillaume >> >> >> On Mon, Mar 6, 2017 at 5:39 PM, Guillaume Lucazeau <[email protected]> >> wrote: >> >>> I have created this ticket, for protected properties and nodes: >>> https://issues.apache.org/jira/browse/SLING-6614 >>> >>> I have realized after my previous e-mail that autocreated properties >>> would actually be there after node creation and that I could check their >>> protected status. I have created this PR: https://github.com/apache/slin >>> g/pull/201 if you want to have a look. It works with my content export, >>> but I am not sure it covers all the cases. >>> >>> I will probably have more questions about ACLs and the content importer. >>> >>> Thank you, >>> Guillaume >>> >>> On Mon, Mar 6, 2017 at 5:03 PM, Robert Munteanu <[email protected]> >>> wrote: >>> >>>> Hi Guillaume, >>>> >>>> On Mon, 2017-03-06 at 12:20 +0100, Guillaume Lucazeau wrote: >>>> > Hello Robert, >>>> > >>>> > I finally have time this week to work on those enhancements, required >>>> > on >>>> > our project. How does it work, should I create tickets in Sling Jira >>>> > and >>>> > put a comment saying that i'm trying to fix this? >>>> >>>> Yup, sounds like a good idea. >>>> >>>> > >>>> > I have a question regarding your previous answer: how will this work >>>> > for >>>> > new properties? For instance, if I want to import some JSON for new >>>> > nodes >>>> > containing a "jcr:created" property, those new nodes will not contain >>>> > any >>>> > property and therefore I won't be able to check if "jcr:created" is >>>> > protected or not, am I right? >>>> >>>> You should be able to get more information by accessing the node's >>>> primary/mixin node types and node definition. >>>> >>>> Robert >>>> >>>> > >>>> > I have started to look at the DefaultContentCreator class in the jcr >>>> > contentloader, but any help would be useful. >>>> > >>>> > Best regards, >>>> > Guillaume >>>> > >>>> > On Wed, Dec 21, 2016 at 1:08 PM, Robert Munteanu <[email protected]> >>>> > wrote: >>>> > >>>> > > On Wed, 2016-12-21 at 12:30 +0100, Guillaume Lucazeau wrote: >>>> > > > Hello Robert, >>>> > > > >>>> > > > Is it something that would be valuable to Sling itself, or should >>>> > > > I >>>> > > > try to >>>> > > > do it just for my project? >>>> > > >>>> > > Enhancements to the content loader are more than welcome in Sling >>>> > > :-) >>>> > > >>>> > > > I couldn't find a list of all protected properties in Jackrabbit, >>>> > > > do >>>> > > > you >>>> > > > know if there is one? Or maybe there is a way to dynamically know >>>> > > > if >>>> > > > a >>>> > > > property is protected >>>> > > >>>> > > javax.jcr.Node#getProperties() will get you a list of properties >>>> > > defined on a node, and then you can use >>>> > > javax.jcr.Property#getDefinition() to retrieve its definition. >>>> > > Finally, >>>> > > javax.jcr.nodetype.PropertyDefinition#isProtected() will let you >>>> > > know >>>> > > if the property is protected. >>>> > > >>>> > > Robert >>>> > > >>>> > > > >>>> > > > Thank you >>>> > > > >>>> > > > Regards, >>>> > > > Guillaume >>>> > > > >>>> > > > On Sat, Dec 17, 2016 at 9:18 PM, Robert Munteanu <rombert@apache. >>>> > > > org> >>>> > > > wrote: >>>> > > > >>>> > > > > Hi Guillaume, >>>> > > > > >>>> > > > > On Tue, 2016-11-29 at 18:36 +0100, Guillaume Lucazeau wrote: >>>> > > > > > Hello, >>>> > > > > > >>>> > > > > > Currently when you get content through the json extension, it >>>> > > > > > contains >>>> > > > > > protected properties ("jcr:created", "jcr:createdBy") and >>>> > > > > > permissions >>>> > > > > > nodes. >>>> > > > > > >>>> > > > > > The protected properties prevent the JSON to be immediately >>>> > > > > > reimported in >>>> > > > > > another repository, and for what I see here [1] permissions >>>> > > > > > are >>>> > > > > > not >>>> > > > > > handled >>>> > > > > > by the content loader. >>>> > > > > > >>>> > > > > > Is there an easy way to configure the JSON servlet to return >>>> > > > > > only >>>> > > > > > content >>>> > > > > > that can be imported again? Or do I have to override this >>>> > > > > > servlet >>>> > > > > > and >>>> > > > > > filter/remove those properties myself? >>>> > > > > >>>> > > > > Maybe a better idea would be to enhance the content loader to >>>> > > > > skip >>>> > > > > protected properties. Not sure about ACLs though, it seems like >>>> > > > > they >>>> > > > > should be handled by the content importer. >>>> > > > > >>>> > > > > Robert >>>> > > > > >>>> > > > > > >>>> > > > > > Thank you, >>>> > > > > > Guillaume >>>> > > > > > >>>> > > > > > [1] http://stackoverflow.com/a/21406709/1987781 >>>> > > > > >>>> > > > > >>>> > > >>>> > > >>>> >>>> >>> >> >
