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

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


            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


      }catch(IOException e){
        e.printStackTrace();
      }
     
        // Create a SessionFactory and set up the SessionParameter map
        SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
        Map<String, String> parameter = new HashMap<String, String>();

        // user credentials -
        parameter.put(SessionParameter.USER, userEmail);
        parameter.put(SessionParameter.PASSWORD, password);

        // connection settings - substitute your own URL
        parameter.put(SessionParameter.ATOMPUB_URL, dotCMSCMISURL);
        parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());

        System.out.println("Accessing ATOMPUB_URL: " + parameter.get(SessionParameter.ATOMPUB_URL)
                + " userid: " + parameter.get(SessionParameter.USER)
                + " password: " + parameter.get(SessionParameter.PASSWORD) + EOL);

        // find all the repositories at this URL - there should only be one.
        List<Repository> repositories = new ArrayList<Repository>();
        repositories = sessionFactory.getRepositories(parameter);
        for (Repository r : repositories) {
            System.out.println("Found repository: " + r.getName());
        }

        // create session with the first (and only) repository
        Repository repository = repositories.get(0);
        parameter.put(SessionParameter.REPOSITORY_ID, repository.getId());
        Session session = sessionFactory.createSession(parameter);

        System.out.println("Got a connection to repository: " + repository.getName()
                + ", with id: " + repository.getId() + EOL);

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.