From e3a75701d20ae21a7fbb8c42b8c91b7949ee3355 Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Sun, 28 Mar 2010 13:49:48 +0000 Subject: [PATCH] Workflow bugs, themefixes and refactored location display to a js class - Simple workflow action couldn't re-display its values from the rule edit dialog - New repo doclienst webscript: slingshot/documentlibrary/location.get for resolving a file/folder's repo- (& site-) locations - New class Alfresco.Location that takes a nodeRef and figures out how it shall be displayed regardin to where user is browsing and if folder is in a site or not - Run in background option in rule edit now in right column to save vertical space - The "When" rule config section's select drop down is now wider so its fully readable - Flash upload now looks ok in all themes - Rules list "Inherited from"-link now working correctly - alfresco.js' combinePaths() now handles null values git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19619 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../documentlibrary/location.get.desc.xml | 8 +++ .../slingshot/documentlibrary/location.get.js | 49 +++++++++++++++++++ .../documentlibrary/location.get.json.ftl | 19 +++++++ 3 files changed, 76 insertions(+) create mode 100644 config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.desc.xml create mode 100644 config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.js create mode 100644 config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.json.ftl diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.desc.xml new file mode 100644 index 0000000000..6a6c0a8914 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.desc.xml @@ -0,0 +1,8 @@ + + path + Document List Component - path resolver + /slingshot/doclib/node/{store_type}/{store_id}/{id}/path + argument + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.js new file mode 100644 index 0000000000..f52197934f --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.js @@ -0,0 +1,49 @@ + + + +/** + * Main entry point: Return scope of nodeRef + * + * @method resolvePath + */ +function resolveLocations() +{ + // Use helper function to get the arguments + var parsedArgs = ParseArgs.getParsedArgs(); + if (parsedArgs === null) + { + return; + } + var libraryRoot = parsedArgs.libraryRoot ? parsedArgs.libraryRoot : companyhome, + repoLocation = Common.getLocation(parsedArgs.rootNode, libraryRoot), + siteLocation = Common.getLocation(parsedArgs.rootNode, null), + fileName = !parsedArgs.rootNode.isContainer ? parsedArgs.rootNode.properties["name"] : null; + + var locations = + { + repo: + { + path: repoLocation.path, + file: fileName ? fileName : null + } + }; + + if (siteLocation.site) + { + locations.site = + { + path: siteLocation.path, + file: fileName ? fileName : null, + site: siteLocation.site, + siteTitle: siteLocation.siteTitle, + container: siteLocation.container + }; + } + + return locations; +} + +/** + * + */ +model.locations = resolveLocations(); \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.json.ftl new file mode 100644 index 0000000000..8707ae243c --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/location.get.json.ftl @@ -0,0 +1,19 @@ +<#escape x as jsonUtils.encodeJSONString(x)> +{ + <#if (locations.site??)> + <#assign site = locations.site> + "site": + { + <#if (site.file??)>"file": "${site.file}", + "site": "${site.site!""}", + "siteTitle": "${site.siteTitle!""}", + "container": "${site.container!""}", + "path": "${site.path!""}" + }, + "repo": + { + <#if (locations.repo.file??)>"file": "${locations.repo.file}", + "path": "${locations.repo.path!""}" + } +} +