diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.desc.xml deleted file mode 100644 index b3063daedf..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.desc.xml +++ /dev/null @@ -1,8 +0,0 @@ - - assign-workflow - Document List Action - Assign Workflow - /slingshot/doclib/action/assign-workflow - argument - user - required - diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.ftl deleted file mode 100644 index e2f0e9da9f..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.ftl +++ /dev/null @@ -1,2 +0,0 @@ -<#import "action.lib.ftl" as actionLib /> -<@actionLib.resultsJSON results=results /> \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.js deleted file mode 100644 index 1dd092b63c..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/assign-workflow.post.json.js +++ /dev/null @@ -1,147 +0,0 @@ - - -/** - * Assign Workflow to single/multiple files and single/multiple people action - * @method POST - */ - -/** - * Entrypoint required by action.lib.js - * - * @method runAction - * @param p_params {object} Object literal containing files array - * @return {object|null} object representation of action results - */ -function runAction(p_params) -{ - var result, results = [], file, files = [], i, j, workflowName, assignees, dueDate, description; - - // Must have workflow type - if (json.isNull("type")) - { - status.setCode(status.STATUS_BAD_REQUEST, "No workflow type."); - return; - } - workflowName = "jbpm$" + json.get("type"); - - // Only add files that aren't containers - for (i in p_params.files) - { - file = search.findNode(p_params.files[i]); - if (file !== null && !file.isContainer) - { - files.push(file); - } - } - - if (!files || files.length == 0) - { - status.setCode(status.STATUS_BAD_REQUEST, "No files."); - return; - } - - // Must also have array of people - assignees = getMultipleInputValues("people"); - if (typeof assignees == "string") - { - status.setCode(status.STATUS_BAD_REQUEST, "No people assigned."); - return; - } - if (!assignees || assignees.length == 0) - { - status.setCode(status.STATUS_BAD_REQUEST, "No people assigned."); - return; - } - for (i = 0, j = assignees.length; i < j; i++) - { - assignees[i] = people.getPerson(assignees[i]); - } - - // Date supplied? - dueDate = null; - if (!json.isNull("date")) - { - if (json.get("date") != "") - { - dueDate = new Date(json.get("date")); - } - } - - // Description supplied? - if (!json.isNull("description")) - { - description = json.get("description"); - description = description.substr(0, 255); - } - else - { - description = ""; - } - - // Get the workflow definition - var workflowDefinition = workflow.getDefinitionByName(workflowName); - - // Create the workflow package to contain the file nodes - var workflowPackage = workflow.createPackage(); - - // Add each file to the workflowPackage as a child association - for (i in files) - { - file = files[i]; - result = - { - nodeRef: file.nodeRef, - action: "assignWorkflow", - success: false - }; - - try - { - result.id = file.name; - result.type = "document"; - // Add the file as a child assoc of the workflow node - workflowPackage.addNode(file); - result.success = true; - } - catch (e) - { - result.id = file.name; - result.nodeRef = file.nodeRef; - result.success = false; - } - - results.push(result); - } - - var workflowParameters = - { - "bpm:workflowDescription": description - }; - - if (assignees.length == 1) - { - workflowParameters["bpm:assignee"] = assignees[0]; - } - else - { - workflowParameters["bpm:assignees"] = assignees; - } - if (dueDate) - { - workflowParameters["bpm:workflowDueDate"] = dueDate; - } - - var workflowPath = workflowDefinition.startWorkflow(workflowPackage, workflowParameters); - - // Auto-end the start task - var tasks = workflowPath.tasks; - for (task in tasks) - { - tasks[task].endTask(null); - } - - return results; -} - -/* Bootstrap action script */ -main(); diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.desc.xml deleted file mode 100644 index 415394f236..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.desc.xml +++ /dev/null @@ -1,12 +0,0 @@ - - folder - Document List Action - Create folder - /slingshot/doclib/action/folder/site/{site}/{container}/{path} - /slingshot/doclib/action/folder/site/{site}/{container} - /slingshot/doclib/action/folder/node/{store_type}/{store_id}/{id}/{path} - /slingshot/doclib/action/folder/node/{store_type}/{store_id}/{id} - argument - user - required - - diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.ftl deleted file mode 100644 index e2f0e9da9f..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.ftl +++ /dev/null @@ -1,2 +0,0 @@ -<#import "action.lib.ftl" as actionLib /> -<@actionLib.resultsJSON results=results /> \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.js deleted file mode 100644 index 2a679d784c..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/folder.post.json.js +++ /dev/null @@ -1,85 +0,0 @@ - - -/** - * Create folder action - * @method POST - * @param uri {string} /{siteId}/{containerId}/{filepath} - * @param json.name {string} New folder name - * @param json.title {string} Title metadata - * @param json.description {string} Description metadata - */ - -/** - * Entrypoint required by action.lib.js - * - * @method runAction - * @param p_params {object} common parameters - * @return {object|null} object representation of action result - */ -function runAction(p_params) -{ - var results; - - try - { - // Mandatory: json.name - if (json.isNull("name")) - { - status.setCode(status.STATUS_BAD_REQUEST, "Folder name is a mandatory parameter."); - return; - } - - var folderName = json.get("name"), - destNode = p_params.destNode; - - // Check folder doesn't already exist - var existsNode = getAssetNode(destNode, folderName); - if (typeof existsNode == "object") - { - status.setCode(status.STATUS_BAD_REQUEST, "Folder '" + folderName + "' already exists."); - return; - } - - // Title and description - var folderTitle = "", - folderDescription = ""; - if (!json.isNull("title")) - { - folderTitle = json.get("title"); - } - if (!json.isNull("description")) - { - folderDescription = json.get("description"); - } - - // Create the folder and apply metadata - var folderNode = destNode.createFolder(folderName); - // Always add title & description, default icon - folderNode.properties["cm:title"] = folderTitle; - folderNode.properties["cm:description"] = folderDescription; - folderNode.properties["app:icon"] = "space-icon-default"; - folderNode.save(); - // Add uifacets aspect for the web client - folderNode.addAspect("app:uifacets"); - - // Construct the result object - results = [ - { - id: folderName, - name: folderName, - nodeRef: folderNode.nodeRef.toString(), - action: "createFolder", - success: true - }]; - } - catch(e) - { - status.setCode(status.STATUS_INTERNAL_SERVER_ERROR, e.toString()); - return; - } - - return results; -} - -/* Bootstrap action script */ -main();