Different ways to define initial content :: Content.xml vs Json equivalent

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Different ways to define initial content :: Content.xml vs Json equivalent

Greg Fullard
Hi All

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?

Much appreciated

Greg

--


------------------------------
*Unlock Interaction*
CIC = Correspondence, Interactions & Communications


*8 BIT PLATOON disclaimer*
This e-mail transmission contains confidential information, which is the
property of EOH Holdings Limited and its subsidiaries (“EOH”). No person,
other than the recipient (so indicated by the sender) may use or disclose
the contents of this message, links or attachments hereto, to any person
whatsoever. Unauthorised disclosure and/or use may result in civil and
criminal liability.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorised to
state them to be the views of any such entity.
The disclaimer forms part of the content of this e-mail in terms of section
11 of the Electronic Communications and Transactions Act, 25 of 2002. Refer
to http://www.eoh.co.za/disclaimer 
------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

chrismillar
>
> 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 | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Andreas Schaefer
In reply to this post by Greg Fullard
Hi Greg

One difference between an JCR Content Package (ZIP file) is that you can use
the exploded tree inside the Eclipse or IntelliJ plugin and edit / deploy / import (from
server) one file at a time. With the Bundle Content you have to deploy it
as an entire bundle.

If working with JSon you have to keep in mind that:

1) You don’t have comments but you can add a comment attribute but
    see that as JCR property

2) There is only a SINGLE LINE text in JSon

This works:

        “attributeOne” : “One line is ok”

This does not:

        “attributeTwo” : “This line will
                                  fail as it is multi line”

For most part this is ok but certain configurations that is not good.

Having worked on bigger AEM projects we ended up having many
JCR Content Packages and OSGi Bundles and so eventually we
used a dedicated ALL JCR Package which is just there to bundle up
all artifacts and deploy them in one swoop.

For most part I prefer the Bundle Contents over JCR Packages especially
with Sling as Composum prints outs node properties as JSon. That said
I never worked on a big project with it and so I don’t know what issues
I would face. A friend of mine said they ran into issues with it.

As far as I know SLING-INF is not needed but I would recommend to
place your content is a specially marked folder and not just
/scr/main/resources.

This line is more instructive:

        SLING-INF/libs/sling/validation/i18n;overwrite:=true;path:=/libs/sling/validation/i18n

than this:

        apps/fling;path:=/apps/fling;overwrite:=true;uninstall:=true

In Sling 9 you can have both JCR Packages and Bundle Content w/o any issues.

Cheers - Andy

> On Apr 1, 2017, at 4:18 AM, Greg Fullard <[hidden email]> wrote:
>
> Hi All
>
> 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?
>
> Much appreciated
>
> Greg
>
> --
>
>
> ------------------------------
> *Unlock Interaction*
> CIC = Correspondence, Interactions & Communications
>
>
> *8 BIT PLATOON disclaimer*
> This e-mail transmission contains confidential information, which is the
> property of EOH Holdings Limited and its subsidiaries (“EOH”). No person,
> other than the recipient (so indicated by the sender) may use or disclose
> the contents of this message, links or attachments hereto, to any person
> whatsoever. Unauthorised disclosure and/or use may result in civil and
> criminal liability.
> Any views expressed in this message are those of the individual sender,
> except where the message states otherwise and the sender is authorised to
> state them to be the views of any such entity.
> The disclaimer forms part of the content of this e-mail in terms of section
> 11 of the Electronic Communications and Transactions Act, 25 of 2002. Refer
> to http://www.eoh.co.za/disclaimer 
> ------------------------------
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Robert Munteanu-2
In reply to this post by Greg Fullard
Hi Greg,

On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:

> Hi All
>
> 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.

In addition to what others have said, there is plan ( with no time
commitment ) to add our own content-package Maven plugin, which would
make this kind of project usable with Maven.

  https://issues.apache.org/jira/browse/SLING-6081

Robert

>    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?
>
> Much appreciated
>
> Greg
>

Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Andreas Schaefer-4
Why is that necessary? The one from Adobe isn't good enough?

- Andy Schaefer

> On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]> wrote:
>
> Hi Greg,
>
>> On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
>> Hi All
>>
>> 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.
>
> In addition to what others have said, there is plan ( with no time
> commitment ) to add our own content-package Maven plugin, which would
> make this kind of project usable with Maven.
>
>  https://issues.apache.org/jira/browse/SLING-6081
>
> Robert
>
>>    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?
>>
>> Much appreciated
>>
>> Greg
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Roy Teeuwen
Hey Andy,

The license inside might not be good enough ;)

Greets,
Roy

> On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]> wrote:
>
> Why is that necessary? The one from Adobe isn't good enough?
>
> - Andy Schaefer
>
>> On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]> wrote:
>>
>> Hi Greg,
>>
>>> On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
>>> Hi All
>>>
>>> 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.
>>
>> In addition to what others have said, there is plan ( with no time
>> commitment ) to add our own content-package Maven plugin, which would
>> make this kind of project usable with Maven.
>>
>> https://issues.apache.org/jira/browse/SLING-6081
>>
>> Robert
>>
>>>   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?
>>>
>>> Much appreciated
>>>
>>> Greg
>>>
>>


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Robert Munteanu-2
On Tue, 2017-04-04 at 08:32 +0200, Roy Teeuwen wrote:

> Hey Andy,
>
> The license inside might not be good enough ;)
>
> Greets,
> Roy
> > On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]>
> > wrote:
> >
> > Why is that necessary? The one from Adobe isn't good enough?

IANAL and speaking only as an Apache committer, not as an Adobe
employee.

That being said, that artifact is not present on Maven central, and on
repo.adobe.com the following disclaimer is used

    This maven2 repository provides access to public artifacts used in
    conjunction with developing java-based applications on Adobe
    frameworks. Adobe Terms apply.

Adobe terms links to http://www.adobe.com/misc/terms.html .

I for one would not use that plugin in Apache Sling applications
without legal advice, but a brief look tells me that these are not
intended for use with non-Adobe apps.

Robert

> >
> > - Andy Schaefer
> >
> > > On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]>
> > > wrote:
> > >
> > > Hi Greg,
> > >
> > > > On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
> > > > Hi All
> > > >
> > > > 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.
> > >
> > > In addition to what others have said, there is plan ( with no
> > > time
> > > commitment ) to add our own content-package Maven plugin, which
> > > would
> > > make this kind of project usable with Maven.
> > >
> > > https://issues.apache.org/jira/browse/SLING-6081
> > >
> > > Robert
> > >
> > > >   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?
> > > >
> > > > Much appreciated
> > > >
> > > > Greg
> > > >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Andreas Schaefer
Yes, I was thinking that might be the issue.

Do you guess have already something on Git?

Thanks - Andy Schaefer

> On Apr 4, 2017, at 12:13 AM, Robert Munteanu <[hidden email]> wrote:
>
> On Tue, 2017-04-04 at 08:32 +0200, Roy Teeuwen wrote:
>> Hey Andy,
>>
>> The license inside might not be good enough ;)
>>
>> Greets,
>> Roy
>>> On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]>
>>> wrote:
>>>
>>> Why is that necessary? The one from Adobe isn't good enough?
>
> IANAL and speaking only as an Apache committer, not as an Adobe
> employee.
>
> That being said, that artifact is not present on Maven central, and on
> repo.adobe.com the following disclaimer is used
>
>    This maven2 repository provides access to public artifacts used in
>    conjunction with developing java-based applications on Adobe
>    frameworks. Adobe Terms apply.
>
> Adobe terms links to http://www.adobe.com/misc/terms.html .
>
> I for one would not use that plugin in Apache Sling applications
> without legal advice, but a brief look tells me that these are not
> intended for use with non-Adobe apps.
>
> Robert
>
>>>
>>> - Andy Schaefer
>>>
>>>> On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]>
>>>> wrote:
>>>>
>>>> Hi Greg,
>>>>
>>>>> On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
>>>>> Hi All
>>>>>
>>>>> 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.
>>>>
>>>> In addition to what others have said, there is plan ( with no
>>>> time
>>>> commitment ) to add our own content-package Maven plugin, which
>>>> would
>>>> make this kind of project usable with Maven.
>>>>
>>>> https://issues.apache.org/jira/browse/SLING-6081
>>>>
>>>> Robert
>>>>
>>>>>   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?
>>>>>
>>>>> Much appreciated
>>>>>
>>>>> Greg
>>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Roy Teeuwen
Hey Andy,

As you can see in the ticket, there is already something that exists:

> a good starting point for this may be the wcm.io content package maven plugin:
> • http://wcm.io/tooling/maven/plugins/wcmio-content-package-maven-plugin/
> • https://github.com/wcm-io/wcm-io-tooling/tree/develop/maven/plugins/wcmio-content-package-maven-plugin


Greets,
Roy

> On 4 Apr 2017, at 17:28, Andreas Schaefer Sr. <[hidden email]> wrote:
>
> Yes, I was thinking that might be the issue.
>
> Do you guess have already something on Git?
>
> Thanks - Andy Schaefer
>
>> On Apr 4, 2017, at 12:13 AM, Robert Munteanu <[hidden email]> wrote:
>>
>> On Tue, 2017-04-04 at 08:32 +0200, Roy Teeuwen wrote:
>>> Hey Andy,
>>>
>>> The license inside might not be good enough ;)
>>>
>>> Greets,
>>> Roy
>>>> On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]>
>>>> wrote:
>>>>
>>>> Why is that necessary? The one from Adobe isn't good enough?
>>
>> IANAL and speaking only as an Apache committer, not as an Adobe
>> employee.
>>
>> That being said, that artifact is not present on Maven central, and on
>> repo.adobe.com the following disclaimer is used
>>
>>   This maven2 repository provides access to public artifacts used in
>>   conjunction with developing java-based applications on Adobe
>>   frameworks. Adobe Terms apply.
>>
>> Adobe terms links to http://www.adobe.com/misc/terms.html .
>>
>> I for one would not use that plugin in Apache Sling applications
>> without legal advice, but a brief look tells me that these are not
>> intended for use with non-Adobe apps.
>>
>> Robert
>>
>>>>
>>>> - Andy Schaefer
>>>>
>>>>> On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]>
>>>>> wrote:
>>>>>
>>>>> Hi Greg,
>>>>>
>>>>>> On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
>>>>>> Hi All
>>>>>>
>>>>>> 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.
>>>>>
>>>>> In addition to what others have said, there is plan ( with no
>>>>> time
>>>>> commitment ) to add our own content-package Maven plugin, which
>>>>> would
>>>>> make this kind of project usable with Maven.
>>>>>
>>>>> https://issues.apache.org/jira/browse/SLING-6081
>>>>>
>>>>> Robert
>>>>>
>>>>>>  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?
>>>>>>
>>>>>> Much appreciated
>>>>>>
>>>>>> Greg
>>>>>>
>>>
>>>
>>
>


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Andreas Schaefer
I tried that but for now this does not work with Sling / Composum
(call to '/bin/cpm/package.service.html/system/console/bundles/.json’).

After disabling the bundle status with ‘bundleStatusURL’ set to ‘-‘
it fails to handle the response of the installation as Composum returns
nothing.

Did anyone successfully deployed a package with this on Sling?
And if, how?

Thanks - Andy Schaefer

> On Apr 4, 2017, at 8:44 AM, Roy Teeuwen <[hidden email]> wrote:
>
> Hey Andy,
>
> As you can see in the ticket, there is already something that exists:
>
>> a good starting point for this may be the wcm.io content package maven plugin:
>> • http://wcm.io/tooling/maven/plugins/wcmio-content-package-maven-plugin/
>> • https://github.com/wcm-io/wcm-io-tooling/tree/develop/maven/plugins/wcmio-content-package-maven-plugin
>
>
> Greets,
> Roy
>> On 4 Apr 2017, at 17:28, Andreas Schaefer Sr. <[hidden email]> wrote:
>>
>> Yes, I was thinking that might be the issue.
>>
>> Do you guess have already something on Git?
>>
>> Thanks - Andy Schaefer
>>
>>> On Apr 4, 2017, at 12:13 AM, Robert Munteanu <[hidden email]> wrote:
>>>
>>> On Tue, 2017-04-04 at 08:32 +0200, Roy Teeuwen wrote:
>>>> Hey Andy,
>>>>
>>>> The license inside might not be good enough ;)
>>>>
>>>> Greets,
>>>> Roy
>>>>> On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]>
>>>>> wrote:
>>>>>
>>>>> Why is that necessary? The one from Adobe isn't good enough?
>>>
>>> IANAL and speaking only as an Apache committer, not as an Adobe
>>> employee.
>>>
>>> That being said, that artifact is not present on Maven central, and on
>>> repo.adobe.com the following disclaimer is used
>>>
>>>  This maven2 repository provides access to public artifacts used in
>>>  conjunction with developing java-based applications on Adobe
>>>  frameworks. Adobe Terms apply.
>>>
>>> Adobe terms links to http://www.adobe.com/misc/terms.html .
>>>
>>> I for one would not use that plugin in Apache Sling applications
>>> without legal advice, but a brief look tells me that these are not
>>> intended for use with non-Adobe apps.
>>>
>>> Robert
>>>
>>>>>
>>>>> - Andy Schaefer
>>>>>
>>>>>> On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>> Hi Greg,
>>>>>>
>>>>>>> On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
>>>>>>> Hi All
>>>>>>>
>>>>>>> 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.
>>>>>>
>>>>>> In addition to what others have said, there is plan ( with no
>>>>>> time
>>>>>> commitment ) to add our own content-package Maven plugin, which
>>>>>> would
>>>>>> make this kind of project usable with Maven.
>>>>>>
>>>>>> https://issues.apache.org/jira/browse/SLING-6081
>>>>>>
>>>>>> Robert
>>>>>>
>>>>>>> 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?
>>>>>>>
>>>>>>> Much appreciated
>>>>>>>
>>>>>>> Greg
>>>>>>>
>>>>
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Different ways to define initial content :: Content.xml vs Json equivalent

Roy Teeuwen
Hey Andreas,

It works when using the content package plugin of Adobe, so it shouldn't be hard to get the WCM.IO to work too, you can always contribute to it I guess :)..

Following config works with the adobe plugin:
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
<id>install-package</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<packageFile>${project.build.directory}/${project.build.finalName}.zip</packageFile>
<targetURL><a href="http://${sling.host}:${sling.port}/bin/cpm/package.service.html" class="">http://${sling.host}:${sling.port}/bin/cpm/package.service.html</targetURL>
<userId>${sling.user}</userId>
<password>${sling.password}</password>
<useProxy>false</useProxy>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>


Greets,
Roy


On 14 Apr 2017, at 16:00, Andreas Schaefer Sr. <[hidden email]> wrote:

I tried that but for now this does not work with Sling / Composum
(call to '/bin/cpm/package.service.html/system/console/bundles/.json’).

After disabling the bundle status with ‘bundleStatusURL’ set to ‘-‘
it fails to handle the response of the installation as Composum returns
nothing.

Did anyone successfully deployed a package with this on Sling?
And if, how?

Thanks - Andy Schaefer

On Apr 4, 2017, at 8:44 AM, Roy Teeuwen <[hidden email]> wrote:

Hey Andy,

As you can see in the ticket, there is already something that exists:

a good starting point for this may be the wcm.io content package maven plugin:
http://wcm.io/tooling/maven/plugins/wcmio-content-package-maven-plugin/
https://github.com/wcm-io/wcm-io-tooling/tree/develop/maven/plugins/wcmio-content-package-maven-plugin


Greets,
Roy
On 4 Apr 2017, at 17:28, Andreas Schaefer Sr. <[hidden email]> wrote:

Yes, I was thinking that might be the issue.

Do you guess have already something on Git?

Thanks - Andy Schaefer

On Apr 4, 2017, at 12:13 AM, Robert Munteanu <[hidden email]> wrote:

On Tue, 2017-04-04 at 08:32 +0200, Roy Teeuwen wrote:
Hey Andy,

The license inside might not be good enough ;)

Greets,
Roy
On 3 Apr 2017, at 22:50, Andreas Schaefer <[hidden email]>
wrote:

Why is that necessary? The one from Adobe isn't good enough?

IANAL and speaking only as an Apache committer, not as an Adobe
employee.

That being said, that artifact is not present on Maven central, and on
repo.adobe.com the following disclaimer is used

This maven2 repository provides access to public artifacts used in
conjunction with developing java-based applications on Adobe
frameworks. Adobe Terms apply.

Adobe terms links to http://www.adobe.com/misc/terms.html .

I for one would not use that plugin in Apache Sling applications
without legal advice, but a brief look tells me that these are not
intended for use with non-Adobe apps.

Robert


- Andy Schaefer

On Apr 3, 2017, at 3:23 AM, Robert Munteanu <[hidden email]>
wrote:

Hi Greg,

On Sat, 2017-04-01 at 13:18 +0200, Greg Fullard wrote:
Hi All

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.

In addition to what others have said, there is plan ( with no
time
commitment ) to add our own content-package Maven plugin, which
would
make this kind of project usable with Maven.

https://issues.apache.org/jira/browse/SLING-6081

Robert

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?

Much appreciated

Greg









signature.asc (817 bytes) Download Attachment