I have a FileNet p8 server which contains 2 CMIS repositories: RepoA and RepoB.
I would like to select one or the other using the RepositoryId session parameter, but I always end up with the 2 repositories:
var cmisParameters = new Dictionary<string, string>();
cmisParameters[SessionParameter.BindingType] = BindingType.AtomPub;
cmisParameters[SessionParameter.AtomPubUrl] = "myurl";
cmisParameters[SessionParameter.User] = "myuser";
cmisParameters[SessionParameter.Password] = "mypassword";
cmisParameters[SessionParameter.RepositoryId] = "RepoB";
SessionFactory factory = SessionFactory.NewInstance();
IList<IRepository> repositories = factory.GetRepositories(cmisParameters);
foreach (var repository in repositories)
{
Console.WriteLine(repository.Id);
}
The output is:
RepoA
RepoB
I specified the RepositoryId so I think the output should only be RepoB.
Is it a known FileNet bug? Or am I missing something?
The GetRepositories() method of the SessionFactory ignores the repository ID of the parameter map and returns all available repositories. This is useful, if you have no information about the existing repositories at the given endpoint.
So, if you know the ID of your target repository, you don't need to get them all. In this case you can simply use the CreateSession() method.