08-16-2011 02:34 AM
// Create the properties list
nameProperty = new NamedValue();
nameProperty.name = Constants.PROP_NAME;
nameProperty.value = strFileName;
nameProperty.isMultiValue = false;
//if new properties must be added, change the next line accordingly
arrProperties = new NamedValue[4];
arrProperties[0] = nameProperty;
nameProperty = new NamedValue();
nameProperty.name = Constants.PROP_TITLE;
nameProperty.value = strFileName;
nameProperty.isMultiValue = false;
arrProperties[1] = nameProperty;
nameProperty = new NamedValue();
nameProperty.name = Constants.ASPECT_VERSIONABLE;
nameProperty.value = strFileName;
nameProperty.isMultiValue = false;
arrProperties[2] = nameProperty;
nameProperty = new NamedValue();
nameProperty.name = Constants.ASPECT_CLASSIFIABLE;
nameProperty.value = strFileName;
nameProperty.isMultiValue = false;
arrProperties[3] = nameProperty;
// Create the CML create object
objCreate = new CMLCreate();
objCreate.parent = parentReference;
objCreate.id = "1";
objCreate.type = Constants.TYPE_CONTENT;
objCreate.property = arrProperties;
// Create and execute the cml statement
objCml = new CML();
objCml.create = new CMLCreate[] { objCreate };
arrUpdateResult = repoService.update(objCml);
// work around to cast Alfresco.RepositoryWebService.Reference to
// Alfresco.ContentWebService.Reference
Alfresco.RepositoryWebService.Reference rwsRef = arrUpdateResult[0].destination;
Alfresco.ContentWebService.Reference newContentNode = new Alfresco.ContentWebService.Reference();
newContentNode.path = rwsRef.path;
newContentNode.uuid = rwsRef.uuid;
Alfresco.ContentWebService.Store cwsStore = new Alfresco.ContentWebService.Store();
cwsStore.address = "SpacesStore";
spacesStore.scheme = Alfresco.RepositoryWebService.StoreEnum.workspace;
newContentNode.store = cwsStore;
// Open the file and convert to byte array
inputStream = new FileStream(file, FileMode.Open);
iBufferSize = (int)inputStream.Length;
arrBytes = new byte[iBufferSize];
inputStream.Read(arrBytes, 0, iBufferSize);
inputStream.Close();
Wie zu sehen ist werden Properties z.B. versionable und classifiable gesetzt. Dennoch haben hoch geladene Dokumente zwar eine Versionsnummer, dennoch wird diese nicht hochgezählt wenn eine neuere Version einer Datei hoch geladen wird. Wozu also setzt man in dem Beispiel diese Properties?08-17-2011 05:41 PM
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.