Monday, November 30, 2015

Get full asset details

There are times when we need to inspect all the fields of asset or either to perform other tasks. One can find all the details of any asset using the following method:

Using Tag:

Using Asset API


Disclaimer: Any sample code on this blog is not officially recommended, use at your own risk.

Add assets to workflow programatically

Within WCS, Workflows are the way to initiate assets from initial creation step to publish step by going through series of steps & condition wherein each step is governed by different group of users with different permissions.

Sometimes when assets were initially created, they may or may not be in workflow. But sudden requirement like assets should be editable by only certain users, workflow can be best solution for it as WCS can restrict users from editing/deleting by checking against Roles.

But even if you define workflow, how to assign workflow to an asset?
Well, after creating workflow, you have to inspect the asset in Contributor UI -> From Top Navigation, click on View -> Status -> Select workflow process and the participants. These are quite a few steps to do assign workflow for many assets, thus, a requirement to have a utility wherein one could assign workflow to many assets at once.

Procedure:
1. Find the condition by which you can filter which assets are required to be in workflow. For e.g. only page assets are required to be in workflow, only content assets of particular type, etc. Once decided, just write a query + condition using Asset API
2. Loop through each assets and while in loop assign asset to workflow as shown:

Disclaimer: Any sample code on this blog is not officially recommended, use at your own risk.

A simple code compare functionality

One of the most important aspect of any development cycle is deployment and while deployment, it is very important to note the changes don...