cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with alfresco cmis extension

imran
Champ on-the-rise
Champ on-the-rise
Hello Experts,
I have tried to use alfresco cmis extension 7. That library does not contain TransientCmisObject.class because it is deprecated. However, when I try to do something this class is still being searched and class definitions not found exception is thrown. This is how I acquire a session. Any ideas?


public static Session openCMISSession(String username, String password) {
        loadProperties();
   Map<String, String> parameter = new HashMap<>();
   parameter.put(SessionParameter.USER, username);
   parameter.put(SessionParameter.PASSWORD, password);
   parameter.put(SessionParameter.ATOMPUB_URL,"http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom");
        parameter.put(SessionParameter.BINDING_TYPE,BindingType.ATOMPUB.value());
   parameter.put(SessionParameter.REPOSITORY_ID, repository);
        // Set the alfresco object factory
        parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
   SessionFactory sf=SessionFactoryImpl.newInstance();
        List<Repository> repositories = sf.getRepositories(parameter);
        return sf.getRepositories(parameter).get(0).createSession();
    }

3 REPLIES 3

mrogers
Star Contributor
Star Contributor
You need let most recent version of the extension for your version of the open cmis library.    (The revision made by me).  The code is in GitHub.   Or is also available from Alfresco's maven repo.

However on 5.0 there's no need for the extension since cmis 1.1 makes it obsolete.

imran
Champ on-the-rise
Champ on-the-rise
I could not know how this form works. Smiley Sad

imran
Champ on-the-rise
Champ on-the-rise
Thank you very much for the helpful information. Yes, with cmis 1.1 my code works even without the extension.
Thank you again.