When editing an image, you must work with its master version. To modify an image, perform the following:
EXAMPLE: Modifying an image by the ID of its master version
The example below shows you how to modify an image by the ID of its master version. For more information about working with the ID of the live version, see For developers: Edit content in For developers: Content lifecycle.
The following code modifies an image by the ID of its master version.
First, you get an instance of the LibrariesManager class. Then, you get the master version with the corresponding ID. Then, to get a temp version of the image, you call Lifecycle.CheckOut with the master version as an argument. You make all the modifications to the temp version. In this example, you update the title of the image and its URL, and upload new image data. Then, to transfer the changes to the master version, you call Lifecycle.CheckIn with the temp version as an argument. By default, when calling the CheckIn method, the temp version gets deleted. To persist the changes, you call SaveChanges. Finally, to publish the master version, you call the MessageWorkflow method of the WorkflowManager class and pass the required parameters.
First, you check whether an image with the specified ID exists. Then, you get the singular image facade of the master version with the specified ID. Then, to get the facade for the temp version, you call the CheckOut method. You make all the modifications in the Do method of the temp facade. In this example, you update the title of the image and its URL, and upload new image data. To upload new image data, you call the UploadContent and pass the data as an argument. Then, to transfer the changes to the master version of the item, you call CheckIn. To save the changes, you call SaveChanges. Finally, to publish the image, you call the MessageWorkflow method of the WorkflowManager class and pass the required parameters.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important
Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, Ipswitch, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.
Powered by Progress Sitefinity