Examples of CmisObject


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

        template.send(exchange);
        String newNodeId = exchange.getOut().getBody(String.class);
        assertNotNull(newNodeId);

        CmisObject newNode = retrieveCMISObjectByIdFromServer(newNodeId);
        assertEquals("cmis:folder", newNode.getType().getId());
        assertTrue(newNode instanceof Folder);
    }
View Full Code Here

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

        exchange.getIn().getHeaders().put(PropertyIds.CONTENT_STREAM_MIME_TYPE, "text/plain; charset=UTF-8");
        exchange.getIn().getHeaders().put(PropertyIds.NAME, "test.txt");

        template.send(exchange);
        String newNodeId = exchange.getOut().getBody(String.class);
        CmisObject newNode = retrieveCMISObjectByIdFromServer(newNodeId);

        assertEquals("test.txt", newNode.getPropertyValue(PropertyIds.NAME));
        assertEquals("text/plain; charset=UTF-8",
                newNode.getPropertyValue(PropertyIds.CONTENT_STREAM_MIME_TYPE));
    }
View Full Code Here

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

        Repository repository = sessionFactory.getRepositories(parameter).get(0);
        return repository.createSession();
    }

    protected String getDocumentContentAsString(String nodeId) throws Exception {
        CmisObject cmisObject = retrieveCMISObjectByIdFromServer(nodeId);
        Document doc = (Document)cmisObject;
        InputStream inputStream = doc.getContentStream().getStream();
        return readFromStream(inputStream);
    }
View Full Code Here

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

        createGUI();
    }

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

        if (object == null) {
            nameField.setText("");
            idField.setText("");
            typeField.setText("");
            basetypeField.setText("");
            versionLabelField.setText("");
            pwcField.setText("");
            paths.removeAll();
            contentUrlField.setText("");
            allowableActionsList.removeAll();
            refreshButton.setEnabled(false);
            checkButton.setEnabled(false);
            scriptPanel.setVisible(false);
        } else {
            try {
                nameField.setText(object.getName());
                idField.setText(object.getId());
                typeField.setText(object.getType().getId());
                basetypeField.setText(object.getBaseTypeId().toString());
                if (object instanceof Document) {
                    Document doc = (Document) object;

                    try {
                        versionLabelField.setText(doc.getVersionLabel());
                    } catch (Exception e) {
                        versionLabelField.setText("???");
                    }

                    if (doc.isVersionSeriesCheckedOut() == null) {
                        pwcField.setText("");
                    } else if (doc.isVersionSeriesCheckedOut().booleanValue()) {
                        pwcField.setText(doc.getVersionSeriesCheckedOutId());
                    } else {
                        pwcField.setText("(not checked out)");
                    }
                } else {
                    pwcField.setText("");
                    versionLabelField.setText("");
                }

                if (object instanceof FileableCmisObject) {
                    if (object instanceof Folder) {
                        paths.setList(Collections.singletonList(((Folder) object).getPath()));
                    } else {
                        paths.setList(Collections.singletonList(""));
                        final FileableCmisObject pathObject = (FileableCmisObject) object;
                        SwingUtilities.invokeLater(new Runnable() {
                            @Override
                            public void run() {
                                try {
                                    List<String> pathsList = pathObject.getPaths();
                                    if ((pathsList == null) || (pathsList.size() == 0)) {
                                        paths.setList(Collections.singletonList("(unfiled)"));
                                    } else {
                                        paths.setList(pathsList);
                                    }
                                } catch (Exception e) {
                                    paths.setList(Collections.singletonList("(???)"));
                                    // ClientHelper.showError(null, e);
                                }
                                ObjectPanel.this.revalidate();
                            }
                        });
                    }
                } else {
                    paths.setList(Collections.singletonList("(not filable)"));
                }

                String docUrl = getDocumentURL(object, getClientModel().getClientSession().getSession());
                if (docUrl != null) {
                    contentUrlField.setText(docUrl);
                } else {
                    contentUrlField.setText("(not available)");
                }

                if (object.getAllowableActions() != null) {
                    allowableActionsList.setList(object.getAllowableActions().getAllowableActions());
                } else {
                    allowableActionsList.setList(Collections.singletonList("(missing)"));
                }

                refreshButton.setEnabled(true);
                checkButton.setEnabled(true);

                if (object instanceof Document) {
                    String name = object.getName().toLowerCase();
                    int x = name.lastIndexOf('.');
                    if ((x > -1) && (scriptExtensions.contains(name.substring(x + 1)))) {
                        scriptPanel.setVisible(true);
                        scriptOutput.setVisible(false);
                    } else {
View Full Code Here

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

        createGUI();
    }

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

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

        deletePanel.setObject(object);
View Full Code Here

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

        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

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

                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

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

                    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

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

                // 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

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

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

        CmisObject result = null;

        // ask the cache first
        if (context.isCacheEnabled()) {
            result = this.cache.getById(objectId, context.getCacheKey());
            if (result != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.