Cmis 方法 getAllVersions 异常:CmisNotSupported

我当然对此感到绝望,我希望有人知道我的 CMIS 服务器实现中缺少什么,或者服务器端出了什么问题。


我已经使用 Apache chemistry-opencmis 实现了我的 Cmis 服务器,这些是 pom 中的依赖项:


<dependency>

      <groupId>org.apache.chemistry.opencmis</groupId>

      <artifactId>chemistry-opencmis-server-support</artifactId>

      <version>1.1.0</version>

    </dependency>

    <dependency>

      <groupId>org.apache.chemistry.opencmis</groupId>

      <artifactId>chemistry-opencmis-server-bindings</artifactId>

      <version>1.1.0</version>

      <exclusions>

        <exclusion> <!-- Due to GWT compiler error -->

          <groupId>asm</groupId>

          <artifactId>asm</artifactId>

        </exclusion>

      </exclusions>

 </dependency>

当我尝试从客户端调用getAllVersions方法(我已经在服务器端实现)时,一切似乎都不太奏效,得到这个异常: CmisNotSupportedException:该对象的存储库不支持操作!


我使用以下代码对其进行了测试,针对现有文档:


Session session = getSession();


Document doc = (Document) session.getObject("dddfd49f-ab13-435d-b65c-7e18d3bfbed3");



doc.getAllVersions();

得到提到的异常。

使用提到的测试调试客户端,问题是永远不会到达服务器方法getAllVersions之前抛出客户端提到的异常,它试图获取此链接http://localhost:8081/cmis/atom/default/versions?id =dddfd49f-ab13-435d-b65c-7e18d3bfbed3从它的链接缓存(它是一个地图)中使用这个密钥版本历史,但是这个密钥不在他们的链接缓存中,这是我指的类

org.apache.chemistry.opencmis.client.bindings.spi.atompub.VersioningServiceImpl

这只是代码:


@Override

    public List<ObjectData> getAllVersions(String repositoryId, String objectId, String versionSeriesId, String filter,

            Boolean includeAllowableActions, ExtensionsData extension) {

        List<ObjectData> result = new ArrayList<ObjectData>();


        // find the link

        String link = loadLink(repositoryId, objectId, Constants.REL_VERSIONHISTORY, Constants.MEDIATYPE_FEED);


        if (link == null) {

            throwLinkException(repositoryId, objectId, Constants.REL_VERSIONHISTORY, Constants.MEDIATYPE_FEED);

        }


方法loadLink返回 null,因此它启动上述异常,因为他没有找到上述链接。



MMTTMM
浏览 88回答 1
1回答

慕田峪7331174

versions尽管文档被标记为可版本化,但服务器不提供指向资源的链接。在对象中设置版本系列 ID&nbsp;ObjectInfo。那应该添加缺失的链接。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java