05-15-2012 11:42 AM
05-15-2012 03:52 PM
05-16-2012 09:06 AM
06-12-2012 08:18 PM
defined the properties directly within the document types
06-14-2012 06:38 AM
07-12-2012 04:38 AM
private ObjectId createDocument(String barcode, String filePath, Folder dmsFolderTest) {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
properties.put(PropertyIds.NAME, "some name");
properties.put("bc:num", "12345");
ContentStream contentStream = getFileContentStream(filePath);
return dmsFolderTest.createDocument(properties, contentStream, VersioningState.NONE);
}
private void updateProperties(ObjectId documentId) {
CmisObject document = session.getObject(documentId);
Map<String, Object> updateproperties = new HashMap<String, Object>();
updateproperties.put("bc:num", "12345");
document.updateProperties(updateproperties);
}
07-12-2012 05:00 AM
02-24-2014 03:26 PM
/*This method is for create the document*/
public void PutFile(CMISDocument document)
{
IObjectId cmisObjectFolder = (IObjectId)session.GetObject(document.FolderId);
IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.Name] = document.ContentStreamFileName;
properties[PropertyIds.ObjectTypeId] = "cmis:document";
properties[PropertyIds.CreationDate] = DateTime.Now;
ContentStream contentStream = new ContentStream();
contentStream.FileName = document.ContentStreamFileName;
contentStream.MimeType = document.ContentStreamMimeType;
contentStream.Length = document.Stream.Length;
contentStream.Stream = document.Stream;
IObjectId objectId = session.CreateDocument(properties, cmisObjectFolder, contentStream, DotCMIS.Enums.VersioningState.None);
PutFileDetail(objectId,document.Owner);
}
/*This method is for add properties of a specific aspect*/
internal void PutFileDetail(IObjectId objectId,string actorIdCard)
{
ICmisObject cmisObject = session.GetObject(objectId);
IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.ObjectTypeId] = "adm:aridoctypBase";
properties["adm:actidcard"] = actorIdCard;
IObjectId newId = cmisObject.UpdateProperties(properties);
if (newId.Id == cmisObject.Id)
{
// the repository updated this object - refresh the object
cmisObject.Refresh();
}
else
{
// the repository created a new version - fetch the new version
cmisObject = session.GetObject(newId);
}
}
06-20-2014 03:00 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.