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

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


     */
    private List<Tree<ObjectType>> convertTypeDescendants(List<TypeDefinitionContainer> descendantsList) {
        List<Tree<ObjectType>> result = new ArrayList<Tree<ObjectType>>();

        for (TypeDefinitionContainer container : descendantsList) {
            ObjectType objectType = objectFactory.convertTypeDefinition(container.getTypeDefinition());
            List<Tree<ObjectType>> children = convertTypeDescendants(container.getChildren());

            result.add(new TreeImpl<ObjectType>(objectType, children));
        }

View Full Code Here


            statement.append("*");
        } else {
            statement.append(select);
        }

        final ObjectType type = getTypeDefinition(typeId);
        statement.append(" FROM ");
        statement.append(type.getQueryName());

        if (where != null && where.trim().length() > 0) {
            statement.append(" WHERE ");
            statement.append(where);
        }
View Full Code Here

        if ((source == null) || (source.getId() == null)) {
            throw new IllegalArgumentException("Source must be set!");
        }

        // get the type of the source document
        ObjectType type = null;
        if (source instanceof CmisObject) {
            type = ((CmisObject) source).getType();
        } else {
            CmisObject sourceObj = getObject(source);
            type = sourceObj.getType();
        }

        if (type.getBaseTypeId() != BaseTypeId.CMIS_DOCUMENT) {
            throw new IllegalArgumentException("Source object must be a document!");
        }

        String newId = getBinding().getObjectService().createDocumentFromSource(getRepositoryId(), source.getId(),
                objectFactory.convertProperties(properties, type, CREATE_UPDATABILITY),
View Full Code Here

        }
    }

    public synchronized boolean supportsRelationships() {
        try {
            ObjectType relType = clientSession.getSession().getTypeDefinition(BaseTypeId.CMIS_RELATIONSHIP.value());
            return relType != null;
        } catch (Exception e) {
            return false;
        }
    }
View Full Code Here

    }

    public synchronized List<ObjectType> getCreateableTypes(String rootTypeId) {
        List<ObjectType> result = new ArrayList<ObjectType>();

        ObjectType rootType = null;
        try {
            rootType = clientSession.getSession().getTypeDefinition(rootTypeId);
        } catch (CmisObjectNotFoundException e) {
            return result;
        }

        List<Tree<ObjectType>> types = clientSession.getSession().getTypeDescendants(rootTypeId, -1, false);
        addType(types, result);

        boolean isCreatable = (rootType.isCreatable() == null ? true : rootType.isCreatable().booleanValue());
        if (isCreatable) {
            result.add(rootType);
        }

        Collections.sort(result, new Comparator<ObjectType>() {
View Full Code Here

        objectOperationContext = new ClientOperationContext(OBJECT_PREFIX, sessionParameters);

        // folder operation context
        if (!sessionParameters.containsKey(FOLDER_PREFIX + ClientOperationContext.FILTER)) {
            ObjectType type = session.getTypeDefinition(BaseTypeId.CMIS_DOCUMENT.value());

            StringBuilder filter = new StringBuilder();
            for (String propId : FOLDER_PROPERTY_SET) {
                PropertyDefinition<?> propDef = type.getPropertyDefinitions().get(propId);
                if (propDef != null) {
                    if (filter.length() > 0) {
                        filter.append(",");
                    }
                    filter.append(propDef.getQueryName());
                }
            }

            sessionParameters.put(FOLDER_PREFIX + ClientOperationContext.FILTER, filter.toString());
        }

        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.INCLUDE_ACLS, "false");
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.INCLUDE_ALLOWABLE_ACTIONS, "false");
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.INCLUDE_POLICIES, "false");
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.INCLUDE_RELATIONSHIPS,
                IncludeRelationships.NONE.value());
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.RENDITION_FILTER, "cmis:none");
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.ORDER_BY, null);
        setDefault(FOLDER_PREFIX, sessionParameters, ClientOperationContext.MAX_ITEMS_PER_PAGE, "10000");

        folderOperationContext = new ClientOperationContext(FOLDER_PREFIX, sessionParameters);

        if (!sessionParameters.containsKey(VERSION_PREFIX + ClientOperationContext.FILTER)) {
            ObjectType type = session.getTypeDefinition(BaseTypeId.CMIS_DOCUMENT.value());

            StringBuilder filter = new StringBuilder();
            for (String propId : VERSION_PROPERTY_SET) {
                PropertyDefinition<?> propDef = type.getPropertyDefinitions().get(propId);
                if (propDef != null) {
                    if (filter.length() > 0) {
                        filter.append(",");
                    }
                    filter.append(propDef.getQueryName());
View Full Code Here

        parametersMap.put(parameterIndex, queryName);
    }

    public void setProperty(int parameterIndex, String typeId, String propertyId) {
        ObjectType type = session.getTypeDefinition(typeId);

        PropertyDefinition<?> propertyDefinition = type.getPropertyDefinitions().get(propertyId);
        if (propertyDefinition == null) {
            throw new IllegalArgumentException("Property does not exist!");
        }

        setProperty(parameterIndex, propertyDefinition);
View Full Code Here

            String testType = "cmis:document";
            String statement = "SELECT * FROM " + testType;

            addResult(createInfoResult("Query: " + statement));

            ObjectType type = session.getTypeDefinition(testType);

            f = createResult(FAILURE, "Test type definition '" + testType + "'not found!");
            addResult(assertNotNull(type, null, f));
            if (type == null) {
                return;
            }

            PropertyDefinition<?> objectIdPropDef = type.getPropertyDefinitions().get(PropertyIds.OBJECT_ID);

            f = createResult(FAILURE, "Object Id property definition does not exist!");
            addResult(assertNotNull(objectIdPropDef, null, f));

            String objectIdQueryName = null;
View Full Code Here

                if (node == null) {
                    return;
                }

                ObjectType type = ((TypeNode) node.getUserObject()).getType();
                typePanel.setType(type);
            }
        });

        typePanel = new TypeSplitPane(model);
View Full Code Here

    }

    public List<String> getPaths() {
        String objectId = getObjectId();

        ObjectType folderType = getSession().getTypeDefinition(BaseTypeId.CMIS_FOLDER.value());
        PropertyDefinition<?> propDef = folderType.getPropertyDefinitions().get(PropertyIds.PATH);
        String pathQueryName = (propDef == null ? null : propDef.getQueryName());

        // get object paths of the parent folders
        List<ObjectParentData> bindingParents = getBinding().getNavigationService().getObjectParents(getRepositoryId(),
                objectId, pathQueryName, false, IncludeRelationships.NONE, null, true, null);
View Full Code Here

TOP

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

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.