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

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


    public synchronized ClientSession getClientSession() {
        return clientSession;
    }

    public synchronized RepositoryInfo getRepositoryInfo() throws Exception {
        Session session = clientSession.getSession();
        return session.getRepositoryInfo();
    }
View Full Code Here


        }
    }

    public synchronized void loadFolder(String folderId, boolean byPath) throws Exception {
        try {
            Session session = clientSession.getSession();
            CmisObject folderObject = null;

            if (byPath) {
                folderObject = session.getObjectByPath(folderId);
            } else {
                folderObject = session.getObject(session.createObjectId(folderId));
            }

            if (!(folderObject instanceof Folder)) {
                if (folderObject instanceof FileableCmisObject) {
                    List<Folder> parents = ((FileableCmisObject) folderObject).getParents();
View Full Code Here

        loadFolder(currentFolder.getId(), false);
    }

    public synchronized void loadObject(String objectId) throws Exception {
        try {
            Session session = clientSession.getSession();
            CmisObject object = session.getObject(objectId, clientSession.getObjectOperationContext());
            object.refreshIfOld(OLD);

            setCurrentObject(object);
        } catch (Exception ex) {
            setCurrentObject(null);
View Full Code Here

        if (currentObject == null) {
            return;
        }

        try {
            Session session = clientSession.getSession();
            CmisObject object = session.getObject(currentObject, clientSession.getObjectOperationContext());
            object.refresh();

            setCurrentObject(object);
        } catch (Exception ex) {
            setCurrentObject(null);
View Full Code Here

    public synchronized ItemIterable<QueryResult> query(String q, boolean searchAllVersions, int maxHits)
            throws Exception {
        OperationContext queryContext = new OperationContextImpl(null, false, false, false, IncludeRelationships.NONE,
                null, false, null, false, maxHits);

        Session session = clientSession.getSession();
        return session.query(q, searchAllVersions, queryContext);
    }
View Full Code Here

        Session session = clientSession.getSession();
        return session.query(q, searchAllVersions, queryContext);
    }

    public synchronized List<Tree<ObjectType>> getTypeDescendants() throws Exception {
        Session session = clientSession.getSession();
        return session.getTypeDescendants(null, -1, true);
    }
View Full Code Here

    public void createDefaultSession() {
        SessionFactory factory = this.fixture.getSessionFactory();

        Hashtable<String, String> parameter = new Hashtable<String, String>(this.fixture.getParamter());

        Session s = factory.createSession(parameter);
        Assert.assertNotNull(s);
    }
View Full Code Here

        return super.getName() + " (" + getBinding() + ")";
    }

    @Override
    public void run() throws Exception {
        Session session;

        Map<String, String> parameters = getParameters();
        if (parameters.containsKey(SessionParameter.REPOSITORY_ID)) {
            session = factory.createSession(parameters);
        } else {
            session = factory.getRepositories(parameters).get(0).createSession();
        }

        // switch off the cache
        session.getDefaultContext().setCacheEnabled(false);

        try {
            run(session);
        } catch (Exception e) {
            if (!(e instanceof FatalTestException)) {
View Full Code Here

        SessionFactory factory = this.fixture.getSessionFactory();

        Hashtable<String, String> parameter = new Hashtable<String, String>(this.fixture.getParamter());
        parameter.remove(SessionParameter.SESSION_TYPE);

        Session s = factory.createSession(parameter);
        Assert.assertNotNull(s);
    }
View Full Code Here

     * org.apache.opencmis.client.api.SessionFactory#createSession(java.util
     * .Map)
     */
    @SuppressWarnings("unchecked")
    public <T extends Session> T createSession(Map<String, String> parameters) {
        Session s = null;
        SessionType t = null;

        // determine session type
        if (parameters.containsKey(SessionParameter.SESSION_TYPE)) {
            t = SessionType.fromValue(parameters.get(SessionParameter.SESSION_TYPE));
View Full Code Here

TOP

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

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.