Package org.apache.chemistry.opencmis.client.api

Examples of org.apache.chemistry.opencmis.client.api.SessionFactory


    @Override
    public void start(BundleContext context) throws Exception {
        // get the reference of SessionFactory service
        reference = context.getServiceReference(SessionFactory.class.getName());
        SessionFactory sessionFactory = (SessionFactory)context.getService(reference);
        SessionFactoryLocator.setSessionFactory(sessionFactory);
    }
View Full Code Here


        }
        session.getBinding().close();
    }

    protected Session createSession() {
        SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
        Map<String, String> parameter = new HashMap<String, String>();
        parameter.put(SessionParameter.ATOMPUB_URL, getUrl());
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

        Repository repository = sessionFactory.getRepositories(parameter).get(0);
        return repository.createSession();
    }
View Full Code Here

   
  private Session cmisClientSession = null;
 
  private Session getCmisClientSession(){
    // default factory implementation
    SessionFactory factory = SessionFactoryImpl.newInstance();
    Map<String, String> parameters = new HashMap<String, String>();

    // user credentials
    parameters.put(SessionParameter.USER, CmisConfig.USERNAME_DEFAULT_VALUE);
    parameters.put(SessionParameter.PASSWORD, CmisConfig.PASSWORD_DEFAULT_VALUE);

    // connection settings
    String endpoint =
        CmisConfig.PROTOCOL_DEFAULT_VALUE + "://" +
        CmisConfig.SERVER_DEFAULT_VALUE + ":" +
        CmisConfig.PORT_DEFAULT_VALUE +
        CmisConfig.PATH_DEFAULT_VALUE;
   
    parameters.put(SessionParameter.ATOMPUB_URL, endpoint);
    parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

    // create session
    return factory.getRepositories(parameters).get(0).createSession();
  }
View Full Code Here

    // 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();
   
        Folder parent = (Folder) session.getObjectByPath("/camunda fox/fox-invoice");
       
    // properties
    // (minimal set: name and object type id)
View Full Code Here

    // 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();
   
        Folder parent = (Folder) session.getObjectByPath("/camunda fox/fox-invoice");
       
    // properties
    // (minimal set: name and object type id)
View Full Code Here

   
  private Session cmisClientSession = null;
 
  private Session getCmisClientSession(){
    // default factory implementation
    SessionFactory factory = SessionFactoryImpl.newInstance();
    Map<String, String> parameters = new HashMap<String, String>();

    // user credentials
    parameters.put(SessionParameter.USER, CmisConfig.USERNAME_DEFAULT_VALUE);
    parameters.put(SessionParameter.PASSWORD, CmisConfig.PASSWORD_DEFAULT_VALUE);

    // connection settings
    String endpoint =
        CmisConfig.PROTOCOL_DEFAULT_VALUE + "://" +
        CmisConfig.SERVER_DEFAULT_VALUE + ":" +
        CmisConfig.PORT_DEFAULT_VALUE +
        CmisConfig.PATH_DEFAULT_VALUE;
   
    parameters.put(SessionParameter.ATOMPUB_URL, endpoint);
    parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

    // create session
    return factory.getRepositories(parameters).get(0).createSession();
  }
View Full Code Here

        }
        session.getBinding().close();
    }

    protected Session createSession() {
        SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
        Map<String, String> parameter = new HashMap<String, String>();
        parameter.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER);
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

        Repository repository = sessionFactory.getRepositories(parameter).get(0);
        return repository.createSession();
    }
View Full Code Here

   
  private Session cmisClientSession = null;
 
  private Session getCmisClientSession(){
    // default factory implementation
    SessionFactory factory = SessionFactoryImpl.newInstance();
    Map<String, String> parameters = new HashMap<String, String>();

    // user credentials
    parameters.put(SessionParameter.USER, CmisConfig.USERNAME_DEFAULT_VALUE);
    parameters.put(SessionParameter.PASSWORD, CmisConfig.PASSWORD_DEFAULT_VALUE);

    // connection settings
    String endpoint =
        CmisConfig.PROTOCOL_DEFAULT_VALUE + "://" +
        CmisConfig.SERVER_DEFAULT_VALUE + ":" +
        CmisConfig.PORT_DEFAULT_VALUE +
        CmisConfig.PATH_DEFAULT_VALUE;
   
    parameters.put(SessionParameter.ATOMPUB_URL, endpoint);
    parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

    // create session
    return factory.getRepositories(parameters).get(0).createSession();
  }
View Full Code Here

        MultiUseAbstractTest.afterAll();
    }

    public static void testDirectChemistryConnect() {
        // default factory implementation
        SessionFactory factory = SessionFactoryImpl.newInstance();
        Map<String, String> parameter = new HashMap<String, String>();

        // connection settings
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
        parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, CMIS_URL + "services/ACLService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, CMIS_URL + "services/DiscoveryService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, CMIS_URL + "services/MultiFilingService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, CMIS_URL + "services/NavigationService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, CMIS_URL + "services/ObjectService10?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, CMIS_URL + "services/PolicyService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, CMIS_URL + "services/RelationshipService?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, CMIS_URL + "services/RepositoryService10?wsdl");
        parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, CMIS_URL + "services/VersioningService?wsdl");
        // Default repository id for in memory server is A1
        parameter.put(SessionParameter.REPOSITORY_ID, "A1");

        // create session
        final Session session = factory.createSession(parameter);
        assertTrue("Chemistry session should exists.", session != null);
    }
View Full Code Here

            factoryClassName = fallbackClassName;
        }

        Class<?> clazz = cl.loadClass(factoryClassName);

        SessionFactory result = null;
        try {
            Method newInstanceMethod = clazz.getMethod("newInstance", new Class[0]);

            if (!SessionFactory.class.isAssignableFrom(newInstanceMethod.getReturnType())) {
                throw new ClassNotFoundException("newInstance() method does not return a SessionFactory object!");
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.client.api.SessionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.