Hi, On Sun, Nov 9, 2014 at 2:04 AM, Bruce Edge <[email protected]> wrote: > ...What's the equivalent mechanism in sling for persisting a hierarchy of > POJOs?...
I'd say Sling Models, though I haven't used them myself much so far. You might want to ask more specific questions if you try them. Some object-to-JCR mapping libraries have been created but we don't recommend using them, see http://markmail.org/message/wmqggzrxwxearmyh for discussions. > Similarly, editing such POJOs. The current app uses a JavaScript app to > navigate the tree > and read/write objects. Sling adds a lot more functionality to the basic > servlet container so > I'm wondering what client-side frameworks take advantage of this... Backbone.js comes to mind but I also haven't used it myself (infrastructure guy here ;-) I had some interesting discussions with Sandro Boehme about this at adaptTo, where he mentioned the Sling Content Editor that he recently contributed could serve as a basis for simple extensible CRUD operations. I've long thought that using the Sling resourceType mechanism to select or generate editing models would be nice, so maybe that's an appropriate extension to that editor. > > Where can I find information on the conventions regarding the JCR structure? > Some resources indicate > content belongs in a JCR_ROOT named /content, but I"m not sure if this is a > convention or what > the standard internal mapping for the JCR is.... That's just a convention - there's some guidance at http://wiki.apache.org/jackrabbit/DavidsModel and I have a presentation on typical content models at http://www.slideshare.net/bdelacretaz/a-jcr-view-of-the-world-everything-is-content-everything-is-a-tree (video at http://vimeo.com/44298693) - JCR doesn't force anything here which is good and bad as you need to find you way, in general starting with "how would I do that in a filesystem" is a good idea. Finding out about what granularity to use was one of my big hurdles when starting with JCR, but once you've done a few content models that should be much easier and the benefits of getting a good model are huge, so feel free to discuss your suggested content models here! > > ...The real reason for this is we have a lot of media files that need to be > stored in a > hierarchy and referenced by the above POJOs. One of the initial tasks is to > create an > import mechanism that unpacks a zip and extracts it into the JCR at a > particular node path. > What's the accepted convention for ingesting bulk data?... You might create a custom POST servlet that gets the zip stream, unpacks it (ideally streaming) and creates the corresponding nodes. Or if it's relatively small zips, copy them in an "incoming" folder in the repository via WebDAV or PUT requests and use observation to detect and process them. Which is the two options that you suggested ;-) > ...Then there's the issue of users, permissions, change auditing, etc. > Is there an existing mechanism for connecting to an LDAP server?... Sling delegates this to the JCR repository, I'm not sure if there are out-of-the box LDAP modules for Jackrabbit or Oak but that would be the places to look at. > ...What is needed to track user edits, and create change records for edits > made by specific users, > to a specific tree hierarchy of content, or by other sort criteria?... You can use observation to watch that tree and create audit content. Hope this helps, -Bertrand
