Examples of CmisObject


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

            // handle policies
            if ((objectData.getPolicyIds() != null) && (objectData.getPolicyIds().getPolicyIds() != null)) {
                policies = new ArrayList<Policy>();
                for (String pid : objectData.getPolicyIds().getPolicyIds()) {
                    CmisObject policy = session.getObject(getSession().createObjectId(pid));
                    if (policy instanceof Policy) {
                        policies.add((Policy) policy);
                    }
                }
                extensions.put(ExtensionLevel.POLICIES, objectData.getPolicyIds().getExtensions());
            }

            // handle relationships
            if (objectData.getRelationships() != null) {
                relationships = new ArrayList<Relationship>();
                for (ObjectData rod : objectData.getRelationships()) {
                    CmisObject relationship = of.convertObject(rod, this.creationContext);
                    if (relationship instanceof Relationship) {
                        relationships.add((Relationship) relationship);
                    }
                }
            }
View Full Code Here

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

      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

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

    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

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

    private void doAction(boolean alternate) {
        int row = getSelectedRow();
        if ((row > -1) && (row < model.getCurrentChildren().size())) {
            String id = getModel().getValueAt(getRowSorter().convertRowIndexToModel(row), ID_COLUMN).toString();
            CmisObject object = model.getFromCurrentChildren(id);

            if (object instanceof Document) {
                if (alternate) {
                    ClientHelper.download(this.getParent(), (Document) object, null);
                } else {
                    ClientHelper.open(this.getParent(), (Document) object, null);
                }
            } else if (object instanceof Folder) {
                try {
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    model.loadFolder(object.getId(), false);
                } catch (Exception ex) {
                    ClientHelper.showError(null, ex);
                    return;
                } finally {
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
View Full Code Here

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

        public int getRowCount() {
            return model.getCurrentChildren().size();
        }

        public Object getValueAt(int rowIndex, int columnIndex) {
            CmisObject obj = model.getCurrentChildren().get(rowIndex);

            switch (columnIndex) {
            case 0:
                return icons.get(obj.getBaseTypeId());
            case 1:
                return obj.getName();
            case 2:
                return obj.getType().getId();
            case 3:
                if (obj instanceof Document) {
                    return ((Document) obj).getContentStreamMimeType();
                } else {
                    return null;
                }
            case 4:
                if (obj instanceof Document) {
                    return ((Document) obj).getContentStreamLength();
                } else {
                    return null;
                }
            case 5:
                return obj.getCreationDate();
            case 6:
                return obj.getCreatedBy();
            case 7:
                return obj.getLastModificationDate();
            case 8:
                return obj.getLastModifiedBy();
            case ID_COLUMN:
                return obj.getId();
            }

            return "";
        }
View Full Code Here

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

        @Override
        protected Transferable createTransferable(JComponent c) {
            int row = getSelectedRow();
            if ((row > -1) && (row < model.getCurrentChildren().size())) {
                String id = getValueAt(row, ID_COLUMN).toString();
                CmisObject object = model.getFromCurrentChildren(id);

                if (object instanceof Document) {
                    Document doc = (Document) object;

                    File tempFile = null;
View Full Code Here

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

                        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

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

                    f = createResult(FAILURE, "Change Time is not set! Id: " + event.getObjectId());
                    addResult(assertNotNull(event.getChangeTime(), null, f));

                    if (event.getChangeType() != ChangeType.DELETED && event.getObjectId() != null) {
                        try {
                            CmisObject object = session.getObject(event.getObjectId(), SELECT_ALL_NO_CACHE_OC);
                            addResult(checkObject(session, object, getAllProperties(object), "Object check. Id: "
                                    + event.getObjectId()));
                        } catch (CmisObjectNotFoundException e) {
                            addResult(createResult(
                                    FAILURE,
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
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.