Dmitriy Shabanov | 1 Jul 2011 15:24
Picon
Gravatar

Re: Import paths and util:eval()



On Wed, Jun 29, 2011 at 9:03 PM, Efraim Feinstein <efraim.feinstein <at> gmail.com> wrote:
On 06/29/2011 11:30 AM, Dmitriy Shabanov wrote:
if you running script from db importing relative paths should be resolved correct, do you have problem or didn't try?

I tried three things:
1. run script from db using the REST interface: works

good
 
2. run script from the admin client: requires xmldb:exist:/// in the import path

script don't have location, relative urls will not work.
 
3. run script from the scheduler (off the db): requires xmldb:exist:/// in the import path

do you point scheduler to file or script is part of configuration?
 

--
Dmitriy Shabanov
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Dan McCreary | 1 Jul 2011 15:41
Picon

Setting initial permissions and group with the ant "store" task

Hi all,

I am writing ant tasks that load applications directly into the eXist
database from a file system.

I am using the ant "store" function documented here:

http://exist.sourceforge.net/ant-tasks.html#d4e447

Store works very well since it will recursively add all files and
sub-collections.  But I don't seem to see any options for setting the
group and permissions.

Is there any way to explicitly set the group and permissions during a
store?  Or do I have to load and run a separate recursive XQuery
script to set permissions after all files are loaded.

With all the great work going on in the EXPath area it seems that it
is now time to build some nice XRX App loaders and I would like to put
in some best practices for others to use.

Thanks! - Dan

--
Dan McCreary
Semantic Solutions Architect
office: (952) 931-9198
cell: (612) 986-1552

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Efraim Feinstein | 1 Jul 2011 15:59
Picon
Gravatar

Re: Import paths and util:eval()

Hi,

On 07/01/2011 09:24 AM, Dmitriy Shabanov wrote:

 
3. run script from the scheduler (off the db): requires xmldb:exist:/// in the import path

do you point scheduler to file or script is part of configuration?

It points to an xql stored in the database, which runs correctly as long as all imports (and imports of imports) specify the xmldb:exist:/// protocol in the path.


-- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Dave Finton | 1 Jul 2011 16:03
Picon

Re: Setting initial permissions and group with the ant "store" task

We ran into this problem a couple of weeks ago. The method I plan on using to deal with setting permissions is to run xmldb:chmod-resource after every xmldb:store on the file I just created on the fly.

On Fri, Jul 1, 2011 at 8:41 AM, Dan McCreary <dan.mccreary <at> gmail.com> wrote:
Hi all,

I am writing ant tasks that load applications directly into the eXist
database from a file system.

I am using the ant "store" function documented here:

http://exist.sourceforge.net/ant-tasks.html#d4e447

Store works very well since it will recursively add all files and
sub-collections.  But I don't seem to see any options for setting the
group and permissions.

Is there any way to explicitly set the group and permissions during a
store?  Or do I have to load and run a separate recursive XQuery
script to set permissions after all files are loaded.

With all the great work going on in the EXPath area it seems that it
is now time to build some nice XRX App loaders and I would like to put
in some best practices for others to use.

Thanks! - Dan

--
Dan McCreary
Semantic Solutions Architect
office: (952) 931-9198
cell: (612) 986-1552

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open



--
David Finton
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Dan McCreary | 1 Jul 2011 16:14
Picon

Re: Setting initial permissions and group with the ant "store" task

Hi Dave,

Thanks for the tip.

Just to clarify, after each ant "store" you run another ant task like
<xdb:xquery> that recursively changes all collections, sub-collections
and resources in your app to use the correct group and permission
settings?

Thanks! - Dan

On Fri, Jul 1, 2011 at 9:03 AM, Dave Finton <dave.finton <at> gmail.com> wrote:
> We ran into this problem a couple of weeks ago. The method I plan on using
> to deal with setting permissions is to run xmldb:chmod-resource after every
> xmldb:store on the file I just created on the fly.
>
> On Fri, Jul 1, 2011 at 8:41 AM, Dan McCreary <dan.mccreary <at> gmail.com> wrote:
>>
>> Hi all,
>>
>> I am writing ant tasks that load applications directly into the eXist
>> database from a file system.
>>
>> I am using the ant "store" function documented here:
>>
>> http://exist.sourceforge.net/ant-tasks.html#d4e447
>>
>> Store works very well since it will recursively add all files and
>> sub-collections.  But I don't seem to see any options for setting the
>> group and permissions.
>>
>> Is there any way to explicitly set the group and permissions during a
>> store?  Or do I have to load and run a separate recursive XQuery
>> script to set permissions after all files are loaded.
>>
>> With all the great work going on in the EXPath area it seems that it
>> is now time to build some nice XRX App loaders and I would like to put
>> in some best practices for others to use.
>>
>> Thanks! - Dan
>>
>> --
>> Dan McCreary
>> Semantic Solutions Architect
>> office: (952) 931-9198
>> cell: (612) 986-1552
>>
>>
>> ------------------------------------------------------------------------------
>> All of the data generated in your IT infrastructure is seriously valuable.
>> Why? It contains a definitive record of application performance, security
>> threats, fraudulent activity, and more. Splunk takes this data and makes
>> sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-d2d-c2
>> _______________________________________________
>> Exist-open mailing list
>> Exist-open <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>
>
> --
> David Finton
>

--

-- 
Dan McCreary
Semantic Solutions Architect
office: (952) 931-9198
cell: (612) 986-1552

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Dmitriy Shabanov | 1 Jul 2011 17:24
Picon
Gravatar

Re: Import paths and util:eval()


On Fri, Jul 1, 2011 at 6:59 PM, Efraim Feinstein <efraim.feinstein <at> gmail.com> wrote:
    On 07/01/2011 09:24 AM, Dmitriy Shabanov wrote:

 
3. run script from the scheduler (off the db): requires xmldb:exist:/// in the import path

do you point scheduler to file or script is part of configuration?

It points to an xql stored in the database, which runs correctly as long as all imports (and imports of imports) specify the xmldb:exist:/// protocol in the path.

Can you send me a test?

--
Dmitriy Shabanov
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Efraim Feinstein | 1 Jul 2011 17:52
Picon
Gravatar

Re: Import paths and util:eval()

On 07/01/2011 11:24 AM, Dmitriy Shabanov wrote:

On Fri, Jul 1, 2011 at 6:59 PM, Efraim Feinstein <efraim.feinstein <at> gmail.com> wrote:
    On 07/01/2011 09:24 AM, Dmitriy Shabanov wrote:

 
3. run script from the scheduler (off the db): requires xmldb:exist:/// in the import path

do you point scheduler to file or script is part of configuration?

It points to an xql stored in the database, which runs correctly as long as all imports (and imports of imports) specify the xmldb:exist:/// protocol in the path.

Can you send me a test?

1. put this module in the /db/xyz.xqm:
module namespace xyz="http://example.com/xyz";

declare function xyz:foo() {
util:log-system-out('In xyz foo')
};

2. put this in /db/abc.xql:
(: add xmldb:exist:// to at if you want this to work; db restart may be needed after changing it to clear the cache? :)
import module namespace xyz="http://example.com/xyz" at "/db/xyz.xqm";

xyz:foo()

2. put this in /db/run.xql
util:eval(xs:anyURI('/db/abc.xql'))

3. add to scheduler section of conf.xml:
<job type="user" name="xyz-runner" xquery="/db/run.xql" cron-trigger="0 0/1 * * * ?"/>

The job will fail silently.
Running abc.xql from REST works.
Running run.xql from REST results in an error indicating that the path is both being read incorrectly and that the filesystem is being used as the base instead of the database.

Thanks,

-- --- Efraim Feinstein Lead Developer Open Siddur Project http://opensiddur.net http://wiki.jewishliturgy.org
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Ted Hickox | 1 Jul 2011 21:24
Picon
Favicon

XML Schemas.

When I insert my xml schema and my xml instance document into the eXist database, how do I tell eXist to validate my xml instance.  The instructions on the website were rather confusing.  Is there a way to do it with xquery?  If so, how?
 
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Dan McCreary | 1 Jul 2011 21:39
Picon

Re: XML Schemas.

Hi Ted,

Try the following in the XQuery Wikibook:

http://en.wikibooks.org/wiki/XQuery/Validating_a_document

I know this is hard to find but you can also use the "Search This
Wikibook" menu on the left side of the Wikibook menu.

- Dan

On Fri, Jul 1, 2011 at 2:24 PM, Ted Hickox <megelinic <at> yahoo.com> wrote:
> When I insert my xml schema and my xml instance document into the eXist
> database, how do I tell eXist to validate my xml instance.  The instructions
> on the website were rather confusing.  Is there a way to do it with xquery?
> If so, how?
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Exist-open mailing list
> Exist-open <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>

--

-- 
Dan McCreary
Semantic Solutions Architect
office: (952) 931-9198
cell: (612) 986-1552

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Ralf Jung | 1 Jul 2011 22:27
Picon
Picon

Re: XML Schemas.

Hi Ted,

the "common" way to do XMLSchema validation (as far as I know) is to enable 
validaton in a collection configuration by putting this into the 
collection.xconf file:
<collection xmlns="http://exist-db.org/collection-config/1.0">
    <validation mode="yes"/>
</collection>
And then adding the schema files to the catalogue (which usually sits in 
$EXIST_HOME/webapp/WEB-INF/catalog.xml). This lets the database automatically 
validate all files as they are stored (and maybe also for XUpdates, not sure).

Kind regards,
Ralf

Am Freitag 01 Juli 2011, um 21:24:39 schrieb Ted Hickox:
> When I insert my xml schema and my xml instance document into the eXist
> database, how do I tell eXist to validate my xml instance.  The
> instructions on the website were rather confusing.  Is there a way to do
> it with xquery?  If so, how?

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2

Gmane