I have a form that I need to be able to reject an asset. I see the code in the javascript to approve an asset. Is there a servlet that handles the rejection of an asset? If I change so that the JSON string contains "rejected" instead of "accepted", the server responds with an error that the field "accepted" does not exist. What would the URL to a servlet that would handle the rejection be?
Solved! Go to Solution.
Views
Replies
Total Likes
couple of quick things
1. You are using log.debug. Have you enabled the configuration to log the debug level ?? else use log.info or log.error
2. How have you created your session ??
Views
Replies
Total Likes
Can you explain a bit more of your use case ?
At what point you would need to reject an asset ? is it at the upload time, processing time and at the usage time...
Views
Replies
Total Likes
They client creates a project that starts off a workflow. The work flow progresses along until an approval step. At that point they want to be able to reject asset(s) and return the processing to a previous step then proceed normally from there, retracing the steps between. Since there is an approval mechanism, what is the rejection mechanism? Then I'd like to see if any one of the assets associated with the project has been rejected in a GoTo step and branch back. I'm guessing I'll have to modify states of the steps that have to be retraced too.
Views
Replies
Total Likes
So every step of a workflow, you have 'complete' to go fwd and 'Step Back' to basically use it as a reject where it goes to the previous step
Views
Replies
Total Likes
This implementation has been heavily customized. There isn't a back option it is the fifth step of six where the reject occurs and it has to jump back to the second step and proceed from there until the reviewer accepts all of the assets.
Views
Replies
Total Likes
I was able to add this, sort of. The problem was that the rejection didn't save unless the step was completed. Since the approve and reject are separate options, if I rejected an image, then approved, the rejected mages would be reset to "pending". I was using an ajax call to a servlet I wrote to set the value in the DAM but it wouldn't save the update in the dam even though I had a session.save() in the servlet code. What could I be missing in not being able to save the value?
Views
Replies
Total Likes
What account did you use to open the session - did the user on which the session was based have write permissions for that part of the JCR. That is the only reason why i see not modifying the asset in the DAM.
Views
Replies
Total Likes
Can you share your code snippet so we can see if something missing
Views
Replies
Total Likes
The user agent should have full access to that. I'll have to check the permissions. Shouldn't there be an error in the logs?
try { JSONArray jsonData = new JSONArray(data); for( int i = 0; i < jsonData.length(); i++){ JSONObject obj = jsonData.getJSONObject(i); String path = folder + "/" + obj.getString("id") + "/" + obj.getString("rejected"); Resource res = resourceResolver.getResource(path); Node assetMetadataNode = resourceResolver.getResource(res.getPath() + "/jcr:content/metadata").adaptTo(Node.class); assetMetadataNode.setProperty("dam:status", "rejected"); session.save(); String s = assetMetadataNode.getProperty("dam:status").getString(); log.debug(s); session.save(); } }catch(JSONException je) { je.printStackTrace(); }catch(RepositoryException re){ re.printStackTrace(); }catch (Exception e){ e.printStackTrace(); }
The value is in the session when I check it after the first save. I just added the second one just for a test. When I check the DAM in CRX, I don't see the value and I don't see any errors in the logs.
Views
Replies
Total Likes
couple of quick things
1. You are using log.debug. Have you enabled the configuration to log the debug level ?? else use log.info or log.error
2. How have you created your session ??
Views
Replies
Total Likes
The log level is at debug.
The session is being created thus:
Session session = resourceResolver.adaptTo(Session.class);
This is in a servlet that overrides SlingAllMethodsServlet.
Views
Replies
Total Likes