How to fetch history of elements using ClearCase CM API?

半城伤御伤魂 提交于 2019-12-01 08:42:07

问题


I want to fetch history of file elements like pdf files, doc files, etc. which are under clearcase control using Rational CM API which are provided by clearcase. I have written following code to fetch the history but it is incomplete so please help me out here.

public void fetchFileElementHistory()
{
    try
    {
        CcFile fetchElement = provider.ccFile(provider.filePathLocation(testFile)); // file under Clearcase control
        PropertyRequest wantedProps = new PropertyRequest(CcFile.DISPLAY_NAME, CcFile.CREATION_DATE,CcFile.VIEW_RELATIVE_PATH,CcFile.CLIENT_PATH,CcFile.VERSION_HISTORY,CcFile.PREDECESSOR_LIST,CcFile.ELEMENT);
        fetchElement = (CcFile) fetchElement.doReadProperties(wantedProps);
        VersionHistory versionHistory = fetchElement.getVersionHistory();
        versionHistory = (VersionHistory) versionHistory.doReadProperties(new PropertyRequest(VersionHistory.CHILD_LIST,VersionHistory.ROOT_VERSION,
                VersionHistory.CHILD_MAP,VersionHistory.PARENT_LIST,VersionHistory.PROVIDER_LIST,VersionHistory.WORKSPACE_FOLDER_LIST));
        /*
         * what to do here ? 
         */
    }
    catch(Exception e){
        e.printStackTrace();
    }
}

Thanks in advance


回答1:


The official documentation for CM API 7.1.x.
Make sure you have selected the "CM Library Samples and Documentation" feature under the Client Components section of the install. in order to check the code examples included with the javadoc.

From the object model overview, check if collections apply your case.



来源:https://stackoverflow.com/questions/36131764/how-to-fetch-history-of-elements-using-clearcase-cm-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!