Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
OpenCMIS 0.13.0
-
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)
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.