From 3999f9dec951153e6f3535ca14cb15a52df23dbb Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Wed, 30 May 2012 08:27:10 +0000 Subject: [PATCH] Merged V4.0-BUG-FIX to HEAD 37121: ALF-12796: Ensure that only visible nodes are shown via Category search in Repository view when libraryRoot is changed from company home. 37124: ALF-14220: Parallel reviews now takes into account maximum percentage of approval rate possible when deciding to add new task 37128: Fixes: ALF-14322. Translation update from Gloria 37135: Fix for ALF-13993 It fails to find documents whose tag is longer than 255 characters - TAGS are truncated as QNAMES - default to 255. - TAGS longer then 255 characters can be created. - TAGS equal in the first 255 characters can not be created (as they would be treated as duplicates by search) 37181: Merged V3.4-BUG-FIX to V4.0-BUG-FIX Merge HEAD to V3.4-BUG-FIX 33880: ALF-12777 / ALF-14259: MMT should not install AMPs which override pre-existing files in the war file, unless -force is provided. The MMT is moving toward more of a validation phase (checks things, calculate changes) then an execution phase (makes the changes). 37192: Merged V3.4-BUG-FIX to V4.0-BUG-FIX 37081: ALF-13054 Rule action "Transform and copy image" fails if transformation cannot be performed by transformer.ImageMagick - (Problem 3 only) - TransformerDebug is now issued from ContentService.isTransformable(...) and ImageTransformActionExecuter.doTransform(...) 37088: ALF-10217: Updated parse-args.lib.js to support sites having two parent nodes. 37143: Fixes: ALF-14322: Translation update from Gloria. 37145: ALF-14303 Alfresco crashes when viewing doclib / previewing - PDF with CMap Adding temporary workaround: Modified fail over transformers for PDF to PNG to be PDFRenderer, ImageMagick (new) and the PDFBox. If Ghostscript is installed on the server, ImageMagick will be able to perform the transformation. If not installed, it fails with an unsupported transformation and fails over to PDFBox as it does today and will encounter this issue if the supplied PDF. If this issues takes place, install Ghostscript. 37190: Merged PATCHES/V3.4.6 to V3.4-BUG-FIX 37189: ALF-13404: Performance: 'Content I'm Editing' dashlet is slow to render when there is lots of data/sites - Additional query improvement by Pavel 37191: ALF-13379: Fix IsImmutableProperty to react to locks again and stop unit test from confusing a lock with a checkout 37193: Merged V4.0 to V4.0-BUG-FIX 37070: ALF-14310: alfresco-enterprise-webeditor-4.0.2.zip fails with HTTP Status 500 - Due to more incomplete dependency updates 37146: (RECORD ONLY) ALF-13745: Merged V3.4-BUG-FIX (3.4.10) to V4.0 (4.0.2) 37145: ALF-14303 Alfresco crashes when viewing doclib / previewing - PDF with CMap Adding temporary workaround: Modified fail over transformers for PDF to PNG to be PDFRenderer, ImageMagick (new) and the PDFBox. If Ghostscript is installed on the server, ImageMagick will be able to perform the transformation. If not installed, it fails with an unsupported transformation and fails over to PDFBox as it does today and will encounter this issue if the supplied PDF. If this issues takes place, install Ghostscript. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@37196 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../documentlibrary-v2/filters.lib.js | 6 +++- .../slingshot/documentlibrary/filters.lib.js | 2 +- .../documentlibrary/parse-args.lib.js | 36 +++++++++++++++++-- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js index 843c8f88a2..3fc445448f 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/filters.lib.js @@ -248,7 +248,11 @@ var Filters = constructPathQuery: function constructPathQuery(parsedArgs) { var pathQuery = ""; - if (parsedArgs.nodeRef != "alfresco://company/home") + if (parsedArgs.libraryRoot != companyhome) + { + pathQuery = '+PATH:"' + parsedArgs.rootNode.qnamePath + '//*"'; + } + else if (parsedArgs.nodeRef != "alfresco://company/home") { pathQuery = '+PATH:"' + parsedArgs.rootNode.qnamePath + '//*"'; } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/filters.lib.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/filters.lib.js index 48c2bf8aef..92628ee65c 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/filters.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/filters.lib.js @@ -243,7 +243,7 @@ var Filters = var pathQuery = ""; if (parsedArgs.nodeRef != "alfresco://company/home") { - pathQuery = '+PATH:"' + parsedArgs.rootNode.qnamePath + '//*"'; + pathQuery = '+PATH:"' + parsedArgs.rootNode.qnamePath + '//cm:*"'; } return pathQuery; } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/parse-args.lib.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/parse-args.lib.js index 5951dad640..b118fd793a 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/parse-args.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/parse-args.lib.js @@ -180,6 +180,27 @@ var Common = return favourites; }, + /** + * Returns the number of nested levels at which two paths match. This is used when there are two + * parents to a node and is used to determine the correct one. + * + * @param count + * @param firstNode An array of Strings that are the elements in a path to a node. + * @param secondNode An array of Strings that are the elements in a path to a different node. + */ + getDeepOfPath: function Common_getDeepOfPath(count, firstNode, secondNode) + { + var i = 0; + for (var i = 0; i < count; i++) + { + if (!firstNode[i].equals(secondNode[i])) + { + break; + } + } + return i; + }, + /** * Generates a location object literal for a given node. * Location is Site-relative unless a libraryRoot node is passed in. @@ -202,16 +223,27 @@ var Common = if (libraryRoot) { + var libraryRootDisplayPath = libraryRoot.displayPath.split("/"); + var deepLibraryRoot = libraryRootDisplayPath.length; + var deepNode = displayPaths.length; + + var count = (deepNode > deepLibraryRoot) ? Common.getDeepOfPath(deepNode, displayPaths, libraryRootDisplayPath): Common.getDeepOfPath(deepLibraryRoot, libraryRootDisplayPath, displayPaths); + + if (node.qnamePath.contains(libraryRoot.qnamePath)) + { + count++; + } + // Generate the path from the supplied library root location = { site: null, siteTitle: null, container: null, - path: "/" + displayPaths.slice(libraryRoot.displayPath.split("/").length + 1, displayPaths.length).join("/"), + path: "/" + displayPaths.slice(count, deepNode).join("/"), file: node.name }; - } + } else if ((qnamePaths.length > 4) && (qnamePaths[2] == TYPE_SITES)) { var siteId = displayPaths[3],