Uploaded image for project: 'OASIS Content Management Interoperability Services (CMIS) TC'
  1. OASIS Content Management Interoperability Services (CMIS) TC
  2. CMIS-789

getRepositoryInfo always returns available top repository from the list even if the repository id passed into getRepositoryInfo is set to a different repository

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: V1.1 Errata
    • Fix Version/s: V1.1 Errata
    • Labels:
      None
    • Environment:

      Windows Server 2012/ RHEL, tomcat/ WAS. Open CMIS 0.13.0 / Tip build, IBM FileNet repository

      Description

      The issues is in "Apache Chemistry client code" within the jar file "chemistry-opencmis-client-bindings-0.13.0".

      • The getRepositoryInfo() on the client side is implemented in the class "RepositoryServiceImpl" (under the package "org.apache.chemistry.opencmis.client.bindings.spi.browser"). JAR file "chemistry-opencmis-client-bindings-0.13.0".
      • This method has a snippet which does something unexpected. When the length of the repository infos list is 1, it returns that SOLE repository.

      Code Snippet below:

      public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
      List repositoryInfos = getRepositoriesInternal(repositoryId);

      if (repositoryInfos.isEmpty())

      { throw new CmisObjectNotFoundException("Repository '" + repositoryId + "'not found!"); }

      if (repositoryInfos.size() == 1)

      { return (RepositoryInfo)repositoryInfos.get(0); }

      for (RepositoryInfo info : repositoryInfos) {
      if (info.getId() == null)

      { continue; }

      if (info.getId().equals(repositoryId))

      { return info; }

      }

      throw new CmisObjectNotFoundException("Repository '" + repositoryId + "'not found!");
      }

      • So, when the number of repositories in the given domain is just one, it always returns that irrespective what the user has set in the property "org.apache.chemistry.opencmis.session.repository.id"

      Proposed solution:
      The "if " condition above checking for repositoryInfos.size, which returns the only available repository should be removed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              srinivas.gannavarapu Srinivas Gannavarapu
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: