You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/11/07 01:55:32 UTC

[jira] Created: (SLING-1172) Allow uploading JSON files to create content structures

Allow uploading JSON files to create content structures
-------------------------------------------------------

                 Key: SLING-1172
                 URL: https://issues.apache.org/jira/browse/SLING-1172
             Project: Sling
          Issue Type: New Feature
          Components: Servlets
    Affects Versions: Servlets Get 2.0.6
            Reporter: Felix Meschberger
             Fix For: Servlets Get 2.0.8


Currently uploading a JSON file will just create the file node.

On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.

This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Justin Edelson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Edelson closed SLING-1172.
---------------------------------


> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.1.0
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman reopened SLING-1172:
--------------------------------


Re-opening to reconsider the import case where no name is provided as discussed @ http://markmail.org/message/22qobb2e7y5yuu67

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman resolved SLING-1172.
--------------------------------

    Resolution: Fixed

Fixed the import case where no name parameter is supplied.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Resolved: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Eric Norman <er...@gmail.com>.
Hi Simon,

Yes, I suppose that should work.  I'll take another look at it.

Regards,
-Eric


On Wed, Jun 30, 2010 at 8:58 AM, Simon Gaeremynck <ga...@gmail.com>wrote:

> Is there a way to create a tree of nodes without having the generated name
> bit in there?
> ie:
> I want to create the tree
> {
>   "foo" :{
>     "boolVal" : true
>     "intVal" : 23
>   }
> }
>
> at /testarea so I end up with the following node structure:
>
> /testarea/foo
> /testarea/foo/boolVal = true
> /testarea/foo/intVal = 23
>
>
> Otherwise the import operation looks like a very cool thing to use!
>
> Regards,
>
> Simon
>
>
>
> On 27 Jun 2010, at 20:39, Eric Norman (JIRA) wrote:
>
> >
> >     [
> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
> >
> > Eric Norman resolved SLING-1172.
> > --------------------------------
> >
> >    Fix Version/s: JCR ContentLoader 2.0.8
> >       Resolution: Fixed
> >
> > Code committed in r958411.  Please review to verify it works as you would
> expect.
> >
> >
> >
> >> Allow uploading JSON files to create content structures
> >> -------------------------------------------------------
> >>
> >>                Key: SLING-1172
> >>                URL: https://issues.apache.org/jira/browse/SLING-1172
> >>            Project: Sling
> >>         Issue Type: New Feature
> >>         Components: Servlets
> >>   Affects Versions: Servlets Post 2.0.4
> >>           Reporter: Felix Meschberger
> >>           Assignee: Eric Norman
> >>            Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
> >>
> >>
> >> Currently uploading a JSON file will just create the file node.
> >> On the other hand it would be useful if uploading to a node with a
> request extension of JSON, the JSON would be unpacked and handled as if it
> would be a modification request with the JSON data being the content to
> store.
> >> This would be similar to JSON upload supported by CouchDB.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> >
>
>

Re: [jira] Resolved: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Simon Gaeremynck <ga...@gmail.com>.
Is there a way to create a tree of nodes without having the generated name bit in there?
ie: 
I want to create the tree
{
   "foo" :{
     "boolVal" : true
     "intVal" : 23
   }
}

at /testarea so I end up with the following node structure:

/testarea/foo
/testarea/foo/boolVal = true
/testarea/foo/intVal = 23


Otherwise the import operation looks like a very cool thing to use!

Regards,

Simon



On 27 Jun 2010, at 20:39, Eric Norman (JIRA) wrote:

> 
>     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Eric Norman resolved SLING-1172.
> --------------------------------
> 
>    Fix Version/s: JCR ContentLoader 2.0.8
>       Resolution: Fixed
> 
> Code committed in r958411.  Please review to verify it works as you would expect.
> 
> 
> 
>> Allow uploading JSON files to create content structures
>> -------------------------------------------------------
>> 
>>                Key: SLING-1172
>>                URL: https://issues.apache.org/jira/browse/SLING-1172
>>            Project: Sling
>>         Issue Type: New Feature
>>         Components: Servlets
>>   Affects Versions: Servlets Post 2.0.4
>>           Reporter: Felix Meschberger
>>           Assignee: Eric Norman
>>            Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>> 
>> 
>> Currently uploading a JSON file will just create the file node.
>> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
>> This would be similar to JSON upload supported by CouchDB.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 


[jira] Resolved: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman resolved SLING-1172.
--------------------------------

    Fix Version/s: JCR ContentLoader 2.0.8
       Resolution: Fixed

Code committed in r958411.  Please review to verify it works as you would expect.



> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884855#action_12884855 ] 

Eric Norman commented on SLING-1172:
------------------------------------

fixed in r960134

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Mike Moulton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880447#action_12880447 ] 

Mike Moulton commented on SLING-1172:
-------------------------------------

What's the possibility to get this into Sling 6? I have run into the need for this several times on a current project.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Simon Gaeremynck <ga...@gmail.com>.
No, it wouldn't delete them.

Whenever possible it tries to get the node. If the parent node doesn't have the requested name it will add it.
Properties will be overwritten..
Example at [1] which I hope clarifies it a bit.

I haven't looked at the ContentLoader yet, but I agree it would make sense to re-use it.

Simon

[1]
ex:
Existing node structure
/some/path/node
       + "my:title" : "random"
/some/path/node/child1
       + "my:title" : "random"
       + "my:foo" : "bar"


Posted JSON to /some/path/node
{
  "my:title" : "parent",
  "child1" : {
     "my:title" : "Child 1",
     "my:description" : "Description of child 1"
  },
  "child2" : {
    "my:title" : "Child 2",
     "my:description" : "Description of child 2"
  }
}


Would result in:
/some/path/node
       + "my:title" : "random"
/some/path/node/child1
       + "my:title" : "Child 1"
       + "my:description" : "Description of child 1"
       + "my:foo" : "bar" 
/some/path/node/child2
       + "my:title" : "Child 2"
       + "my:description" : "Description of child 2"


On 10 Feb 2010, at 00:03, Justin Edelson wrote:

> Ian-
> How do you currently deal with partial node updates? For example, if you had
> /some/path/node
> /some/path/node/child1
> /some/path/node/child2
> 
> and submitted to /some/path/node:
> 
> {
> 'jcr:title': 'some title',
> 'jcr:description': 'some description'
> }
> 
> Would child1 and child2 be deleted?
> 
> Justin
> 
> On Tue, Feb 9, 2010 at 6:46 PM, Ian Boston <ie...@tfd.co.uk> wrote:
> 
>> 
>> Simon who works with me wrote this, but it takes a post of json in the
>> parameter tree as a modification to a sub tree.
>> 
>> Our ui developers love it. They can convert many post operations into one
>> post.
>> 
>> If of use, I'll ask Simon to submit as a patch on the jira.
>> Ian
>> 
>> 
>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>> 
>> Sent from my iPhone
>> 
>> 
>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>> 
>> I am currently working on a project where we might use Sling. In order to
>>> evaluate this I created my own Sling servlet in order to take JSon and
>>> create / merge (hibernate lingo) data.
>>> 
>>> Therefore I would love to have a way to upload JSon and would be willing
>>> to lend a hand getting this off the ground.
>>> 
>>> Cheers - Andy
>>> 
>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>> 
>>> We have implented something like this already, happy to share if of
>>>> interest.
>>>> 
>>>> Ian
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>> wrote:
>>>> 
>>>> 
>>>>> [
>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583
>>>>> ]
>>>>> 
>>>>> Felix Meschberger commented on SLING-1172:
>>>>> ------------------------------------------
>>>>> 
>>>>> Sounds like a good idea.
>>>>> 
>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>> 
>>>>> As for XML, things are probably different, because we have our own XML
>>>>> format for the loader, which is neither JCR document view nor JCR system
>>>>> view.
>>>>> 
>>>>> Allow uploading JSON files to create content structures
>>>>>> -------------------------------------------------------
>>>>>> 
>>>>>>            Key: SLING-1172
>>>>>>            URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>        Project: Sling
>>>>>>     Issue Type: New Feature
>>>>>>     Components: Servlets
>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>       Reporter: Felix Meschberger
>>>>>>        Fix For: Servlets Post 2.0.6
>>>>>> 
>>>>>> 
>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>> request extension of JSON, the JSON would be unpacked and handled as if it
>>>>>> would be a modification request with the JSON data being the content to
>>>>>> store.
>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>> 
>>>>> 
>>>>> --
>>>>> This message is automatically generated by JIRA.
>>>>> -
>>>>> You can reply to this email to add a comment to the issue online.
>>>>> 
>>>>> 
>>> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Justin Edelson <ju...@gmail.com>.
Ian-
How do you currently deal with partial node updates? For example, if you had
/some/path/node
/some/path/node/child1
/some/path/node/child2

and submitted to /some/path/node:

{
 'jcr:title': 'some title',
 'jcr:description': 'some description'
}

Would child1 and child2 be deleted?

Justin

On Tue, Feb 9, 2010 at 6:46 PM, Ian Boston <ie...@tfd.co.uk> wrote:

>
> Simon who works with me wrote this, but it takes a post of json in the
> parameter tree as a modification to a sub tree.
>
> Our ui developers love it. They can convert many post operations into one
> post.
>
> If of use, I'll ask Simon to submit as a patch on the jira.
> Ian
>
>
> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>
> Sent from my iPhone
>
>
> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>
>  I am currently working on a project where we might use Sling. In order to
>> evaluate this I created my own Sling servlet in order to take JSon and
>> create / merge (hibernate lingo) data.
>>
>> Therefore I would love to have a way to upload JSon and would be willing
>> to lend a hand getting this off the ground.
>>
>> Cheers - Andy
>>
>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>
>>  We have implented something like this already, happy to share if of
>>> interest.
>>>
>>> Ian
>>>
>>> Sent from my iPhone
>>>
>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>> wrote:
>>>
>>>
>>>>  [
>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583
>>>>  ]
>>>>
>>>> Felix Meschberger commented on SLING-1172:
>>>> ------------------------------------------
>>>>
>>>> Sounds like a good idea.
>>>>
>>>> For JSON I am pretty sure round-tripping works alright.
>>>>
>>>> As for XML, things are probably different, because we have our own XML
>>>> format for the loader, which is neither JCR document view nor JCR system
>>>> view.
>>>>
>>>>  Allow uploading JSON files to create content structures
>>>>> -------------------------------------------------------
>>>>>
>>>>>             Key: SLING-1172
>>>>>             URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>         Project: Sling
>>>>>      Issue Type: New Feature
>>>>>      Components: Servlets
>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>        Reporter: Felix Meschberger
>>>>>         Fix For: Servlets Post 2.0.6
>>>>>
>>>>>
>>>>> Currently uploading a JSON file will just create the file node.
>>>>> On the other hand it would be useful if uploading to a node with a
>>>>> request extension of JSON, the JSON would be unpacked and handled as if it
>>>>> would be a modification request with the JSON data being the content to
>>>>> store.
>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>
>>>>
>>>> --
>>>> This message is automatically generated by JIRA.
>>>> -
>>>> You can reply to this email to add a comment to the issue online.
>>>>
>>>>
>>

Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Alexander Klimetschek <ak...@day.com>.
On Wed, Feb 10, 2010 at 15:46, Felix Meschberger <fm...@gmail.com> wrote:
> ... POST ....
>
>   operation=json
>   :json=...json-data...

What about supporting POST/PUT with json as the body? (and
Content-Type: application/json)

Much simpler. And should work with XHR from the browser, AFAIK.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Simon Gaeremynck <ga...@gmail.com>.
Hi,

Having it as an operation gives us the power to create nodes on paths that don't exist yet.

1) This is not so easy. 
If you would post a node with jcr:resourceType = nt:file you would also have to 
specify an nt:resource childnode that contains the data, date, mimetype, ... that should be set.
I guess this could be done by passing a string to jcr:data...
But it would get convoluted pretty fast (imho)
2) AFAICT mixins should be possible.
3) This could be done by providing an extra parameter? So the resource where you are posting to would
get versioned. 

WDYT ?

Simon

On 10 Feb 2010, at 23:20, Andreas Schaefer wrote:

> From my limited understanding it should also be possible when CREATING nodes to support these:
> 
> 1) set the primary node type when creating a node
> 2) add mixins (or would that be expected to be done through the node type definitions ?)
> 3) support versionable (checking out / in a versioned node while making changes to it including children)
> 
> Cheers - Andy
> 
> On Feb 10, 2010, at 7:05 AM, Simon Gaeremynck wrote:
> 
>> Hi,
>> 
>> I just tried a GET, feed it to the operation and it works pretty well.
>> However, as it is now it will ignore all properties which names start with 'jcr:'.
>> It's probably better to take the same approach as in the JsonReader and have a set
>> of ignored names instead of ignoring everything. (uuid, primaryType, created, ...)
>> 
>> For the naming part:
>> We could also do something like this
>> :operation=tree
>> and then depending wether you're sending XML, json, ..
>> :json=..
>> or
>> :xml=..
>> 
>> This way we can keep it all in 1 operation. 
>> 
>> For the above 2 reasons, re-using the code from contentloader would be a big bonus (imho).
>> 
>> Simon
>> 
>> On 10 Feb 2010, at 14:46, Felix Meschberger wrote:
>> 
>>> Hi,
>>> 
>>> On 10.02.2010 15:36, Simon Gaeremynck wrote:
>>>> I'm not really sure what you mean by roundtripping to the JsonGetServlet?
>>> 
>>> By round tripping I mean that I can feed the result of a GET to
>>> /some/node.json to the :tree operation and (given a clean state) get the
>>> same content structure.
>>> 
>>> And vice versa: POST:tree to /some/node.json and then GET
>>> /some/node.json returns an equivalent JSON.
>>> 
>>> 
>>>> 
>>>> Initial patch at [1].
>>> 
>>> Patch looks good, with one remark: Since this is json only (right now)
>>> how about using that as the name:
>>> 
>>> operation=json
>>> :json=...json-data...
>>> 
>>> WDYT ?
>>> 
>>> Regards
>>> Felix
>>> 
>>>> 
>>>> Basicly what this does is:
>>>> - A SlingPostOperation with the operation :tree.
>>>> - Grab a string from the request parameter ':tree'
>>>> - Try to convert it to a JSONObject
>>>> - Walk over the JSONObject and create the nodes/properties in JCR as it goes along.
>>>> - Save the session.
>>>> 
>>>> 
>>>> This doesn't use the ContentLoader service (yet) because AFAICT that is all internal and 
>>>> seems to be aimed primarily for loading bundle resources. (Haven't had a close look though)
>>>> However, it would be good if this operation would use the JsonReader provided by the contentloader
>>>> as that would remove code duplication and the JsonReader already has proper test coverage.
>>>> 
>>>> Simon
>>>> 
>>>> [1] http://codereview.appspot.com/207057/show
>>>> 
>>>> 
>>>> On 10 Feb 2010, at 11:54, Felix Meschberger wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> Sounds great and the class looks good. I assume this provides
>>>>> round-tripping to the JsonGetServlet.
>>>>> 
>>>>> So, if Simon would be contributing this, it would be nice.
>>>>> 
>>>>> Regards
>>>>> Felix
>>>>> 
>>>>> On 10.02.2010 00:46, Ian Boston wrote:
>>>>>> 
>>>>>> Simon who works with me wrote this, but it takes a post of json in the
>>>>>> parameter tree as a modification to a sub tree.
>>>>>> 
>>>>>> Our ui developers love it. They can convert many post operations into
>>>>>> one post.
>>>>>> 
>>>>>> If of use, I'll ask Simon to submit as a patch on the jira.
>>>>>> Ian
>>>>>> 
>>>>>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>>>>>> 
>>>>>> 
>>>>>> Sent from my iPhone
>>>>>> 
>>>>>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>>>>>> 
>>>>>>> I am currently working on a project where we might use Sling. In order
>>>>>>> to evaluate this I created my own Sling servlet in order to take JSon
>>>>>>> and create / merge (hibernate lingo) data.
>>>>>>> 
>>>>>>> Therefore I would love to have a way to upload JSon and would be
>>>>>>> willing to lend a hand getting this off the ground.
>>>>>>> 
>>>>>>> Cheers - Andy
>>>>>>> 
>>>>>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>>>>>> 
>>>>>>>> We have implented something like this already, happy to share if of
>>>>>>>> interest.
>>>>>>>> 
>>>>>>>> Ian
>>>>>>>> 
>>>>>>>> Sent from my iPhone
>>>>>>>> 
>>>>>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>>>>>> wrote:
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> [
>>>>>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Felix Meschberger commented on SLING-1172:
>>>>>>>>> ------------------------------------------
>>>>>>>>> 
>>>>>>>>> Sounds like a good idea.
>>>>>>>>> 
>>>>>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>>>>>> 
>>>>>>>>> As for XML, things are probably different, because we have our own
>>>>>>>>> XML format for the loader, which is neither JCR document view nor
>>>>>>>>> JCR system view.
>>>>>>>>> 
>>>>>>>>>> Allow uploading JSON files to create content structures
>>>>>>>>>> -------------------------------------------------------
>>>>>>>>>> 
>>>>>>>>>>          Key: SLING-1172
>>>>>>>>>>          URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>>>>>      Project: Sling
>>>>>>>>>>   Issue Type: New Feature
>>>>>>>>>>   Components: Servlets
>>>>>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>>>>>     Reporter: Felix Meschberger
>>>>>>>>>>      Fix For: Servlets Post 2.0.6
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>>>>>>> as if it would be a modification request with the JSON data being
>>>>>>>>>> the content to store.
>>>>>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>>>>> 
>>>>>>>>> -- 
>>>>>>>>> This message is automatically generated by JIRA.
>>>>>>>>> -
>>>>>>>>> You can reply to this email to add a comment to the issue online.
>>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Andreas Schaefer <sc...@me.com>.
>From my limited understanding it should also be possible when CREATING nodes to support these:

1) set the primary node type when creating a node
2) add mixins (or would that be expected to be done through the node type definitions ?)
3) support versionable (checking out / in a versioned node while making changes to it including children)

Cheers - Andy

On Feb 10, 2010, at 7:05 AM, Simon Gaeremynck wrote:

> Hi,
> 
> I just tried a GET, feed it to the operation and it works pretty well.
> However, as it is now it will ignore all properties which names start with 'jcr:'.
> It's probably better to take the same approach as in the JsonReader and have a set
> of ignored names instead of ignoring everything. (uuid, primaryType, created, ...)
> 
> For the naming part:
> We could also do something like this
> :operation=tree
> and then depending wether you're sending XML, json, ..
> :json=..
> or
> :xml=..
> 
> This way we can keep it all in 1 operation. 
> 
> For the above 2 reasons, re-using the code from contentloader would be a big bonus (imho).
> 
> Simon
> 
> On 10 Feb 2010, at 14:46, Felix Meschberger wrote:
> 
>> Hi,
>> 
>> On 10.02.2010 15:36, Simon Gaeremynck wrote:
>>> I'm not really sure what you mean by roundtripping to the JsonGetServlet?
>> 
>> By round tripping I mean that I can feed the result of a GET to
>> /some/node.json to the :tree operation and (given a clean state) get the
>> same content structure.
>> 
>> And vice versa: POST:tree to /some/node.json and then GET
>> /some/node.json returns an equivalent JSON.
>> 
>> 
>>> 
>>> Initial patch at [1].
>> 
>> Patch looks good, with one remark: Since this is json only (right now)
>> how about using that as the name:
>> 
>>  operation=json
>>  :json=...json-data...
>> 
>> WDYT ?
>> 
>> Regards
>> Felix
>> 
>>> 
>>> Basicly what this does is:
>>> - A SlingPostOperation with the operation :tree.
>>> - Grab a string from the request parameter ':tree'
>>> - Try to convert it to a JSONObject
>>> - Walk over the JSONObject and create the nodes/properties in JCR as it goes along.
>>> - Save the session.
>>> 
>>> 
>>> This doesn't use the ContentLoader service (yet) because AFAICT that is all internal and 
>>> seems to be aimed primarily for loading bundle resources. (Haven't had a close look though)
>>> However, it would be good if this operation would use the JsonReader provided by the contentloader
>>> as that would remove code duplication and the JsonReader already has proper test coverage.
>>> 
>>> Simon
>>> 
>>> [1] http://codereview.appspot.com/207057/show
>>> 
>>> 
>>> On 10 Feb 2010, at 11:54, Felix Meschberger wrote:
>>> 
>>>> Hi,
>>>> 
>>>> Sounds great and the class looks good. I assume this provides
>>>> round-tripping to the JsonGetServlet.
>>>> 
>>>> So, if Simon would be contributing this, it would be nice.
>>>> 
>>>> Regards
>>>> Felix
>>>> 
>>>> On 10.02.2010 00:46, Ian Boston wrote:
>>>>> 
>>>>> Simon who works with me wrote this, but it takes a post of json in the
>>>>> parameter tree as a modification to a sub tree.
>>>>> 
>>>>> Our ui developers love it. They can convert many post operations into
>>>>> one post.
>>>>> 
>>>>> If of use, I'll ask Simon to submit as a patch on the jira.
>>>>> Ian
>>>>> 
>>>>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>>>>> 
>>>>> 
>>>>> Sent from my iPhone
>>>>> 
>>>>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>>>>> 
>>>>>> I am currently working on a project where we might use Sling. In order
>>>>>> to evaluate this I created my own Sling servlet in order to take JSon
>>>>>> and create / merge (hibernate lingo) data.
>>>>>> 
>>>>>> Therefore I would love to have a way to upload JSon and would be
>>>>>> willing to lend a hand getting this off the ground.
>>>>>> 
>>>>>> Cheers - Andy
>>>>>> 
>>>>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>>>>> 
>>>>>>> We have implented something like this already, happy to share if of
>>>>>>> interest.
>>>>>>> 
>>>>>>> Ian
>>>>>>> 
>>>>>>> Sent from my iPhone
>>>>>>> 
>>>>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> 
>>>>>>>> [
>>>>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Felix Meschberger commented on SLING-1172:
>>>>>>>> ------------------------------------------
>>>>>>>> 
>>>>>>>> Sounds like a good idea.
>>>>>>>> 
>>>>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>>>>> 
>>>>>>>> As for XML, things are probably different, because we have our own
>>>>>>>> XML format for the loader, which is neither JCR document view nor
>>>>>>>> JCR system view.
>>>>>>>> 
>>>>>>>>> Allow uploading JSON files to create content structures
>>>>>>>>> -------------------------------------------------------
>>>>>>>>> 
>>>>>>>>>           Key: SLING-1172
>>>>>>>>>           URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>>>>       Project: Sling
>>>>>>>>>    Issue Type: New Feature
>>>>>>>>>    Components: Servlets
>>>>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>>>>      Reporter: Felix Meschberger
>>>>>>>>>       Fix For: Servlets Post 2.0.6
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>>>>>> as if it would be a modification request with the JSON data being
>>>>>>>>> the content to store.
>>>>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> This message is automatically generated by JIRA.
>>>>>>>> -
>>>>>>>> You can reply to this email to add a comment to the issue online.
>>>>>>>> 
>>>>>> 
>>>>> 
>>> 
>>> 
> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Simon Gaeremynck <ga...@gmail.com>.
Hi,

I just tried a GET, feed it to the operation and it works pretty well.
However, as it is now it will ignore all properties which names start with 'jcr:'.
It's probably better to take the same approach as in the JsonReader and have a set
of ignored names instead of ignoring everything. (uuid, primaryType, created, ...)

For the naming part:
We could also do something like this
:operation=tree
and then depending wether you're sending XML, json, ..
:json=..
or
:xml=..

This way we can keep it all in 1 operation. 

For the above 2 reasons, re-using the code from contentloader would be a big bonus (imho).

Simon

On 10 Feb 2010, at 14:46, Felix Meschberger wrote:

> Hi,
> 
> On 10.02.2010 15:36, Simon Gaeremynck wrote:
>> I'm not really sure what you mean by roundtripping to the JsonGetServlet?
> 
> By round tripping I mean that I can feed the result of a GET to
> /some/node.json to the :tree operation and (given a clean state) get the
> same content structure.
> 
> And vice versa: POST:tree to /some/node.json and then GET
> /some/node.json returns an equivalent JSON.
> 
> 
>> 
>> Initial patch at [1].
> 
> Patch looks good, with one remark: Since this is json only (right now)
> how about using that as the name:
> 
>   operation=json
>   :json=...json-data...
> 
> WDYT ?
> 
> Regards
> Felix
> 
>> 
>> Basicly what this does is:
>> - A SlingPostOperation with the operation :tree.
>> - Grab a string from the request parameter ':tree'
>> - Try to convert it to a JSONObject
>> - Walk over the JSONObject and create the nodes/properties in JCR as it goes along.
>> - Save the session.
>> 
>> 
>> This doesn't use the ContentLoader service (yet) because AFAICT that is all internal and 
>> seems to be aimed primarily for loading bundle resources. (Haven't had a close look though)
>> However, it would be good if this operation would use the JsonReader provided by the contentloader
>> as that would remove code duplication and the JsonReader already has proper test coverage.
>> 
>> Simon
>> 
>> [1] http://codereview.appspot.com/207057/show
>> 
>> 
>> On 10 Feb 2010, at 11:54, Felix Meschberger wrote:
>> 
>>> Hi,
>>> 
>>> Sounds great and the class looks good. I assume this provides
>>> round-tripping to the JsonGetServlet.
>>> 
>>> So, if Simon would be contributing this, it would be nice.
>>> 
>>> Regards
>>> Felix
>>> 
>>> On 10.02.2010 00:46, Ian Boston wrote:
>>>> 
>>>> Simon who works with me wrote this, but it takes a post of json in the
>>>> parameter tree as a modification to a sub tree.
>>>> 
>>>> Our ui developers love it. They can convert many post operations into
>>>> one post.
>>>> 
>>>> If of use, I'll ask Simon to submit as a patch on the jira.
>>>> Ian
>>>> 
>>>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>>>> 
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>>>> 
>>>>> I am currently working on a project where we might use Sling. In order
>>>>> to evaluate this I created my own Sling servlet in order to take JSon
>>>>> and create / merge (hibernate lingo) data.
>>>>> 
>>>>> Therefore I would love to have a way to upload JSon and would be
>>>>> willing to lend a hand getting this off the ground.
>>>>> 
>>>>> Cheers - Andy
>>>>> 
>>>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>>>> 
>>>>>> We have implented something like this already, happy to share if of
>>>>>> interest.
>>>>>> 
>>>>>> Ian
>>>>>> 
>>>>>> Sent from my iPhone
>>>>>> 
>>>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>>>> wrote:
>>>>>> 
>>>>>>> 
>>>>>>> [
>>>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>>>> 
>>>>>>> 
>>>>>>> Felix Meschberger commented on SLING-1172:
>>>>>>> ------------------------------------------
>>>>>>> 
>>>>>>> Sounds like a good idea.
>>>>>>> 
>>>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>>>> 
>>>>>>> As for XML, things are probably different, because we have our own
>>>>>>> XML format for the loader, which is neither JCR document view nor
>>>>>>> JCR system view.
>>>>>>> 
>>>>>>>> Allow uploading JSON files to create content structures
>>>>>>>> -------------------------------------------------------
>>>>>>>> 
>>>>>>>>            Key: SLING-1172
>>>>>>>>            URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>>>        Project: Sling
>>>>>>>>     Issue Type: New Feature
>>>>>>>>     Components: Servlets
>>>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>>>       Reporter: Felix Meschberger
>>>>>>>>        Fix For: Servlets Post 2.0.6
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>>>>> as if it would be a modification request with the JSON data being
>>>>>>>> the content to store.
>>>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>>> 
>>>>>>> -- 
>>>>>>> This message is automatically generated by JIRA.
>>>>>>> -
>>>>>>> You can reply to this email to add a comment to the issue online.
>>>>>>> 
>>>>> 
>>>> 
>> 
>> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 10.02.2010 15:36, Simon Gaeremynck wrote:
> I'm not really sure what you mean by roundtripping to the JsonGetServlet?

By round tripping I mean that I can feed the result of a GET to
/some/node.json to the :tree operation and (given a clean state) get the
same content structure.

And vice versa: POST:tree to /some/node.json and then GET
/some/node.json returns an equivalent JSON.


> 
> Initial patch at [1].

Patch looks good, with one remark: Since this is json only (right now)
how about using that as the name:

   operation=json
   :json=...json-data...

WDYT ?

Regards
Felix

> 
> Basicly what this does is:
> - A SlingPostOperation with the operation :tree.
> - Grab a string from the request parameter ':tree'
> - Try to convert it to a JSONObject
> - Walk over the JSONObject and create the nodes/properties in JCR as it goes along.
> - Save the session.
> 
> 
> This doesn't use the ContentLoader service (yet) because AFAICT that is all internal and 
> seems to be aimed primarily for loading bundle resources. (Haven't had a close look though)
> However, it would be good if this operation would use the JsonReader provided by the contentloader
> as that would remove code duplication and the JsonReader already has proper test coverage.
> 
> Simon
> 
> [1] http://codereview.appspot.com/207057/show
> 
> 
> On 10 Feb 2010, at 11:54, Felix Meschberger wrote:
> 
>> Hi,
>>
>> Sounds great and the class looks good. I assume this provides
>> round-tripping to the JsonGetServlet.
>>
>> So, if Simon would be contributing this, it would be nice.
>>
>> Regards
>> Felix
>>
>> On 10.02.2010 00:46, Ian Boston wrote:
>>>
>>> Simon who works with me wrote this, but it takes a post of json in the
>>> parameter tree as a modification to a sub tree.
>>>
>>> Our ui developers love it. They can convert many post operations into
>>> one post.
>>>
>>> If of use, I'll ask Simon to submit as a patch on the jira.
>>> Ian
>>>
>>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>>>
>>>
>>> Sent from my iPhone
>>>
>>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>>>
>>>> I am currently working on a project where we might use Sling. In order
>>>> to evaluate this I created my own Sling servlet in order to take JSon
>>>> and create / merge (hibernate lingo) data.
>>>>
>>>> Therefore I would love to have a way to upload JSon and would be
>>>> willing to lend a hand getting this off the ground.
>>>>
>>>> Cheers - Andy
>>>>
>>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>>>
>>>>> We have implented something like this already, happy to share if of
>>>>> interest.
>>>>>
>>>>> Ian
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> [
>>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>>>
>>>>>>
>>>>>> Felix Meschberger commented on SLING-1172:
>>>>>> ------------------------------------------
>>>>>>
>>>>>> Sounds like a good idea.
>>>>>>
>>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>>>
>>>>>> As for XML, things are probably different, because we have our own
>>>>>> XML format for the loader, which is neither JCR document view nor
>>>>>> JCR system view.
>>>>>>
>>>>>>> Allow uploading JSON files to create content structures
>>>>>>> -------------------------------------------------------
>>>>>>>
>>>>>>>             Key: SLING-1172
>>>>>>>             URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>>         Project: Sling
>>>>>>>      Issue Type: New Feature
>>>>>>>      Components: Servlets
>>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>>        Reporter: Felix Meschberger
>>>>>>>         Fix For: Servlets Post 2.0.6
>>>>>>>
>>>>>>>
>>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>>>> as if it would be a modification request with the JSON data being
>>>>>>> the content to store.
>>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>>>
>>>>>> -- 
>>>>>> This message is automatically generated by JIRA.
>>>>>> -
>>>>>> You can reply to this email to add a comment to the issue online.
>>>>>>
>>>>
>>>
> 
> 

Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Simon Gaeremynck <ga...@gmail.com>.
I'm not really sure what you mean by roundtripping to the JsonGetServlet?

Initial patch at [1].

Basicly what this does is:
- A SlingPostOperation with the operation :tree.
- Grab a string from the request parameter ':tree'
- Try to convert it to a JSONObject
- Walk over the JSONObject and create the nodes/properties in JCR as it goes along.
- Save the session.


This doesn't use the ContentLoader service (yet) because AFAICT that is all internal and 
seems to be aimed primarily for loading bundle resources. (Haven't had a close look though)
However, it would be good if this operation would use the JsonReader provided by the contentloader
as that would remove code duplication and the JsonReader already has proper test coverage.

Simon

[1] http://codereview.appspot.com/207057/show


On 10 Feb 2010, at 11:54, Felix Meschberger wrote:

> Hi,
> 
> Sounds great and the class looks good. I assume this provides
> round-tripping to the JsonGetServlet.
> 
> So, if Simon would be contributing this, it would be nice.
> 
> Regards
> Felix
> 
> On 10.02.2010 00:46, Ian Boston wrote:
>> 
>> Simon who works with me wrote this, but it takes a post of json in the
>> parameter tree as a modification to a sub tree.
>> 
>> Our ui developers love it. They can convert many post operations into
>> one post.
>> 
>> If of use, I'll ask Simon to submit as a patch on the jira.
>> Ian
>> 
>> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
>> 
>> 
>> Sent from my iPhone
>> 
>> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
>> 
>>> I am currently working on a project where we might use Sling. In order
>>> to evaluate this I created my own Sling servlet in order to take JSon
>>> and create / merge (hibernate lingo) data.
>>> 
>>> Therefore I would love to have a way to upload JSon and would be
>>> willing to lend a hand getting this off the ground.
>>> 
>>> Cheers - Andy
>>> 
>>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>> 
>>>> We have implented something like this already, happy to share if of
>>>> interest.
>>>> 
>>>> Ian
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>>> wrote:
>>>> 
>>>>> 
>>>>> [
>>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>> 
>>>>> 
>>>>> Felix Meschberger commented on SLING-1172:
>>>>> ------------------------------------------
>>>>> 
>>>>> Sounds like a good idea.
>>>>> 
>>>>> For JSON I am pretty sure round-tripping works alright.
>>>>> 
>>>>> As for XML, things are probably different, because we have our own
>>>>> XML format for the loader, which is neither JCR document view nor
>>>>> JCR system view.
>>>>> 
>>>>>> Allow uploading JSON files to create content structures
>>>>>> -------------------------------------------------------
>>>>>> 
>>>>>>             Key: SLING-1172
>>>>>>             URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>>         Project: Sling
>>>>>>      Issue Type: New Feature
>>>>>>      Components: Servlets
>>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>>        Reporter: Felix Meschberger
>>>>>>         Fix For: Servlets Post 2.0.6
>>>>>> 
>>>>>> 
>>>>>> Currently uploading a JSON file will just create the file node.
>>>>>> On the other hand it would be useful if uploading to a node with a
>>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>>> as if it would be a modification request with the JSON data being
>>>>>> the content to store.
>>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>> 
>>>>> -- 
>>>>> This message is automatically generated by JIRA.
>>>>> -
>>>>> You can reply to this email to add a comment to the issue online.
>>>>> 
>>> 
>> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Sounds great and the class looks good. I assume this provides
round-tripping to the JsonGetServlet.

So, if Simon would be contributing this, it would be nice.

Regards
Felix

On 10.02.2010 00:46, Ian Boston wrote:
> 
> Simon who works with me wrote this, but it takes a post of json in the
> parameter tree as a modification to a sub tree.
> 
> Our ui developers love it. They can convert many post operations into
> one post.
> 
> If of use, I'll ask Simon to submit as a patch on the jira.
> Ian
> 
> http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java
> 
> 
> Sent from my iPhone
> 
> On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:
> 
>> I am currently working on a project where we might use Sling. In order
>> to evaluate this I created my own Sling servlet in order to take JSon
>> and create / merge (hibernate lingo) data.
>>
>> Therefore I would love to have a way to upload JSon and would be
>> willing to lend a hand getting this off the ground.
>>
>> Cheers - Andy
>>
>> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>>
>>> We have implented something like this already, happy to share if of
>>> interest.
>>>
>>> Ian
>>>
>>> Sent from my iPhone
>>>
>>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>
>>> wrote:
>>>
>>>>
>>>>  [
>>>> https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>>>>
>>>>
>>>> Felix Meschberger commented on SLING-1172:
>>>> ------------------------------------------
>>>>
>>>> Sounds like a good idea.
>>>>
>>>> For JSON I am pretty sure round-tripping works alright.
>>>>
>>>> As for XML, things are probably different, because we have our own
>>>> XML format for the loader, which is neither JCR document view nor
>>>> JCR system view.
>>>>
>>>>> Allow uploading JSON files to create content structures
>>>>> -------------------------------------------------------
>>>>>
>>>>>              Key: SLING-1172
>>>>>              URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>>          Project: Sling
>>>>>       Issue Type: New Feature
>>>>>       Components: Servlets
>>>>> Affects Versions: Servlets Post 2.0.4
>>>>>         Reporter: Felix Meschberger
>>>>>          Fix For: Servlets Post 2.0.6
>>>>>
>>>>>
>>>>> Currently uploading a JSON file will just create the file node.
>>>>> On the other hand it would be useful if uploading to a node with a
>>>>> request extension of JSON, the JSON would be unpacked and handled
>>>>> as if it would be a modification request with the JSON data being
>>>>> the content to store.
>>>>> This would be similar to JSON upload supported by CouchDB.
>>>>
>>>> -- 
>>>> This message is automatically generated by JIRA.
>>>> -
>>>> You can reply to this email to add a comment to the issue online.
>>>>
>>
> 

Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Ian Boston <ie...@tfd.co.uk>.
Simon who works with me wrote this, but it takes a post of json in the  
parameter tree as a modification to a sub tree.

Our ui developers love it. They can convert many post operations into  
one post.

If of use, I'll ask Simon to submit as a patch on the jira.
Ian

http://github.com/ieb/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/nakamura/batch/CreateTreeOperation.java

Sent from my iPhone

On 9 Feb 2010, at 23:28, Andreas Schaefer <sc...@me.com> wrote:

> I am currently working on a project where we might use Sling. In  
> order to evaluate this I created my own Sling servlet in order to  
> take JSon and create / merge (hibernate lingo) data.
>
> Therefore I would love to have a way to upload JSon and would be  
> willing to lend a hand getting this off the ground.
>
> Cheers - Andy
>
> On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:
>
>> We have implented something like this already, happy to share if of  
>> interest.
>>
>> Ian
>>
>> Sent from my iPhone
>>
>> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)"  
>> <ji...@apache.org> wrote:
>>
>>>
>>>  [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 
>>>  ]
>>>
>>> Felix Meschberger commented on SLING-1172:
>>> ------------------------------------------
>>>
>>> Sounds like a good idea.
>>>
>>> For JSON I am pretty sure round-tripping works alright.
>>>
>>> As for XML, things are probably different, because we have our own  
>>> XML format for the loader, which is neither JCR document view nor  
>>> JCR system view.
>>>
>>>> Allow uploading JSON files to create content structures
>>>> -------------------------------------------------------
>>>>
>>>>              Key: SLING-1172
>>>>              URL: https://issues.apache.org/jira/browse/SLING-1172
>>>>          Project: Sling
>>>>       Issue Type: New Feature
>>>>       Components: Servlets
>>>> Affects Versions: Servlets Post 2.0.4
>>>>         Reporter: Felix Meschberger
>>>>          Fix For: Servlets Post 2.0.6
>>>>
>>>>
>>>> Currently uploading a JSON file will just create the file node.
>>>> On the other hand it would be useful if uploading to a node with  
>>>> a request extension of JSON, the JSON would be unpacked and  
>>>> handled as if it would be a modification request with the JSON  
>>>> data being the content to store.
>>>> This would be similar to JSON upload supported by CouchDB.
>>>
>>> -- 
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>

Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Andreas Schaefer <sc...@me.com>.
I am currently working on a project where we might use Sling. In order to evaluate this I created my own Sling servlet in order to take JSon and create / merge (hibernate lingo) data.

Therefore I would love to have a way to upload JSon and would be willing to lend a hand getting this off the ground.

Cheers - Andy

On Feb 9, 2010, at 3:02 PM, Ian Boston wrote:

> We have implented something like this already, happy to share if of interest.
> 
> Ian
> 
> Sent from my iPhone
> 
> On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org> wrote:
> 
>> 
>>   [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ]
>> 
>> Felix Meschberger commented on SLING-1172:
>> ------------------------------------------
>> 
>> Sounds like a good idea.
>> 
>> For JSON I am pretty sure round-tripping works alright.
>> 
>> As for XML, things are probably different, because we have our own XML format for the loader, which is neither JCR document view nor JCR system view.
>> 
>>> Allow uploading JSON files to create content structures
>>> -------------------------------------------------------
>>> 
>>>               Key: SLING-1172
>>>               URL: https://issues.apache.org/jira/browse/SLING-1172
>>>           Project: Sling
>>>        Issue Type: New Feature
>>>        Components: Servlets
>>>  Affects Versions: Servlets Post 2.0.4
>>>          Reporter: Felix Meschberger
>>>           Fix For: Servlets Post 2.0.6
>>> 
>>> 
>>> Currently uploading a JSON file will just create the file node.
>>> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
>>> This would be similar to JSON upload supported by CouchDB.
>> 
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>> 


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Ian Boston <ie...@tfd.co.uk>.
We have implented something like this already, happy to share if of  
interest.

Ian

Sent from my iPhone

On 9 Feb 2010, at 18:45, "Felix Meschberger (JIRA)" <ji...@apache.org>  
wrote:

>
>    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 
>  ]
>
> Felix Meschberger commented on SLING-1172:
> ------------------------------------------
>
> Sounds like a good idea.
>
> For JSON I am pretty sure round-tripping works alright.
>
> As for XML, things are probably different, because we have our own  
> XML format for the loader, which is neither JCR document view nor  
> JCR system view.
>
>> Allow uploading JSON files to create content structures
>> -------------------------------------------------------
>>
>>                Key: SLING-1172
>>                URL: https://issues.apache.org/jira/browse/SLING-1172
>>            Project: Sling
>>         Issue Type: New Feature
>>         Components: Servlets
>>   Affects Versions: Servlets Post 2.0.4
>>           Reporter: Felix Meschberger
>>            Fix For: Servlets Post 2.0.6
>>
>>
>> Currently uploading a JSON file will just create the file node.
>> On the other hand it would be useful if uploading to a node with a  
>> request extension of JSON, the JSON would be unpacked and handled  
>> as if it would be a modification request with the JSON data being  
>> the content to store.
>> This would be similar to JSON upload supported by CouchDB.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>

[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831583#action_12831583 ] 

Felix Meschberger commented on SLING-1172:
------------------------------------------

Sounds like a good idea.

For JSON I am pretty sure round-tripping works alright.

As for XML, things are probably different, because we have our own XML format for the loader, which is neither JCR document view nor JCR system view.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Simon Gaeremynck (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805952#action_12805952 ] 

Simon Gaeremynck commented on SLING-1172:
-----------------------------------------

We had a similar use case.
We handled it by creating a SlingPostOperation, code at [1]

The user can do a POST request to the resource he wants to add/modify the tree.
This has the benefit that the base resource gets resolved.
The JSON is stored in a regular form parameter.

[1] http://github.com/simong/open-experiments/blob/master/slingtests/osgikernel/bundles/batch/src/main/java/org/sakaiproject/kernel/batch/CreateTreeOperation.java


> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12805946#action_12805946 ] 

Alexander Klimetschek commented on SLING-1172:
----------------------------------------------

I think it's actually about POSTing a JSON body in the request (and maybe via PUT), not necessarily a http form-based file upload of a json file. Therefore I'd suggest to rename this issue to "Allow JSON for requests to the SlingPostServlet".

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-1172:
-------------------------------------

    Affects Version/s:     (was: Servlets Get 2.0.6)
                       Servlets Post 2.0.4
        Fix Version/s:     (was: Servlets Get 2.0.8)
                       Servlets Post 2.0.6

This is for the POST servlet of course...

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Andy,

On 24.02.2010 23:35, Andreas Schaefer (JIRA) wrote:
> I started working on an implementation of an Operation to accomplish that based on the code from Simon. This version does not have much functionality beside being able to support JCR primary types. The code can be found here:
> 
> git@github.com:schaefa/SlingTreeSave.git
> 
> In the near future I want to add additional test cases (different JSon structures) and adjust the Operation to support them.

This looks fine. Do you mind attaching this as a patch to the Sling Post
Servlet bundle to this issue ?

This would be cool. Thanks.

Regards
Felix

> 
> -Andy
> 
>> Allow uploading JSON files to create content structures
>> -------------------------------------------------------
>>
>>                 Key: SLING-1172
>>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>>             Project: Sling
>>          Issue Type: New Feature
>>          Components: Servlets
>>    Affects Versions: Servlets Post 2.0.4
>>            Reporter: Felix Meschberger
>>             Fix For: Servlets Post 2.0.6
>>
>>
>> Currently uploading a JSON file will just create the file node.
>> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
>> This would be similar to JSON upload supported by CouchDB.
> 

[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Andreas Schaefer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838031#action_12838031 ] 

Andreas Schaefer commented on SLING-1172:
-----------------------------------------

I started working on an implementation of an Operation to accomplish that based on the code from Simon. This version does not have much functionality beside being able to support JCR primary types. The code can be found here:

git@github.com:schaefa/SlingTreeSave.git

In the near future I want to add additional test cases (different JSon structures) and adjust the Operation to support them.

-Andy

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12882986#action_12882986 ] 

Eric Norman commented on SLING-1172:
------------------------------------

I also updated the documentation of the sling.post bundle in the wiki.  Please review that as well.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6, JCR ContentLoader 2.0.8
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880724#action_12880724 ] 

Eric Norman commented on SLING-1172:
------------------------------------

Hi Mike,
I (locally) have a mostly working prototype of a new "import" POST operation that re-uses the content loader functionality to import JSON (or XML) content supplied by a request parameter (or file upload).  I just need to clean up the code a bit and make sure there is adequate test coverage and documentation before I check it in.  I will try to get that wrapped up this week.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Vidar S. Ramdal (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831504#action_12831504 ] 

Vidar S. Ramdal commented on SLING-1172:
----------------------------------------

The content loader already has this functionality, right? Maybe we could re-use the code from there. As a bonus we would also get support for uploading content structures as XML.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Eric Norman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Norman reassigned SLING-1172:
----------------------------------

    Assignee: Eric Norman

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-1172) Allow uploading JSON files to create content structures

Posted by "Mike Moulton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12881256#action_12881256 ] 

Mike Moulton commented on SLING-1172:
-------------------------------------

Thank you Eric, I look forward to the commit.

> Allow uploading JSON files to create content structures
> -------------------------------------------------------
>
>                 Key: SLING-1172
>                 URL: https://issues.apache.org/jira/browse/SLING-1172
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets
>    Affects Versions: Servlets Post 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Eric Norman
>             Fix For: Servlets Post 2.0.6
>
>
> Currently uploading a JSON file will just create the file node.
> On the other hand it would be useful if uploading to a node with a request extension of JSON, the JSON would be unpacked and handled as if it would be a modification request with the JSON data being the content to store.
> This would be similar to JSON upload supported by CouchDB.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.