本文介绍了如何使用ClearCase CM API获取元素的历史记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取pdf文件,doc文件等文件元素的历史记录,这些文件元素使用由clearcase提供的Rational CM API进行明确控制。我已经编写了以下代码来获取历史记录,但它不完整所以请在这里帮助我。

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();
    }
}

提前致谢

推荐答案



确保以检查代码示例包含在javadoc中。

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.

这篇关于如何使用ClearCase CM API获取元素的历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 20:16