Domanda

//CSElement code //Am trying to get revision numbers of asset and assetdata using the RevisionTrackingManager interface but its throwing an exception

String assetId = "1293727029653";
String assetType = "NSP_Content_C";
String selectedRevision = "2";

AssetId aId = new AssetIdImpl(assetType, Long.valueOf(assetId));
RevisionTrackingManager rtm = new RevisionTrackingManagerImpl(ics);
AssetData revisedAsset = null;
try
{   
    out.println("<br/>-------------Calling RevisionTrackingManager-------------");
    out.println("<br/>Total versions = "+ rtm.getVersions(aId).size());
    revisedAsset = rtm.get(aId,Integer.valueOf(selectedRevision));
    out.println("After");
}
catch(Exception ex)
{
    out.println("<br/>Could not retrieve asset. Possibly cause: item might be checked out............" + ex.getMessage());
}


Above code throws exception and gives the message in catch block. Could anyone help me to fix this code?
È stato utile?

Soluzione

I am not sure what type of exception is being thrown as you are catching it all. Alternatively, you could also find an asset's version in the AssetType_T table. Hope that helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top