>
> I see that there is some difference between how content projects are
> handled between the Sling IDE tools and the Maven archetypes.
>
>
>    1. The "Sling Content Project" wizard creates a project with a jcr_root
>    folder which then contains folders and content.xml files. This is very
>    similar to what I'm used to with AEM Archetype 10.
>    2. The sling-initial-content-archetype, on the other hand, generates a
>    SLING-INF folder with an XML node descriptor file (as explained at
>    http://sling.apache.org/documentation/bundles/content-
> loading-jcr-contentloader.html
>    )
>    3. The Slingbucks example uses JSON descriptor files.
>
>
> Obviously all these methods work, but I'm interested to get an idea of what
> the recommended method is. Perhaps based on specific criteria of my
> project?
>

The Sling Content Project
This won't come with a pom.xml, so it can make scaling and deployment a
little tough. It does use the .content.xml method which I think is a little
cleaner than the other methods.

The Sling Initial Content Maven Project
This uses the XML node descriptor method. It also (obviously) comes with a
pom.xml, so CI is not really an issue.

Slingbucks Example
Using JSON is arguably cleaner than XML, but it can come with trade-offs.
In my opinion, Slingbucks is an effective use of this method.

What are the trade-offs of using JSON?

If your node needs to have it described (I.E. resourceSuperType) AND it
needs to have content (I.E. HTML), you can end up having a funky looking
project structure:

my-node.json
my-node
|--- my-node.html
|--- body.html

To me it has always seemed a little weird to have two files describe what a
resource should look like.

My recommendations:
If you're working with someone adverse to XML, go the JSON route. If you're
wanting something more verbose, go the XML node descriptor route. If you're
used to AEM, go the .content.xml route.

Reply via email to