Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/roxy/lib/controller-helper.xqy
View
15 src/roxy/lib/controller-helper.xqy
@@ -17,6 +17,10 @@ xquery version "1.0-ml";
module namespace ch = 'http://marklogic.com/roxy/controller-helper';
+(: The request library provides awesome helper methods to abstract get-request-field :)
+import module namespace req = "http://marklogic.com/roxy/request" at
+ "/roxy/lib/request.xqy";
+
declare option xdmp:mapping "false";
declare variable $ALL-FORMATS as xs:string+ := ("html", "xml", "json", "text");
@@ -75,9 +79,14 @@ declare function ch:use-layout($layout as xs:string?, $formats as xs:string*)
)
};
-declare function ch:add-value($key as xs:string, $value as item()*)
+declare function ch:add-value($key as xs:string, $default as item()*)
{
- map:put($ch:map, $key, (map:get($ch:map, $key), $value))
+ map:put($ch:map, $key, (map:get($ch:map, $key), $default))
+};
+
+declare function ch:add-value($key as xs:string)
+{
+ ch:add-value($key, req:get($key))
};
declare function ch:set-value($key as xs:string, $value as item()*)
@@ -109,4 +118,4 @@ declare function ch:set-format($new-format as xs:string, $formats as xs:string*)
}
)
)
-};
+};

No commit comments for this range

Something went wrong with that request. Please try again.