@Override public ObjectId call() throws Exception { return session.createDocument(properties, folderId, contentStream, versioningState, policies, addAces, removeAces); } }
@Override public ObjectId call() throws Exception { return session.createDocument(properties, folderId, contentStream, versioningState, policies, addAces, removeAces); } }
/** * create a document */ protected ObjectId createDocument(@NotNull(value = "No folder was specified in the request.") CmisObject folder, @NotNull(value = "No filename was specified in the request.") String filename, @NotNull(value = "No document content was specified in the payload.") Object content, @NotNull(value = "No file mime type was specified in the request.") String mimeType, @NotNull(value = "No versioning state was specified in the request.") org.mule.modules.cmis.model.VersioningState versioningState, String objectType, Map<String, Object> extraProperties) { ObjectId returnId = null; Session session = this.getSession(this.connectionParameters); if (session != null) { VersioningState vs; try { vs = VersioningState.valueOf(versioningState.name()); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(String.format("Illegal value for versioningState. Given `%s' could be: %s", versioningState, Arrays.toString(VersioningState.values())), e); } Map<String, Object> properties = new HashMap<String, Object>(); properties.put(PropertyIds.OBJECT_TYPE_ID, objectType); properties.put(PropertyIds.NAME, filename); if (extraProperties != null) { properties.putAll(extraProperties); } returnId = session.createDocument(properties, session.createObjectId(folder.getId()), createContentStream(filename, mimeType, content), vs); } return returnId; // End createDocument }
@Override public String postFeedback(VisitorFeedback feedback) { Map<String, Object> props = new TreeMap<String, Object>(); props.put(PropertyIds.OBJECT_TYPE_ID, "D:ws:visitorFeedback"); props.put(PropertyIds.NAME, new SimpleDateFormat("yyyy-MM-dd'_'HHmmssZ").format(new Date()) + "_" + feedback.getVisitorName()); props.put(PROP_ARTICLE, feedback.getAssetId()); props.put(PROP_FEEDBACK_TYPE, feedback.getFeedbackType()); props.put(PROP_SUBJECT, feedback.getSubject()); props.put(PROP_COMMENT, feedback.getComment()); props.put(PROP_EMAIL, feedback.getVisitorEmail()); props.put(PROP_NAME, feedback.getVisitorName()); props.put(PROP_WEBSITE, feedback.getVisitorWebsite()); if (feedback.getRating() != null) { props.put(PROP_RATING, feedback.getRating()); } ObjectId id = CmisSessionHelper.getSession().createDocument(props, feedbackFolderId, null, VersioningState.MINOR, null, null, null); return id.getId(); }
ObjectId id = session.createDocument(properties, testFolder, contentStream, versioningState); Document doc = (Document) session.getObject(id, SELECT_ALL_NO_CACHE_OC);
ObjectId id = session.createDocument(properties, testFolder, null, versioningState); Document doc = (Document) session.getObject(id, SELECT_ALL_NO_CACHE_OC);