06-04-2014 07:58 AM
06-05-2014 03:19 AM
06-12-2014 09:47 AM
updateNode.properties.description = "TEST";
existingFile.properties.description = "TEST";
06-17-2014 12:50 AM
06-17-2014 05:15 AM
/**
* Existing file handling.
*/
var existingFile = destNode.childByNamePath(filename);
if (existingFile !== null)
{
// File already exists, decide what to do
if (existingFile.hasAspect("cm:versionable") && overwrite)
{
existingFile.properties.description = "TEST"; //Added line !!
// Upload component was configured to overwrite files if name clashes
existingFile.properties.content.write(content);
// Reapply mimetype as upload may have been via Flash - which always sends binary mimetype
existingFile.properties.content.guessMimetype(filename);
existingFile.properties.content.guessEncoding();
existingFile.save();
// Extract the metadata
// (The overwrite policy controls which if any parts of
// the document's properties are updated from this)
extractMetadata(existingFile);
// Record the file details ready for generating the response
model.document = existingFile;
// MNT-8745 fix: Do not clean formdata temp files to allow for retries. Temp files will be deleted later when GC call DiskFileItem#finalize() method or by temp file cleaner.
return;
}
if (updateNodeRef !== null)
{
/**
* Update existing file specified in updateNodeRef
*/
var updateNode = search.findNode(updateNodeRef);
if (updateNode === null)
{
exitUpload(404, "Node specified by updateNodeRef (" + updateNodeRef + ") not found.");
return;
}
if (updateNode.isLocked)
{
// We cannot update a locked document
exitUpload(404, "Cannot update locked document '" + updateNodeRef + "', supply a reference to its working copy instead.");
return;
}
if (!updateNode.hasAspect("cm:workingcopy"))
{
// Ensure the file is versionable (autoVersion = true, autoVersionProps = false)
updateNode.ensureVersioningEnabled(true, false);
// It's not a working copy, do a check out to get the actual working copy
updateNode = updateNode.checkoutForUpload();
}
// Update the working copy content
updateNode.properties.description = "TEST"; //Line added !!
updateNode.properties.content.write(content);
// Reset working copy mimetype and encoding
updateNode.properties.content.guessMimetype(filename);
updateNode.properties.content.guessEncoding();
// check it in again, with supplied version history note
updateNode = updateNode.checkin(description, majorVersion);
06-18-2014 02:25 AM
06-18-2014 08:31 AM
06-24-2014 01:03 AM
04-12-2017 03:37 AM
Please, give me example.
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.