The IPSContentWs.saveItems() does not appears to save the content item in the following scenario. The logic for our this extension is: :
There is a preprocessor extension running. We get the content id from the request session. Load the value in displaytitle for this content item. Next, find the owner for this content item.
Load the owner, and need to copy the displaytitle loaded of itemA to related_url field for owner Item B.
I have shown here both the Rhythmyx Impl save (using updateItem) as well as the PSO Implementation. However, both the save(s) appear not to be doing the save. Can you please tell me if I am missing any API call?
pay particular attention to the description of GUIDs that have revisions vs GUIDs that do not have revisions.
In your case, you are not providing the revision before you save the item. The revision may change on the “prepareForEdit” call (as I explain in the document), so you need to check the edit revision after you’ve checked out the item.
Thanks Dave…for all the information about including the Revisions. Also I reviewed to my best the API Recommendations document that you sent. I do understand I should be passing in the revision along with the content id during the creation of Guid for both the item A as well owner item B.
In your case, you are not providing the revision before you save the item. The revision may change on the “prepareForEdit” call (as I explain in the document), so you need to check the edit revision after you’ve checked out the item
As you mentioned, I am not providing the revision before saving the item, I cannot figure out how should I pass in the revision before the save. The only way I know to save is to invoke the method:
cws.saveItems(items, false, true);
However, I don’t know where can I pass in the revision. This method simply takes a list of PSCoreItems and saves them. Is there a different method?
Also you mentioned I need to check the edit revision after check out of the item. How should I do that? If I get the revision before and after prepareForEdit and if them happen to be same, should I proceed as normal, and if they are different, then what should I do?
Also on the side note…do we need worry about revisions even if we are using PSO methods:
RxItemUtils.setFieldValue()
Look at the manageRevisions() method of PSServiceLocators class in the API Recommendations sample code, which is describe in section 2.1.3 of the document (on page 7). It shows you how to handle the edit revision.
Basically, you need to make the item GUID from the edit locator AFTER you call prepareForEdit(). This is the GUID you will use for the save.