300 moves to do

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

300 moves to do

AlexandreP

Hi all,

         I want to moves my old files in my exist base.

         So I made a query:

                   for $ref in collection('/db/sandre/ogres/demande/')/Demande[StDemande='Annulé' or StDemande='Publié']

where days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation))>90

order by days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation)) descending

return base-uri($ref)

 

it returns :

/db/sandre/ogres/demande/PAR/20070912T135152.xml

/db/sandre/ogres/demande/PAR/20070912T134554.xml

/db/sandre/ogres/demande/PAR/20070912T140144.xml

/db/sandre/ogres/demande/INT/20070927T142634.xml

/db/sandre/ogres/demande/INT/20070927T144108.xml

/db/sandre/ogres/demande/MET/20070926T152946.xml

/db/sandre/ogres/demande/URF/20070927T083152.xml

                   …

         I want to moves them to /db/sandre/ogres/archive. Ex:

/db/sandre/ogres/demande/PAR/20070912T135152.xml à/db/sandre/ogres/archive/PAR/20070912T135152.xml

/db/sandre/ogres/demande/PAR/20070912T134554.xml à/db/sandre/ogres/archive/PAR/20070912T134554.xml

/db/sandre/ogres/demande/PAR/20070912T140144.xml à/db/sandre/ogres/archive/PAR/20070912T140144.xml

/db/sandre/ogres/demande/INT/20070927T142634.xml à/db/sandre/ogres/archive/INT/20070927T142634.xml

/db/sandre/ogres/demande/INT/20070927T144108.xml à/db/sandre/ogres/archive/INT/20070927T144108.xml

/db/sandre/ogres/demande/MET/20070926T152946.xml à/db/sandre/ogres/archive/MET/20070926T152946.xml

/db/sandre/ogres/demande/URF/20070927T083152.xml à/db/sandre/ogres/archive/URF/20070927T083152.xml

        

I found this command : move

         xmldb:move("/db/sandre/ogres/demande/MET/","/db/sandre/ogres/archive/MET/","20070912T135152.xml")

It works fine under the client eXist but you can only move one file; it doesn't works with more than one.

 

So I tried to make a file with this queries :

                  xmldb:move("/db/sandre/ogres/demande/MET/","/db/sandre/ogres/archive/MET/","20070912T135152.xml")

xmldb:move("/db/sandre/ogres/demande/MET/","/db/sandre/ogres/archive/MET/","20070912T134554.xml")

         But I can't execute it like this : bin/client.sh -F samples/xquery/fibo.xq because I have an eXist database embedded in OPS.

 

            How can Ido this, please? (with an xpl file?)

 

 

        

 

Thanks,

 

Alex P.

 



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 300 moves to do

Alessandro Vernet
Administrator
Alex,

On Jan 14, 2008 6:08 AM, a.piaser <[hidden email]> wrote:
> It works fine under the client eXist but you can only move one file; it
> doesn't works with more than one.
> [...]
>          But I can't execute it like this : bin/client.sh -F
> samples/xquery/fibo.xq because I have an eXist database embedded in OPS.

I don't quite get it: you are able to access the database with the
eXist client, aren't you? And client.sh is running the eXist client,
so you should be fine. Or are you having a problem when you run the
eXist client one the command line versus with the graphical UI?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: 300 moves to do

AlexandreP
Alex,

I have installed apache and ops.war. I don't have client.sh or client.bat.
I access my database with the exist client but I start it with exist.jnlp.
So I don't know how to execute my xq file.
Is there an other solution to do 300 moves ?

Thanks,

Alex P.


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Alessandro Vernet
Envoyé : mardi 15 janvier 2008 03:42
À : [hidden email]
Objet : Re: [ops-users] 300 moves to do

Alex,

On Jan 14, 2008 6:08 AM, a.piaser <[hidden email]> wrote:
> It works fine under the client eXist but you can only move one file; it
> doesn't works with more than one.
> [...]
>          But I can't execute it like this : bin/client.sh -F
> samples/xquery/fibo.xq because I have an eXist database embedded in OPS.

I don't quite get it: you are able to access the database with the
eXist client, aren't you? And client.sh is running the eXist client,
so you should be fine. Or are you having a problem when you run the
eXist client one the command line versus with the graphical UI?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 300 moves to do

Alessandro Vernet
Administrator
Alex,

On Jan 14, 2008 11:55 PM, a.piaser <[hidden email]> wrote:
> I have installed apache and ops.war. I don't have client.sh or client.bat.
> I access my database with the exist client but I start it with exist.jnlp.
> So I don't know how to execute my xq file.
> Is there an other solution to do 300 moves ?

You could do the whole thing in XQuery. At each step of the loop,
instead of doing return base-uri($ref), you do return xmldb:move(...).
And inside the "..." you will need to have code that does some string
manipulation on that base-uri($ref). Would this make sense?

Otherwise, if you want to run things from the command line, you can
download one of the latest builds of eXist
(http://www.exist-db.nl/files/exist-db_preview.html) and you should be
able to access the eXist in Orbeon Forms using that version of eXist.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: 300 moves to do

AlexandreP
Hi Alex,

You are right : it was easy.
I start with xquery and I thought it was not possible as it.
So I make like this :

for $ref in collection('/db/sandre/ogres/demande/')/Demande[StDemande='Annulé' or StDemande='Publié']
where days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation))>90
order by days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation)) descending
return xmldb:move(substring(base-uri($ref),1,29),replace(substring(base-uri($ref),1,29),'demande','archive'),substring(base-uri($ref),30))

Thanks for your help,

Alex P.


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Alessandro Vernet
Envoyé : mercredi 16 janvier 2008 04:31
À : [hidden email]
Objet : Re: [ops-users] 300 moves to do

Alex,

On Jan 14, 2008 11:55 PM, a.piaser <[hidden email]> wrote:
> I have installed apache and ops.war. I don't have client.sh or client.bat.
> I access my database with the exist client but I start it with exist.jnlp.
> So I don't know how to execute my xq file.
> Is there an other solution to do 300 moves ?

You could do the whole thing in XQuery. At each step of the loop,
instead of doing return base-uri($ref), you do return xmldb:move(...).
And inside the "..." you will need to have code that does some string
manipulation on that base-uri($ref). Would this make sense?

Otherwise, if you want to run things from the command line, you can
download one of the latest builds of eXist
(http://www.exist-db.nl/files/exist-db_preview.html) and you should be
able to access the eXist in Orbeon Forms using that version of eXist.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 300 moves to do

Alessandro Vernet
Administrator
On Jan 16, 2008 12:35 AM, Alexandre PIASER <[hidden email]> wrote:

> Hi Alex,
>
> You are right : it was easy.
> I start with xquery and I thought it was not possible as it.
> So I make like this :
>
> for $ref in collection('/db/sandre/ogres/demande/')/Demande[StDemande='Annulé' or StDemande='Publié']
> where days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation))>90
> order by days-from-duration(current-dateTime()- xs:dateTime($ref/DateCreation)) descending
> return xmldb:move(substring(base-uri($ref),1,29),replace(substring(base-uri($ref),1,29),'demande','archive'),substring(base-uri($ref),30))
Great. And thank you for sharing with us the working XQuery.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws