11-04-2011 01:25 PM
/**
* Copy single document or folder.
*
* @method onActionCopyTo
* @param asset {object} Object literal representing the file or folder to be actioned
*/
onActionCopyTo: function dlA_onActionCopyTo(asset)
{
this._copyMoveTo("copy", asset);
},
/**
* Move single document or folder.
*
* @method onActionMoveTo
* @param asset {object} Object literal representing the file or folder to be actioned
*/
onActionMoveTo: function dlA_onActionMoveTo(asset)
{
this._copyMoveTo("move", asset);
},
/**
* Copy/Move To implementation.
*
* @method _copyMoveTo
* @param mode {String} Operation mode: copy|move
* @param asset {object} Object literal representing the file or folder to be actioned
* @private
*/
_copyMoveTo: function dlA__copyMoveTo(mode, asset)
{
// Check mode is an allowed one
if (!mode in
{
copy: true,
move: true
})
{
throw new Error("'" + mode + "' is not a valid Copy/Move to mode.");
}
if (!this.modules.copyMoveTo)
{
this.modules.copyMoveTo = new Alfresco.module.DoclibCopyMoveTo(this.id + "-copyMoveTo");
}
this.modules.copyMoveTo.setOptions(
{
mode: mode,
siteId: this.options.siteId,
containerId: this.options.containerId,
path: this.currentPath,
files: asset,
workingMode: this.options.workingMode,
rootNode: this.options.rootNode,
parentId: this.doclistMetadata.parent.nodeRef
}).showDialog();
},
e il web script copy-move-to. Mi date qualche suggerimento che serve almeno per localizzare il codice per pensare alla modifica? Grazie a tutti.
11-07-2011 03:26 AM
onOK: function DLCMT_onOK(e, p_obj)
{
var files, multipleFiles = [], params, i, j,
eventSuffix =
{
copy: "Copied",
move: "Moved"
};
// Single/multi files into array of nodeRefs
if (YAHOO.lang.isArray(this.options.files))
{
files = this.options.files;
}
else
{
files = [this.options.files];
}
for (i = 0, j = files.length; i < j; i++)
{
multipleFiles.push(files[i].nodeRef);
}
// Success callback function
var fnSuccess = function DLCMT__onOK_success(p_data)
{
var result,
successCount = p_data.json.successCount,
failureCount = p_data.json.failureCount;
this.widgets.dialog.hide();
// Did the operation succeed?
if (!p_data.json.overallSuccess)
{
Alfresco.util.PopupManager.displayMessage(
{
text: "COPIATO O SPOSTATO"//this.msg("message.failure")
});
return;
}
YAHOO.Bubbling.fire("files" + eventSuffix[this.options.mode],
{
destination: this.currentPath,
successCount: successCount,
failureCount: failureCount
});
for (var i = 0, j = p_data.json.totalResults; i < j; i++)
{
result = p_data.json.results[i];
if (result.success)
{
YAHOO.Bubbling.fire((result.type == "folder" ? "folder" : "file") + eventSuffix[this.options.mode],
{
multiple: true,
nodeRef: result.nodeRef,
destination: this.currentPath
});
}
}
Alfresco.util.PopupManager.displayMessage(
{
text: "COPIATO O SPOSTATO!!!!!!"//this.msg("message.success", successCount)
});
};
11-07-2011 05:49 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.