Thank you Olaf for your answer. I have currently little information about the app. What I know is that it will mostly manage documents, organized like this: - network (a dozen) -- documents: around 1,500 --- pages: around 15,000 (total) ---- components (graphs, map, picture etc.): 1 to 4 per page, total around 70,000
Adding to this, they want to provide questionnaires and then manage answers. Also make pages and/or component commentable (I was thinking about a mixin to manage that(?)). They want to export those comments periodically (maybe a custom JCR query would be useful here? I have to look if you can query over sling:resourceType or if you can only query jcr:primaryType) We would also have to store content in an Oracle database, which is possible I think with Jackrabbit. Identification is made through Gmail, I've seen there is an OpenID module even though it seems to be a little bit out-dated. There is currently around 500 users planned. One of the question I will have to ask them is about what seems to be a requirements: have skeleton of documents with changes propagated to every document instances (for instance, moving a certain page type to a different position than its current). I don't see how we could do that with the JCR tree. While I don't know much yet about Sling and the application we have to develop, I have the feeling that Sling is flexible and adapted to this, and could be reusable. I'm just a little afraid of the learning curve, because the documentation and even your answers sometimes seem very abstract and I don't have yet the knowledge to see how we could use it properly. But it still seems more appropriate than a custom database architecture. Once again, thank you all for your help. On Fri, Nov 13, 2015 at 10:08 PM, Olaf <[email protected]> wrote: > Hi Guillaume, > > There is no direct relationship between these models and the sling > resource type. You can look at these models as views on arbitrary > resources. Indeed, you can obtain an instance of a model by adapting to it > from an arbitrary resource, for instance: > > Resource documentResource = > resourceResolver.getResource("/path/to/document"); > Document document = documentResource.adaptTo(Document.class) > > Note, however, that these models are read-only, i.e. there is currently no > support to persist them*. > > However, whether you require structured data (specific node types) or > unstructured data, sling models or anything else really depends on you use > cases. For many cases, storing the data with suitable sling:resourceTypes > and rendering it on demand (e.g. using Sightly) is completely sufficient. > > Sling differs from other web frameworks in that it does not restrict you > to one specific way in which to deal with things, but offers a very vast > amount of options. In other words: What is your use case? For instance, > what is the semantic structure of your data, who shall be using it and what > for, how does it change / update, what data volume do you expect etc. > Following, I'd then look at how these semantics are best expressed in a > RESTful architectural style (which is the core concept of Sling). > > I'd address the implementation details last, since - contrary to many > other web frameworks - those do not dominate the solution design. > > Regards, > Olaf > > * Okay, there is JCR OCM, but it's dated / requires some additional work: > http://www.connectcon.ch/2015/en/speakers/katarzyna-kozlowska.html > > > -----Original Message----- > From: Guillaume Lucazeau [mailto:[email protected]] > Sent: Freitag, 13. November 2015 16:10 > To: [email protected] > Subject: Re: Resource class vs CND > > Thank you for your advice > > I got rid of my CND file and created content using sling:resourceType. I > had the idea that defining my node structure somewhere would allow me to > create form dynamically to add subnodes. > > So I've created two classes: > // Document.java > @Model(adaptables=Resource.class) > public class Document { > > @Inject @Named("jcr:title") > private String title; > > @Inject > private List<Resource> pages; > } > > // Page.java > @Model(adaptables=Resource.class) > public class Page { > > @Inject @Named("jcr:title") > private String title; > > @Inject > private List<Resource> components; > } > > But I don't see how to map them to a sling:resourceType. Is it with > getResourceType() like in here: > > https://svn.apache.org/repos/asf/sling/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/resourceprovider/PlanetResource.java > ? > > Sling definitely has its own rhythm to it and I'm slow to pick it up :) > > > > On Fri, Nov 13, 2015 at 2:48 PM, Daniel Klco <[email protected]> > wrote: > > > Agreed, I would also highly suggest looking at Sling Models as an > > option to make your code more strongly typed without requiring a rigid > > node type > > structure: > > https://sling.apache.org/documentation/bundles/models.html > > > > On Fri, Nov 13, 2015 at 8:37 AM, Jason Bailey <[email protected]> > > wrote: > > > > > My opinions: > > > > > > Sling is really about being able to take a data set and present that > > > data in multiple ways. For the vast majority of use cases you should > > > use the existing node types and property values and you don't need to > use a CND. > > > > > > A custom nodetype is useful if there is a need to perform some > > > explicit searching over a large set of data or if you absolutely > > > require > > limitations > > > on properties that the existing nodetypes don't help with. > > > > > > Avoid trying to think of it in terms of other frameworks; Sling has > > > its own rhythm to it. You have a request that identifies a resource > > > and then that data is handed off to a renderer. Using as much out > > > of the box functionality will give you the greatest flexibility. > > > > > > > > > -Jason > > > > > > -----Original Message----- > > > From: Guillaume Lucazeau [mailto:[email protected]] > > > Sent: Friday, November 13, 2015 8:01 AM > > > To: [email protected] > > > Subject: Resource class vs CND > > > > > > Hello, > > > > > > I'm currently studying Sling for a project, to store "documents" > > > containing pages, and components (image, text, maps, graphs etc.) > > > > > > While it seems to fit our needs perfectly, I'm a bit struggling to > > > learn some basic stuff before presenting a POC to our team. > > > > > > My first question would be: on what criteria should I choose to > > > manage my resources using a class extending AbstractResource or a > > > nodetype > > definition > > > in a CND file? Do you have advice on it? I'm tending to use a class > > > to > > keep > > > everything in Java, but I'm wondering if it's more/less/equally > > > flexible, and if it has drawbacks or benefits compared to a CND file. > > > > > > Thank you for every information you could give me > > > > > > Regards, > > > Guillaume > > > > > > >
