Hi,
I am able to create Static File and IMAGE using API, but I am not able to apply automation though program. Kindly please help me how we can apply automation.
Code:
ContentType myContenttypeImage = (ContentType) ContentType.findByName("DSX-MEDIA-IMAGE");
ContentInstance image = (ContentInstance) myContenttypeImage.newInstance();
image.setLogicalPath("/testing");
image.setAttributeValue("OT_WEM_VA_LOCALE", "LenUSL000000000000000000000000000000RCRD");
image.setAttributeValue("TITLE", staticFileName);
image.setAttributeValue("SOURCEPATH", "/testing"+ "/" + staticFileName);
image.setAttributeValue("MEDIACLASSTYPE", "asset");
image.setAttributeValue("MEDIATYPE", "image");
image.setAttributeValue("MediaAutomations", "Image Automation");
image.commit();
We are using below Image automation for Image.
<automations>
<automation>
<id>imageautomation</id>
<type>upload</type>
<name>Image Automation</name>
<targetType>DSX-MEDIA-IMAGE</targetType>
<description>Automatically creates all sizes of images from the source.</description>
<actions>
<createformat width="320" fileappend="thumb_320" sizeformat="carousel-thumb-320w" deviceformat="web" resizetype="constrain"/>
</actions>
</automation>
</automations>
Thanks
Jay