From: <wol...@us...> - 2012-01-09 21:48:54
|
Revision: 15660 http://exist.svn.sourceforge.net/exist/?rev=15660&view=rev Author: wolfgang_m Date: 2012-01-09 21:48:48 +0000 (Mon, 09 Jan 2012) Log Message: ----------- [bugfix] Order collections in tree view in alphabetic order (except for groups) Modified Paths: -------------- apps/tamboti/modules/search/collections.xql Modified: apps/tamboti/modules/search/collections.xql =================================================================== --- apps/tamboti/modules/search/collections.xql 2012-01-09 21:07:26 UTC (rev 15659) +++ apps/tamboti/modules/search/collections.xql 2012-01-09 21:48:48 UTC (rev 15660) @@ -119,8 +119,7 @@ let $user := security:get-user-credential-from-session()[1] return if(security:can-read-collection($root-collection-path)) then - let $children := xmldb:get-child-collections($root-collection-path), - $can-write := security:can-write-collection($root-collection-path), + let $can-write := security:can-write-collection($root-collection-path), (: home collection :) $home-json := @@ -137,7 +136,9 @@ (: commons collections :) $public-json := for $child in xmldb:get-child-collections($config:mods-commons) - let $collection-path := fn:concat($config:mods-commons, "/", $child) return + let $collection-path := fn:concat($config:mods-commons, "/", $child) + order by $child + return <node>{col:get-collection($collection-path)/child::node()}</node> return @@ -164,7 +165,9 @@ <json:value> { for $child in $children - let $child-collection-path := fn:concat($collection-path, "/", $child) return + let $child-collection-path := fn:concat($collection-path, "/", $child) + order by $child + return (: output the child :) col:get-collection($child-collection-path) @@ -312,8 +315,7 @@ let $user := security:get-user-credential-from-session()[1] return if(security:can-read-collection($root-collection-path)) then - let $children := xmldb:get-child-collections($root-collection-path), - $can-write := security:can-write-collection($root-collection-path), + let $can-write := security:can-write-collection($root-collection-path), (: home collection :) $home-json := @@ -333,8 +335,9 @@ (: commons collections :) $public-json := for $child in xmldb:get-child-collections($config:mods-commons) - let $collection-path := fn:concat($config:mods-commons, "/", $child), - $commons-child-children := col:get-child-tree-nodes-recursive($collection-path, $distinct-collection-paths[fn:starts-with(., $collection-path)], $expanded-collections) + let $collection-path := fn:concat($config:mods-commons, "/", $child) + let $commons-child-children := col:get-child-tree-nodes-recursive($collection-path, $distinct-collection-paths[fn:starts-with(., $collection-path)], $expanded-collections) + order by $child return <node>{col:get-collection($collection-path, $commons-child-children, fn:contains($expanded-collections, $collection-path))/child::node()}</node> return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |