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

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


        if ((context == null) || (newId == null)) {
            return null;
        }

        // get the new object
        CmisObject object = getSession().getObject(newId, context);
        if (!(object instanceof Folder)) {
            throw new CmisRuntimeException("Newly created object is not a folder! New id: " + newId);
        }

        return (Folder) object;
View Full Code Here


        if ((context == null) || (newId == null)) {
            return null;
        }

        // get the new object
        CmisObject object = getSession().getObject(newId, context);
        if (!(object instanceof Policy)) {
            throw new CmisRuntimeException("Newly created object is not a policy! New id: " + newId);
        }

        return (Policy) object;
View Full Code Here

                // convert objects
                List<Document> page = new ArrayList<Document>();
                if (checkedOutDocs.getObjects() != null) {
                    for (ObjectData objectData : checkedOutDocs.getObjects()) {
                        CmisObject doc = objectFactory.convertObject(objectData, ctxt);
                        if (!(doc instanceof Document)) {
                            // should not happen...
                            continue;
                        }
View Full Code Here

                // shouldn't happen ...
                continue;
            }

            // convert the object
            CmisObject object = of.convertObject(oifc.getObject().getObject(), context);
            if (!(object instanceof FileableCmisObject)) {
                // the repository must not return objects that are not fileable,
                // but you never know...
                continue;
            }
View Full Code Here

            // the repository sent an object without a valid object id...
            throw new CmisRuntimeException("Repository sent invalid data! No object id!");
        }

        // fetch the object and make sure it is a folder
        CmisObject parentFolder = getSession().getObject((String) idProperty.getFirstValue(), context);
        if (!(parentFolder instanceof Folder)) {
            // the repository sent an object that is not a folder...
            throw new CmisRuntimeException("Repository sent invalid data! Object is not a folder!");
        }
View Full Code Here

        createGUI();
    }

    public void objectLoaded(ClientModelEvent event) {
        CmisObject object = model.getCurrentObject();

        propertyUpdatePanel.setObject(object);
        propertyUpdatePanel.setVisible(propertyUpdatePanel.isAllowed());

        deletePanel.setObject(object);
View Full Code Here

                }
            }

            // check paging
            int pageSize = 5;
            CmisObject lastObject = null;

            int count = 0;
            ItemIterable<CmisObject> page1 = testFolder.getChildren(SELECT_ALL_NO_CACHE_OC_ORDER_BY_NAME).getPage(
                    pageSize);
            for (CmisObject child : page1) {
                count++;
                lastObject = child;
            }

            f = createResult(FAILURE, "Returned number of children doesn't match the page size!");
            addResult(assertEquals(pageSize, count, null, f));

            count = 0;
            ItemIterable<CmisObject> page2 = testFolder.getChildren(SELECT_ALL_NO_CACHE_OC_ORDER_BY_NAME)
                    .skipTo(pageSize - 1).getPage(pageSize);
            for (CmisObject child : page2) {
                count++;

                if (count == 1) {
                    f = createResult(FAILURE,
                            "Last object of the first page doesn't match the first object of the second page.");
                    addResult(assertEquals(lastObject.getId(), child.getId(), null, f));
                }
            }

            f = createResult(FAILURE, "Returned number of children doesn't match the page size!");
            addResult(assertEquals(pageSize, count, null, f));
View Full Code Here

                        if (objectIdQueryName != null) {
                            String objectId = (String) qr.getPropertyByQueryName(objectIdQueryName).getFirstValue();

                            try {
                                CmisObject object = session.getObject(objectId, SELECT_ALL_NO_CACHE_OC);
                                addResult(checkObject(session, object, getAllProperties(object),
                                        "Query hit check. Id: " + objectId));
                            } catch (CmisObjectNotFoundException e) {
                                addResult(createResult(FAILURE,
                                        "Query hit references an object that doesn't exist. Id: " + objectId, e, false));
View Full Code Here

        }
        if (pathOrIdOfObject == null) {
            throw new IllegalArgumentException("pathOrIdOfObject must be set!");
        }

        CmisObject result = null;
        if (pathOrIdOfObject.startsWith("/")) {
            result = session.getObjectByPath(pathOrIdOfObject);
        } else {
            result = session.getObject(pathOrIdOfObject);
        }
View Full Code Here

     *            the session
     * @return the folder object
     * @throws CmisBaseException
     */
    public static Folder getFolder(String pathOrIdOfObject, Session session) {
        CmisObject folder = getObject(pathOrIdOfObject, session);

        if (folder instanceof Folder) {
            return (Folder) folder;
        } else {
            throw new IllegalArgumentException("Object is not 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.