Connecting to Sharepoint 2010 Server CMIS using Apache Chemistry through AtomPUB URL

Respondido Connecting to Sharepoint 2010 Server CMIS using Apache Chemistry through AtomPUB URL

  • Thursday, November 24, 2011 1:23 PM
     
      Has Code

    Hi All,

    I am connecting to Sharepoint 2010 CMIS from Java.

    SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
    Map<String, String> parameter = new HashMap<String, String>();	
    parameter.put(SessionParameter.ATOMPUB_URL, "http://moss/my/personal/administrator/_vti_bin/cmis/rest/51af5382-02bb-42c2-84d9-a125a8e56fa8?getrepositoryinfo"); // URL to your CMIS server.	
    parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());	
    List<Repository> repositories = new ArrayList<Repository>();
    repositories = sessionFactory.getRepositories(parameter);
    for (Repository r : repositories) {
    System.out.println("Found repository: " + r.getName());
    }
    
    


    When I loop through the List of Repositories. I am getting only one Repository. 

    There should be some change I should make (Either in the Atom pub URL).

    Can anyone tell me how to get the list of repositories from Sharepoint 2010 when connecting through CMIS Using Atom PUB URL.

    Regards,

    Sakthi

All Replies

  • Saturday, November 26, 2011 5:35 AM
     
     Answered Has Code

    I have not worked on CMIS but I am just trying to help. If I understand the above code correctly and match it up with the documentation, http://technet.microsoft.com/en-us/library/ff934619.aspx it looks like it will always only return 1 repository since you are passing respoitory GUID after /rest/ in the ATOMPUB_URL.

     

    Maybe you should try the code here, http://chemistry.apache.org/opencmis-cookbook.html#OpenCMISCookbook-CMISClient

    The bold line below is the change I propose. I have not tested if this works but worth a try.

    try {
        // This supposes only one repository is available at the URL.
        Repository soleRepository =
        sessionFactory.getRepositories(parameter); 
        session = soleRepository.createSession();
    }
    catch(CmisConnectionException e) { 
        // The server is unreachable
    }

    Steve Thomas
    • Edited by Thomas,Steve Saturday, November 26, 2011 5:35 AM
    • Marked As Answer by Seven M Friday, December 02, 2011 8:49 AM
    •  
  • Wednesday, February 01, 2012 5:09 PM
     
     

    I'm pretty sure this is an intrinsic limitation of the SharePoint 2010 CMIS implementation. If SharePoint worked like all other CMIS providers, it would provide a getRepositories operation at a known URI (e.g. http://moss/my/personal/administrator/_vti_bin/cmis/rest?getRepositories). The result of this operation would be a list of the available repositories, and each repository in that list would provide the URI of the getRepositoryInfo operation for that repository. As it is now, discovering/generating the URI for a SharePoint repository's getRepositoryInfo operation is basically a manual operation that is difficult to explain to an end user.

    For example, let's say you're building an application that can access documents from a CMIS repository. For other CMIS providers, the user would only need to provide the host name of the content server, and your application could discover the CMIS repositories available on that server (or possibly even the CMIS repositories available on other connected servers also.) However if the provider is SharePoint 2010, you'll need to provide the user with some instructions about how to find the "List ID" of the SharePoint document library they wish to access, so that your application can construct the correct URI to the getRepositoryInfo operation for that specific library.

    Hopefully this severe shortcoming is addressed in a future version. (Please?)


    Thomas Dinger Software Architect IBM Collaboration Solutions
  • Wednesday, August 22, 2012 8:52 PM
     
     

    Thomas,

    I just tried this against SP 2013 version --- used CMIS workbench to test...

    http://webApplicationURL/_vti_bin/cmis/rest?getRepositories -- does pull out all repositories listing...


    http://www.sathishtk.com/blog