AnsweredAssumed Answered

cmis

Question asked by sunitha on Mar 4, 2013
Latest reply on Mar 5, 2013 by muralidharand
Hi ..

I am new to alfresco.I am trying to connect to the alfresco repository by using cmis api.
My program showing some errors at the atompub line..
could you people help me in regarding this area.
my source code..



import java.util.HashMap;
import java.util.Map;

import javax.xml.ws.BindingType;

import org.apache.chemistry.opencmis.client.api.Session;
import org.apache.chemistry.opencmis.client.api.SessionFactory;
import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
import org.apache.chemistry.opencmis.commons.SessionParameter;


public class Third {
   
   public static void main(String arg[]) throws Exception{
      
      
      Map<String, String> parameter = new HashMap<String, String>();

      // Set the user credentials
      parameter.put(SessionParameter.USER, "admin");
      parameter.put(SessionParameter.PASSWORD, "admin");

      // Specify the connection settings
      parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8070/alfresco/service/cmis");
      parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

      // Set the alfresco object factory
      parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

      // Create a session
      SessionFactory factory = SessionFactoryImpl.newInstance();
      Session session = factory.getRepositories(parameter).get(0).createSession();
       System.out.println("Connected to repository:");
   }

}



Thanks,
Sunitha..

Outcomes