The occasional problem with Sling is that the feature set moves faster than the 
documentation.

Support for modification of content via JSON has been implemented. Here's some 
relevant links:
https://cwiki.apache.org/confluence/display/SLING/FAQ#FAQ-HowdoIcreateanodebypostingajsondocumenttoaURL?
https://issues.apache.org/jira/browse/SLING-1172

As you can tell, this was actually completed a while back. So the problem 
you're experiencing is either a bug(new or regression) or there's a problem 
with how you implemented

Can you provide a simple use  case of the problem you're having posting json?

-Jason

-----Original Message-----
From: Haefele, Michael [mailto:michael-haef...@idexx.com] 
Sent: Wednesday, July 22, 2015 4:36 PM
To: users@sling.apache.org
Subject: Best practices for java DTOs to/from Sling

We have a Sling application that we're using basically as a database/file 
manager for portions of a java Spring application.

In java we have a bunch of DTOs that we import by converting to json using 
Jackson and persisting to Sling using the import option on the Sling post 
servlet.
We then read them using .tidy.infinity.json and convert back to DTOs using 
Jackson again.
This is working really well.

But we've reached point where we need to modify some of the data in Sling and 
it seems like I've hit a bit of a conceptual wall.
I was thinking we'd keep the DTO pattern going.
Load the DTO, modify some value, push the updated DTO back to Sling.

But it seems the POST servlet doesn't support json when doing a modify 
operation.
I basically took that as a hint that I might be barking up the wrong tree here.

We could also do the updates by posting specific properties, but it seems like 
that's opening the door to writing a lot of custom update code.


Does anyone have any suggestions for best practices for this sort of thing?
Am I trying too hard to apply RDBMS/hibernate style patterns?


Thanks for taking to the time to read a somewhat open ended question.

Reply via email to