Thanks for the additional information. Oddly, my test configuration is
exactly as you describe: cq is unpacked in the Docs directory, so when
explore.xqy calls xdmp:invoke, the root path is 'Docs/'. I don't yet
understand why this works for me, but not for you or for Mike Bowers.
If you're comfortable with diff and patch, here's a possible fix. With
this change, cq attempts to figure out where it has been installed, and
uses that path as the root for explore-invokable.xqy. It works for me,
but so did the 4.0.1 technique :-).
-- Mike
Wyatt VanderStucken wrote:
Michael,
I'm able to reproduce this also. I don't think it's Linux vs. Windows,
but rather where cq is deployed. I have cq deployed to
<MLS_DIR>/Docs/cq/ within an app whose root is set to "Docs/". The
problem lies in explore.xqy - explore-invokable.xqy needs to be invoked
relative to explore.xqy...
return xdmp:invoke(
'explore-invokable.xqy',
(xs:QName('START'), $START, xs:QName('SIZE'), $SIZE,
xs:QName('FILTER-TEXT'), $FILTER-TEXT,
xs:QName('FILTER'),
if (not($filter)) then '' else xdmp:quote(document { $filter })
),
$OPTIONS
)
That's as far as my debugging has gotten - off to a meeting...
Thanks,
Wyatt
Michael Blakeley wrote:
Mike,
Thanks for the report. I'm having trouble reproducing this error on
Linux: that may mean that it's a Windows-specific error, so I'll have
to try a Windows machine.
Meanwhile, you should be able to cq 3.2.4 with MarkLogic Server 4.0-1.
-- Mike
Mike Bowers wrote:
CQ v4.0.1 Error. Occurs when pushing the explore link. The MarkLogic
database against which CQ is running is a freshly installed instance
of v4.0-1. Below is the error message displayed in CQ.
500 Internal Server Error
SVC-FILOPN: xdmp:invoke("explore-invokable.xqy", (QName("", "START"),
1, QName("", "SIZE"), ...), <options
xmlns="xdmp:eval"><database>17830873724881344990</database><root>Docs</root><modul...</options>)
-- File open error: open 'Docs\explore-invokable.xqy': No such file
or directory
in /cq/explore.xqy, on line 65 [1.0-ml]
$filter = ()
$filter = ()
----------------------------------------------------------------------
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the
sender by reply email and destroy all copies of the original message.
------------------------------------------------------------------------
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
Index: lib-controller.xqy
===================================================================
--- lib-controller.xqy (revision 877)
+++ lib-controller.xqy (working copy)
@@ -168,12 +168,26 @@
declare variable $c:PROFILING-ALLOWED as xs:boolean :=
prof:allowed(xdmp:request());
+declare variable $c:REQUEST-PATH as xs:string :=
+ let $path := xdmp:get-request-path()
+ (: ensure that the path ends with "/" :)
+ return
+ if (ends-with($path, "/"))
+ then $path
+ else concat(
+ string-join(tokenize($path, "/")[ 1 to last() - 1], "/"), "/"
+ )
+;
+
declare variable $c:SERVER-ID as xs:unsignedLong :=
xdmp:server() ;
declare variable $c:SERVER-NAME as xs:string :=
xdmp:server-name($SERVER-ID) ;
+declare variable $c:SERVER-APPLICATION-PATH as xs:string :=
+ concat($c:SERVER-ROOT-PATH, $c:REQUEST-PATH) ;
+
declare variable $c:SERVER-ROOT-PATH as xs:string :=
$io:MODULES-ROOT ;
@@ -186,16 +200,7 @@
declare variable $c:SESSION-RELPATH as xs:string := "sessions/" ;
declare variable $c:SESSION-DIRECTORY as xs:string :=
- let $path := xdmp:get-request-path()
- (: ensure that the path ends with "/" :)
- let $path :=
- if (ends-with($path, "/"))
- then $path
- else concat(
- string-join(tokenize($path, "/")[ 1 to last() - 1], "/"), "/"
- )
- return concat($path, $c:SESSION-RELPATH)
-;
+ concat($c:REQUEST-PATH, $c:SESSION-RELPATH) ;
declare variable $c:SESSION-EXCEPTION as element(error:error)? := () ;
@@ -562,13 +567,7 @@
declare function c:build-document-path($document-name as xs:string)
as xs:string {
- let $path := xdmp:get-request-path()
- (: ensure that the path ends with "/" :)
- let $path :=
- if (ends-with($path, "/"))
- then $path
- else concat(string-join(tokenize(
- $path, "/")[ 1 to last() - 1], "/"), "/")
+ let $path := $c:REQUEST-PATH
(: canonicalize the document-name :)
let $document-name :=
if (not(starts-with($document-name, '/')))
Index: explore.xqy
===================================================================
--- explore.xqy (revision 881)
+++ explore.xqy (working copy)
@@ -41,20 +41,16 @@
declare variable $SIZE as xs:integer :=
xs:integer(xdmp:get-request-field('size', '20'));
-declare variable $OPTIONS as element() :=
+d:check-debug(),
+let $options :=
<options xmlns="xdmp:eval">
{
element database { $c:FORM-EVAL-DATABASE-ID },
- (: we should always have a root path, but better safe than sorry :)
- if ($c:SERVER-ROOT-PATH) then element root { $c:SERVER-ROOT-PATH }
- else (),
+ element root { $c:SERVER-APPLICATION-PATH },
element modules { $c:SERVER-ROOT-DB }
}
</options>
-;
-
-d:check-debug(),
-d:debug(('explore:', $OPTIONS, $START, $SIZE, $FILTER, $FILTER-TEXT)),
+let $d := d:debug(('explore:', $options, $START, $SIZE, $FILTER, $FILTER-TEXT))
let $filter :=
for $i in $FILTER
return cts:query(xdmp:unquote($i)/*)
@@ -69,7 +65,7 @@
xs:QName('FILTER'),
if (not($filter)) then '' else xdmp:quote(document { $filter })
),
- $OPTIONS
+ $options
)
(: explore.xqy :)
\ No newline at end of file
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general