Fatwire 7.6.1 RevisionTrackingManager get方法失败

时间:2013-02-12 17:58:37

标签: fatwire

// CSElement代码 //我试图使用RevisionTrackingManager接口获取资产和资产数据的修订号,但是它抛出异常

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?

1 个答案:

答案 0 :(得分:1)

我不确定抛出什么类型的异常,因为你正在抓住它。或者,您也可以在AssetType_T表中找到资产的版本。希望有所帮助。