You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by connuser1 connuser1 <co...@gmail.com> on 2015/01/29 14:15:23 UTC

Implementing ModifyingResourceProvider

Hi

I am implementing the ModifyingResourceProvider intergace for the dynamodb
resource provider [0] in order to be able to create/edit/delete resources.

I needed some guidance on implementing the revert/commit/hasChanges
methods. I had a look at JCRResourceProvider and it does that through the
JCR Session.  What is the recommended way of keeping track of the transient
changes in custom resource providers like his one?

Thanks

[0] - https://github.com/sdmcraft/SlingDynamo

RE: Implementing ModifyingResourceProvider

Posted by Stefan Seifert <ss...@pro-vision.de>.
currently the nosql-generic part does not even compile... I plan to work it on the next day at least to have a running proof-of-concept, but cannot give a precise promise when it will be ready.

stefan

>-----Original Message-----
>From: connuser1 connuser1 [mailto:connuser1@gmail.com]
>Sent: Wednesday, February 04, 2015 12:46 PM
>To: users@sling.apache.org
>Subject: Re: Implementing ModifyingResourceProvider
>
>Thanks Stefan for sharing this. I was going through the nosql generic part.
>Though I haven't gone into much detail yet but I'll check how to use it
>with dynamodb. Any idea if and when it could be a part of  sling?
>
>On Mon, Feb 2, 2015 at 7:24 PM, Stefan Seifert <ss...@pro-vision.de>
>wrote:
>
>> please also take not of this recent discussion on the sling-dev mailing
>> list
>>
>> http://apache-sling.73963.n3.nabble.com/RT-Sling-Resource-Providers-for-
>NoSQL-databases-MongoDB-Couchbase-tt4046669.html
>>
>> an example for an existing NoSQL resource provider that solves these
>> problems is
>> https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/mongodb
>>
>> but as discussed in the mailing list we are currently looking to refactor
>> it into a resuable part that can be used by all NoSQL resource providers,
>> and it is very likely that this reusable part will implement all specific
>> features of the ModifyingResourceProvider as well.
>>
>> related ticket is https://issues.apache.org/jira/browse/SLING-4381
>>
>> stefan
>>
>>
>> >-----Original Message-----
>> >From: connuser1 connuser1 [mailto:connuser1@gmail.com]
>> >Sent: Thursday, January 29, 2015 2:42 PM
>> >To: users@sling.apache.org
>> >Subject: Re: Implementing ModifyingResourceProvider
>> >
>> >More specifically, how can I keep track of the update which is handled
>> >via ModifiableValueMap ? Quoting from the ModifiableValueMap documentation
>> >[1], "*Once ResourceResolver.commit() is called, the changes are finally
>> >persisted.*"
>> >
>> >Basically I am not sure, how and where can the changes
>> >in ModifiableValueMap be translated to the changes to be done on the
>> >dynamodb backend.
>> >
>> >[1] -
>> >
>>
>http://docs.adobe.com/docs/en/cq/current/javadoc/org/apache/sling/api/resource
>> >/ModifiableValueMap.html
>> >
>> >On Thu, Jan 29, 2015 at 6:45 PM, connuser1 connuser1 <connuser1@gmail.com
>> >
>> >wrote:
>> >
>> >> Hi
>> >>
>> >> I am implementing the ModifyingResourceProvider intergace for the
>> dynamodb
>> >> resource provider [0] in order to be able to create/edit/delete
>> resources.
>> >>
>> >> I needed some guidance on implementing the revert/commit/hasChanges
>> >> methods. I had a look at JCRResourceProvider and it does that through
>> the
>> >> JCR Session.  What is the recommended way of keeping track of the
>> transient
>> >> changes in custom resource providers like his one?
>> >>
>> >> Thanks
>> >>
>> >> [0] - https://github.com/sdmcraft/SlingDynamo
>> >>
>>

Re: Implementing ModifyingResourceProvider

Posted by connuser1 connuser1 <co...@gmail.com>.
Thanks Stefan for sharing this. I was going through the nosql generic part.
Though I haven't gone into much detail yet but I'll check how to use it
with dynamodb. Any idea if and when it could be a part of  sling?

On Mon, Feb 2, 2015 at 7:24 PM, Stefan Seifert <ss...@pro-vision.de>
wrote:

> please also take not of this recent discussion on the sling-dev mailing
> list
>
> http://apache-sling.73963.n3.nabble.com/RT-Sling-Resource-Providers-for-NoSQL-databases-MongoDB-Couchbase-tt4046669.html
>
> an example for an existing NoSQL resource provider that solves these
> problems is
> https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/mongodb
>
> but as discussed in the mailing list we are currently looking to refactor
> it into a resuable part that can be used by all NoSQL resource providers,
> and it is very likely that this reusable part will implement all specific
> features of the ModifyingResourceProvider as well.
>
> related ticket is https://issues.apache.org/jira/browse/SLING-4381
>
> stefan
>
>
> >-----Original Message-----
> >From: connuser1 connuser1 [mailto:connuser1@gmail.com]
> >Sent: Thursday, January 29, 2015 2:42 PM
> >To: users@sling.apache.org
> >Subject: Re: Implementing ModifyingResourceProvider
> >
> >More specifically, how can I keep track of the update which is handled
> >via ModifiableValueMap ? Quoting from the ModifiableValueMap documentation
> >[1], "*Once ResourceResolver.commit() is called, the changes are finally
> >persisted.*"
> >
> >Basically I am not sure, how and where can the changes
> >in ModifiableValueMap be translated to the changes to be done on the
> >dynamodb backend.
> >
> >[1] -
> >
> http://docs.adobe.com/docs/en/cq/current/javadoc/org/apache/sling/api/resource
> >/ModifiableValueMap.html
> >
> >On Thu, Jan 29, 2015 at 6:45 PM, connuser1 connuser1 <connuser1@gmail.com
> >
> >wrote:
> >
> >> Hi
> >>
> >> I am implementing the ModifyingResourceProvider intergace for the
> dynamodb
> >> resource provider [0] in order to be able to create/edit/delete
> resources.
> >>
> >> I needed some guidance on implementing the revert/commit/hasChanges
> >> methods. I had a look at JCRResourceProvider and it does that through
> the
> >> JCR Session.  What is the recommended way of keeping track of the
> transient
> >> changes in custom resource providers like his one?
> >>
> >> Thanks
> >>
> >> [0] - https://github.com/sdmcraft/SlingDynamo
> >>
>

RE: Implementing ModifyingResourceProvider

Posted by Stefan Seifert <ss...@pro-vision.de>.
please also take not of this recent discussion on the sling-dev mailing list
http://apache-sling.73963.n3.nabble.com/RT-Sling-Resource-Providers-for-NoSQL-databases-MongoDB-Couchbase-tt4046669.html

an example for an existing NoSQL resource provider that solves these problems is
https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/mongodb

but as discussed in the mailing list we are currently looking to refactor it into a resuable part that can be used by all NoSQL resource providers, and it is very likely that this reusable part will implement all specific features of the ModifyingResourceProvider as well.

related ticket is https://issues.apache.org/jira/browse/SLING-4381

stefan


>-----Original Message-----
>From: connuser1 connuser1 [mailto:connuser1@gmail.com]
>Sent: Thursday, January 29, 2015 2:42 PM
>To: users@sling.apache.org
>Subject: Re: Implementing ModifyingResourceProvider
>
>More specifically, how can I keep track of the update which is handled
>via ModifiableValueMap ? Quoting from the ModifiableValueMap documentation
>[1], "*Once ResourceResolver.commit() is called, the changes are finally
>persisted.*"
>
>Basically I am not sure, how and where can the changes
>in ModifiableValueMap be translated to the changes to be done on the
>dynamodb backend.
>
>[1] -
>http://docs.adobe.com/docs/en/cq/current/javadoc/org/apache/sling/api/resource
>/ModifiableValueMap.html
>
>On Thu, Jan 29, 2015 at 6:45 PM, connuser1 connuser1 <co...@gmail.com>
>wrote:
>
>> Hi
>>
>> I am implementing the ModifyingResourceProvider intergace for the dynamodb
>> resource provider [0] in order to be able to create/edit/delete resources.
>>
>> I needed some guidance on implementing the revert/commit/hasChanges
>> methods. I had a look at JCRResourceProvider and it does that through the
>> JCR Session.  What is the recommended way of keeping track of the transient
>> changes in custom resource providers like his one?
>>
>> Thanks
>>
>> [0] - https://github.com/sdmcraft/SlingDynamo
>>

Re: Implementing ModifyingResourceProvider

Posted by connuser1 connuser1 <co...@gmail.com>.
More specifically, how can I keep track of the update which is handled
via ModifiableValueMap ? Quoting from the ModifiableValueMap documentation
[1], "*Once ResourceResolver.commit() is called, the changes are finally
persisted.*"

Basically I am not sure, how and where can the changes
in ModifiableValueMap be translated to the changes to be done on the
dynamodb backend.

[1] -
http://docs.adobe.com/docs/en/cq/current/javadoc/org/apache/sling/api/resource/ModifiableValueMap.html

On Thu, Jan 29, 2015 at 6:45 PM, connuser1 connuser1 <co...@gmail.com>
wrote:

> Hi
>
> I am implementing the ModifyingResourceProvider intergace for the dynamodb
> resource provider [0] in order to be able to create/edit/delete resources.
>
> I needed some guidance on implementing the revert/commit/hasChanges
> methods. I had a look at JCRResourceProvider and it does that through the
> JCR Session.  What is the recommended way of keeping track of the transient
> changes in custom resource providers like his one?
>
> Thanks
>
> [0] - https://github.com/sdmcraft/SlingDynamo
>