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

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


        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

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

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

        Map<String, String> parameters = getParameters();
        String repId = parameters.get(SessionParameter.REPOSITORY_ID);
        if ((repId != null) && (repId.length() > 0)) {
            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

        sessionPool = pool;
    }

    public void execute(String workspaceName, SessionVoidCallback callback) {
        try {
            Session session = sessionPool.borrowSession(workspaceName);
            try {
                callback.doInSession(session);
            } finally {
                sessionPool.returnSession(workspaceName, session);
            }
View Full Code Here

        }
    }

    public <T> T execute(String workspaceName, SessionCallback<T> callback) {
        try {
            final Session session = sessionPool.borrowSession(workspaceName);
            try {
                return callback.doInSession(session);
            } finally {
                sessionPool.returnSession(workspaceName, session);
            }
View Full Code Here

    public void CMIS()
        throws JsonParseException,
            JsonMappingException,
            IOException
    {
        Session session = alfresco.getCMISSession(network);
        Document doc = (Document)session.getObjectByPath(objectPath);

        assertEquals(filename, doc.getName());
    }
View Full Code Here


    public Session getCMISSession(String networkId)
    {
        CMISSessions sessions = new CMISSessions();
        Session session = sessions.getSession(networkId);
        return session;
    }
View Full Code Here

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

        // create session
        Session session = sessionFactory.createSession(parameters, null, cmisOAuthAuthenticationProvider, null);
        return session;
    }
View Full Code Here

         * @param networkId
         * @return
         */
        Session getSession(String networkId)
        {
            Session session = sessions.get(networkId);
            if (session == null)
            {
                session = createCMISSession(networkId);
                sessions.put(networkId, session);
            }
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.