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

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


     *            the session
     * @throws IOException
     * @throws CmisBaseException
     */
    public static void download(String docIdOrPath, String destinationPath, Session session) throws IOException {
        CmisObject doc = getObject(docIdOrPath, session);

        if (doc instanceof Document) {
            download((Document) doc, destinationPath);
        } else {
            throw new IllegalArgumentException("Object is not a document!");
View Full Code Here


     * @param session
     *            the session
     * @throws CmisBaseException
     */
    public static void delete(String pathOrIdOfObject, Session session) {
        CmisObject object = getObject(pathOrIdOfObject, session);

        if (object instanceof Folder) {
            ((Folder) object).deleteTree(true, UnfileObject.DELETE, true);
        } else {
            object.delete(true);
        }
    }
View Full Code Here

        String name = "cmistck" + System.currentTimeMillis() + session.getRepositoryInfo().hashCode();

        Folder parent = null;
        try {
            CmisObject parentObject = session.getObjectByPath(testFolderParentPath, SELECT_ALL_NO_CACHE_OC);
            if (!(parentObject instanceof Folder)) {
                addResult(createResult(FAILURE, "Parent folder of the test folder is actually not a folder! Path: "
                        + testFolderParentPath, true));
            }
View Full Code Here

                if (relationship == null) {
                    addResult(results, createResult(FAILURE, "A relationship in the relationship list is null!"));
                    continue;
                }

                CmisObject fullRelationshipObject = session.getObject(relationship, SELECT_ALL_NO_CACHE_OC);
                addResult(
                        results,
                        checkObject(session, fullRelationshipObject, getAllProperties(fullRelationshipObject),
                                "Relationship check: " + fullRelationshipObject.getId()));
            }
        }
    }
View Full Code Here

                    f = createResult(FAILURE, "Folder is not found in childs parents! Id: " + child.getId());
                    addResult(results, assertIsTrue(parents.size() > 0, null, f));
                }

                // get object by id and compare
                CmisObject objectById = session.getObject(child.getId(), SELECT_ALL_NO_CACHE_OC);

                f = createResult(FAILURE, "Child and object fetched by id don't match! Id: " + child.getId());
                addResult(results, assertEquals(child, objectById, null, f, false, false));

                // get object by path and compare
                List<String> paths = ((FileableCmisObject) child).getPaths();

                if (paths == null || paths.isEmpty()) {
                    addResult(results, createResult(FAILURE, "Child has no path! " + child.getId()));
                } else {
                    for (String path : paths) {
                        CmisObject objectByPath = session.getObjectByPath(path, SELECT_ALL_NO_CACHE_OC);

                        f = createResult(FAILURE, "Child and object fetched by path don't match! Id: " + child.getId()
                                + " / Path: " + path);
                        addResult(results, assertEquals(child, objectByPath, null, f, false, false));
View Full Code Here

      if (Logging.connectors.isDebugEnabled())
        Logging.connectors.debug("CMIS: Processing document identifier '"
            + nodeId + "'");

      CmisObject cmisObject = session.getObject(nodeId);
     
      String errorCode = "OK";
      String errorDesc = StringUtils.EMPTY;
      String baseTypeId = cmisObject.getBaseType().getId();

      if (baseTypeId.equals(CMIS_FOLDER_BASE_TYPE)) {

        // adding all the children for a folder
View Full Code Here

    getSession();
   
    String[] rval = new String[documentIdentifiers.length];
    int i = 0;
    while (i < rval.length){
      CmisObject cmisObject = session.getObject(documentIdentifiers[i]);
      if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
        Document document = (Document) cmisObject;
       
        //we have to check if this CMIS repository support versioning
        // or if the versioning is disabled for this content
        if(StringUtils.isNotEmpty(document.getVersionLabel())){
View Full Code Here

    getSession();
   
    String[] rval = new String[documentIdentifiers.length];
    int i = 0;
    while (i < rval.length){
      CmisObject cmisObject = session.getObject(documentIdentifiers[i]);
      if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
        Document document = (Document) cmisObject;
       
        //we have to check if this CMIS repository support versioning
        // or if the versioning is disabled for this content
        if(StringUtils.isNotEmpty(document.getVersionLabel())){
View Full Code Here

      if (Logging.connectors.isDebugEnabled())
        Logging.connectors.debug("CMIS: Processing document identifier '"
            + nodeId + "'");

      CmisObject cmisObject = session.getObject(nodeId);
     
      String errorCode = "OK";
      String errorDesc = StringUtils.EMPTY;
      String baseTypeId = cmisObject.getBaseType().getId();

      if (baseTypeId.equals(CMIS_FOLDER_BASE_TYPE)) {

        // adding all the children for a folder
View Full Code Here

      if (Logging.connectors.isDebugEnabled())
        Logging.connectors.debug("CMIS: Processing document identifier '"
            + nodeId + "'");

      CmisObject cmisObject = session.getObject(nodeId);
     
      String errorCode = "OK";
      String errorDesc = StringUtils.EMPTY;
      String baseTypeId = cmisObject.getBaseType().getId();

      if (baseTypeId.equals(CMIS_FOLDER_BASE_TYPE)) {

        // adding all the children for a folder
View Full Code Here

TOP

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

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.