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

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


    }

    @Override
    public CMSObject getFirstNodeByName(String name, ConnectionInfo connectionInfo) throws RepositoryAccessException {
        try {
            Session session = (Session) getSession(connectionInfo);
            return getFirstNodeByName(name, session);
        } catch (CmisBaseException e) {
            throw new RepositoryAccessException("Error at accessing repository", e);
        }
    }
View Full Code Here


    }

    @Override
    public ObjectTypeDefinition getObjectTypeDefinition(String typeRef, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            return CMISModelMapper.getObjectTypeDefinition(cmisSession.getTypeDefinition(typeRef));
        } catch (CmisBaseException e) {
            throw new RepositoryAccessException("Error at accessing repository", e);
        }
    }
View Full Code Here

    }

    @Override
    public List<Property> getProperties(CMSObject node, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            CmisObject cmisObject = cmisSession.getObject(CMISObjectId.getObjectId(node.getUniqueRef()));
            CMISModelMapper.fillProperties(cmisObject, node);
            return node.getProperty();
        } catch (CmisBaseException e) {
            throw new RepositoryAccessException("Error at accessing repository", e);
        }
View Full Code Here

    }

    @Override
    public List<PropertyDefinition> getPropertyDefinitions(ObjectTypeDefinition instance, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            ObjectType objectType = cmisSession.getTypeDefinition(instance.getUniqueRef());
            CMISModelMapper.fillPropertyDefinitions(instance, objectType);
            return instance.getPropertyDefinition();
        } catch (CmisBaseException e) {
            throw new RepositoryAccessException("Error at accessing repository", e);
        }
View Full Code Here

    }

    @Override
    public List<ObjectTypeDefinition> getParentTypeDefinitions(ObjectTypeDefinition instance, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            ObjectType type = cmisSession.getTypeDefinition(instance.getUniqueRef());
            List<ObjectTypeDefinition> typeDefinitions = new ArrayList<ObjectTypeDefinition>();
            ObjectType parentTypeDef = type.getParentType();
            while (parentTypeDef != null) {
                typeDefinitions.add(CMISModelMapper.getObjectTypeDefinition(parentTypeDef));
                parentTypeDef = parentTypeDef.getParentType();
View Full Code Here

    }

    @Override
    public CMSObject getContainerObject(Property instance, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            CmisObject cmisObject = cmisSession.getObject(CMISObjectId.getObjectId(instance
                    .getContainerObjectRef()));
            return CMISModelMapper.getCMSObject(cmisObject);
        } catch (CmisBaseException e) {
            throw new RepositoryAccessException("Error at accessing repository", e);
        }
View Full Code Here

    }

    @Override
    public PropertyDefinition getPropertyDefinition(Property instance, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            Map<String,org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> definitions = cmisSession
                    .getTypeDefinition(instance.getSourceObjectTypeRef()).getPropertyDefinitions();
            for (org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> definition : definitions
                    .values()) {
                if (definition.getLocalName().equals(instance.getLocalname())) {
                    // TODO Property creation and then resolving propertydefinition from property should be
View Full Code Here

    }

    @Override
    public CMSObject getParentByNode(CMSObject instance, Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            CmisObject cmisObject = cmisSession.getObject(CMISObjectId.getObjectId(instance.getUniqueRef()));
            if (instance.getParentRef() != null) {
                return CMISModelMapper.getCMSObject(cmisSession.getObject(CMISObjectId.getObjectId(instance
                        .getParentRef())));
            }
            if (cmisObject instanceof Folder) {
                Folder folder = (Folder) cmisObject;
                for (Folder parent : folder.getParents()) {
View Full Code Here

    @Override
    public List<ObjectTypeDefinition> getChildObjectTypeDefinitions(ObjectTypeDefinition instance,
                                                                    Object session) throws RepositoryAccessException {
        try {
            Session cmisSession = checkSession(session);
            CmisObject node = cmisSession.getObject(CMISObjectId.getObjectId(instance.getUniqueRef()));
            if (node instanceof ObjectType) {
                ObjectType type = (ObjectType) node;
                CMISModelMapper.fillChildObjectTypeDefinitions(instance, type);
                return instance.getObjectTypeDefinition();
            } else {
View Full Code Here

        }
    }

    @Override
    public boolean isSessionValid(Object session) {
        Session cmisSession = (Session) session;
        try {
            cmisSession.clear();
            return true;
        } catch (Exception e) {
            return false;
        }
    }
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.