Efraim Feinstein | 22 Oct 06:27 2014
Picon

Stack trace in try/catch?

Hi,

If I catch an exception in XQuery code using try/catch, is there any way I can get the full stack trace within the XQuery?

Use case: I would like to catch an exception, log that the exception occurred to a document within the database, then rethrow the exception. When I rethrow the exception, I want it to contain the original stack trace as part of the message, so I can send back more than the position of the error() function within the catch block.

Thanks,
-Efraim  
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Espen S. Ore | 20 Oct 14:36 2014
Picon
Picon

Looking for clues - jave errors

Hi,

I am searching through levels of errors, and it is possible that they 
may have occured as part of some misapplied system settings or even 
worse, centrally installed SELINUX-configurations. This is of course 
something I have to dig into on my own, but if this series of errors 
give any of you ideas you might be willing to share with me, I would 
appreciate it very much. This has been moved from one old (loosely 
organized) server to a new one, and I am feeling slightly flabbergasted. 
So any thoughts on where these errors may be generated? Java permissions 
outside exist? Something inside exist? (exist is called from a cocoon 
sitemap):

-------------
Oct 20, 2014 2:11:16 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [XQueryURLRewrite] in context with 
path [/exist] threw exception [An error occurred while processing 
request to /exist/rest/db/his/ibsen/drama/HG/HGht.xml: Error while 
serializing XML: ClientAbortException:  java.io.IOException] with root cause
javax.servlet.ServletException: Error while serializing XML: 
ClientAbortException:  java.io.IOException
	at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:227)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
....
--------------

Best regards,
Espen Ore
--

-- 
Espen S. Ore
Dept. of Linguistics and Scandinavian Studies
Unit for Digital Documentation
University of Oslo

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
pawelkat | 20 Oct 13:33 2014
Picon

Non-well-formed files upload behaviour

Dear eXistentialists,
My problem: In order to upload not well formed (x)html (or any
non-well-formed xml) I need to resort to xmldb:store-files-from-pattern.
I think it would be nice when Dashboard/eXide would allow to upload *any
file* by default with drag'n'drop. If the parsing exception occurs, the file
could be simply saved as a binary, so I could clean it later (eXist is a
really great tool for such a tasks, though) or leave it as is. 
I have temporarily modified the eXide/modules/upload.xql so that when the
exception is caught, the file is saved as 'text/plain)'. But would it be
nice to have a more general solution where mime-type is not changed? EXide
could indicate somehow which file was successfuly parsed.
This behavior could also help with storing non-well-formed html delivered
within frameworks like angular or polymer. I’m not really sure if we need to
have that files parsed at all. Here arises a problem with the correct
Content-Type of the response. Any thoughts about that? Maybe something like
introduction of the flag 'parsed/unparsed' on the file would be helpful.

--
View this message in context: http://exist.2174344.n4.nabble.com/Non-well-formed-files-upload-behaviour-tp4666078.html
Sent from the exist-open mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Jens Østergaard Petersen | 20 Oct 11:34 2014
Picon

Attribute ancestors

Hi,

Trying to write a function that gives me a model of what is where in a document, I started out with the following:

xquery version "3.0";

let $doc :=
<doc xml:id="x">
    <a>
        <b x="1">text<e>text</e>text</b>
        </a>
    <a>
        <c>
            <d y="2" z="3">text</d>
            </c>
    </a>
</doc>

return 
    let $paths :=
        for $node in ($doc//element(), $doc//attribute(), $doc//text())
        (:I would have thought that $doc//node() would do the job …:)
        let $path := 
            if ($node instance of attribute())
            then concat($node/string-join(ancestor-or-self::*/name(.), '/'), '/ <at> ', local-name($node))
            else
                if ($node instance of text())
                then concat($node/string-join(ancestor-or-self::*/name(.), '/'), '/text()')
                else $node/string-join(ancestor-or-self::*/name(.), '/')
        order by $path ascending
        return $path
    return distinct-values($paths)

Now, in Saxon, BaseX and Zorba this returns

doc/ <at> id
doc/a
doc/a/b
doc/a/b/ <at> x
doc/a/b/e
doc/a/b/e/text()
doc/a/b/text()
doc/a/c
doc/a/c/d
doc/a/c/d/ <at> y
doc/a/c/d/ <at> z
doc/a/c/d/text()

which is correct, but in eXist-db it returns

/ <at> id
doc/ <at> x
doc/a
doc/a/ <at> y
doc/a/b
doc/a/b/ <at> z
doc/a/b/e
doc/a/b/e/text()
doc/a/b/text()
doc/a/c
doc/a/c/d
doc/a/c/d/text()

messing up the position of the attributes.

If the line that constructs the attribute path is changed to

concat($node/../string-join(ancestor-or-self::*/name(.), '/'), '/ <at> ', local-name($node))

that is, if it ascends from the attribute to its parent element and then builds up the path, everything is OK in eXist-db, but one should be able to get the ancestors of an attribute without doing this, I think. And if this is neccesary for attribute nodes, why not for text nodes? Or am I doing something wrong?

Jens
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Birnbaum, David J | 18 Oct 22:13 2014
Picon

eXist and php

>Can you configure exist to work with php?  If so, how do you do it.  I'm
>trying to configure php with apache, but I'm failing miserably.  I could
>really use some assistance.

I use php to manage user input into a web form and craft it into a URL
that points to the eXist REST interface. The php script then collects
whatever eXist returns and shapes it into HTML for display. Example:

<?php
/* Check to see if the user submitted a word to search for.
 * If so, clean the input to strip out tags, fix html entities, etc
 */
  if (isset($_POST['form_element1'])) {
    $clean_name = htmlspecialchars(strip_tags($_POST['form_element1']));
    $clean_scope = $_POST['scope'];
  }
?>

<div class="message-text">
<?php
/* If there isn't a cleaned input string, print a header,
 * otherwise, display the search header and then continue.
 *
 * The items submitted via the form are stuffed into a URL that points to
an eXist script
 * that returns HTML-ified results.  Use file_get_contents to submit the
info and handle the results
 * via REST.  Echo those results back to the browser.
 */
	if (!$clean_name) {
		echo '<h2>Project title goes here</h2>';
	} else {
		echo 'Results for '. $clean_name;

		$url="http://localhost:8080/exist/rest/db/myProject/test.xql?word=$clean_
name&scope=$clean_scope";
		$contents=file_get_contents($url);
		echo "$contents";
	}
?>

Best,

David
djbpitt <at> gmail.com

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Henrik Frisk | 18 Oct 09:46 2014
Picon

XForms and select1 initial value

Hi,

I realize this is a bit off topic but I'm having difficulties understanding how to set a xf:select1 to a particular item in the drop down list as its initial value.  It appears i should use <xf:bind> but I fail to see how to get it to work.

Any pointers to documentation or similar would be appreciated!

/Henrik
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Martin Holmes | 17 Oct 22:55 2014
Picon
Picon

Access rest collection listing from inside XQuery

Hi there,

Is there any way I can access the collection listing:

<exist:result xmlns:exist="http://exist.sourceforge.net/NS/exist">
     <exist:collection name="/db/site/images" 
created="2013-12-08T20:46:59.398-08:00" owner="admin" group="dba" 
permissions="rwxrwxr-x">
         <exist:collection name="map" 
created="2013-12-08T20:46:59.399-08:00" owner="admin" group="dba" 
permissions="rwxr-xr-x"/>
...

which is accessible through the rest interface from within XQuery? I 
know I can retrieve it like this:

doc('http://mysite.org/rest/db/site/images/')

but I'd prefer not to have to reconstruct the full URL of the target 
collection, and keep it portable. If I know I want /db/site/images, but 
I don't necessarily know the host information, is there a way for my 
XQuery to retrieve the listing?

Cheers,
Martin

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Misztur, Chris | 17 Oct 22:18 2014

XQ3 JSON serializer

Is there a way to force the serializer to output a JSON array, even if the serialized XML contains a single element?

-c

________________________________

The contents of this message may be privileged and confidential. Therefore, if this message has been
received in error, please delete it without reading it. Your receipt of this message is not intended to
waive any applicable privilege. Please do not disseminate this message without the permission of the author.

Please consider the environment before printing this e-mail

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Stephen Barrett | 17 Oct 12:04 2014
Picon

Opening up/Securing eXist

Dear All,

Apologies for the rather basic, newbie question:

We're about to launch a website that runs from Apache and links to an eXist database. We have put in place a
proxy so that the standard eXist URL (with port 8080) is masked thus:

http://oursite/database 
points to
http://oursite:8080/exists/apps/database

When the link throught to eXist is selected, however, the system asks for authentication and we'd like the
database to be public. So, my newbie question is two-fold:

1) How do we remove the need for users to login to access the database we'd like to be public?
2) Once that's done, are there any extra steps we should take to ensure those nice public people can't access
anything they shouldn't (e.g. the Dashboard)?

Any help would be warmly appreciated.

Many thanks

Stephen Barrett

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Alexander Henket | 16 Oct 20:30 2014
Picon
Picon

Bug or feature in util:node-xpath()

Hi,

eXist-db 2.1. When you call util:node-xpath() on a path where siblings exist, the path returned doesn't give back the correct position of the node I requested it on. A little tester below. Bug or feature? I'm really hoping bug. If feature: is there a different function that gives the exact path?

let $x  := <A><B/><B/></A>
   
return
<xpath>
{
   
for $p in $x//*:B
   
return <path>{util:node-xpath($p)}</path>
}
</xpath>

Expected:
<xpath>
    <path>/A[1]/B[1]</path>
    <path>/A[1]/B[2]</path>
</xpath>

But got:
<xpath>
    <path>/A/B</path>
    <path>/A/B</path>
</xpath>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Ted Hickox | 16 Oct 18:22 2014
Picon

php and exist

Can you configure exist to work with php?  If so, how do you do it.  I'm trying to configure php with apache, but I'm failing miserably.  I could really use some assistance.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

Gmane