RE: [MarkLogic Dev General] Bug in XCC - loneattributesreportingaselements.

2010-03-02 Thread Geert Josten
Hi David,

> Streamed has nothing to do with it.  Its possible to stream
> XDM (just not using any publicly defined standards, but the
> XCC protocol is proprietary).

I only meant that it seems obvious that they have chosen to (more or less) 
reuse the same streaming strategy for XDBC AppServers as used for HTTP 
AppServers..

Kind regards,
Geert


drs. G.P.H. (Geert) Josten
Consultant


Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:geert.jos...@daidalos.nl
http://www.daidalos.nl/

KvK 27164984

P Please consider the environment before printing this mail.
De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Florent Georges
Geert Josten wrote:

  Hi,

> - Run the install.xqy (which could be a nice web-app if you are
>   willing to take the effort, allowing any options you like)

  That's a very interesting idea.  I am working on a standard web
app container, and I have always been dissatisfied with existing
packaging solutions (e.g. the Java WAR stuff).  A WAR allows to
have static install config in the package itself, but there is no
standard way of setting them interactively at deployment time.
The usual way is to write a specific wizard which is displayed
the first time a web app is run, but it would be nice to support
it directly in the package format...

  Good idea :-)

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/




___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] Bug in XCC - lone attributesreportingas elements.

2010-03-02 Thread Florent Georges
Geert Josten wrote:

  Hi,

> But indeed it would be better if it were capable of returning the
> xquery results with their actual types, rather than streamed.  It
> would open interesting possibilities!

  More fundamentaly, the XQuery spec says that the result of an
expression is an XDM instance.  The spec does not precise how an
XDM instance should be represented in Java, so here common sense is
the rule (for the right definition of "common sense", there can be
a lot of different PoV there).  But that sounds weird to exclude
arbitrarily attribute nodes.

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/




___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


[MarkLogic Dev General] unsubscribe

2010-03-02 Thread Rakesh rao
Please unsubscribe me from the list.

Thanks,
Rao

On Tue, Mar 2, 2010 at 2:00 PM, wrote:

> Send General mailing list submissions to
>general@developer.marklogic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>http://xqzone.com/mailman/listinfo/general
> or, via email, send a message with subject or body 'help' to
>general-requ...@developer.marklogic.com
>
> You can reach the person managing the list at
>general-ow...@developer.marklogic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of General digest..."
>
>
> Today's Topics:
>
>   1. RE: user installation using a query (Lee, David)
>
>
> --
>
> Message: 1
> Date: Tue, 2 Mar 2010 11:08:49 -0800
> From: "Lee, David" 
> Subject: RE: [MarkLogic Dev General] user installation using a query
> To: "General Mark Logic Developer Discussion"
>
> Message-ID: 
> Content-Type: text/plain;   charset="us-ascii"
>
> -- Quote ->
> Ok this sounds good - so assuming the initial configuration is in a
> file called "setup.xqy" could you provide and example of how would the
> user run it using xmlsh?
> <--
>
> If all you need to do is post a single xquery file then using curl on
> your CD would probably be easiset.
> Where something like xmlsh benifits is if you have to do more then that,
> such as was mentioned in a previous post about dynamically creating the
> configuration data using xslt or xquery then invoking dynamic queries to
> the ML server.
> xmlsh provides full cross-platform scripting of most major XML tools as
> well as integration in the shell of XDM types directly so scripting this
> sort of thing is exactly what its good at.
>
> To answer your question.
> Presuming you have a CD with all the prerequisits for xmlsh (essentially
> the Java runtime if it doesnt exist, plus the xmlsh runtime plus the ML
> extension).   And you have a simple file like setup.xqy
>
> You would make an xmlsh script file like this
>
> install.xsh
> -
> import module ml=marklogic
> MLCONNECT=xcc://...connection string
> ml:query -f setup.xqy
> 
>
> Then run this in your .bat or .sh file as
>
> xmlsh install.xsh
>
>
>
>
>
>
>
>
> -Original Message-
> From: general-boun...@developer.marklogic.com
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Andrew
> Welch
> Sent: Tuesday, March 02, 2010 1:17 PM
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] user installation using a query
>
> On 2 March 2010 18:04, Lee, David  wrote:
> > You might want to consider the MarkLogic extension to xmlsh which
> > provides cross-platform access to xml processing and sending requests
> > via either HTTP or XCC.
> > This is all "100% pure java" so the scripting, and the execution will
> > run identically independent of the OS.
> > (windows, linux/unix , mac ... anything with a Java 1.6 ).
> > And since it can execute ad-hoc queries constructed dynamnically it
> > doesn't rely on "/use-cases/eval2.xqy" pre-existing.
> >
> > This way you don't have to write separate .BAT and .sh files for
> > different OS's or depend on installations of additional 3rd party
> tools
> > (like curl, perl, etc).
> >
> > http://www.xmlsh.org
>
> Ok this sounds good - so assuming the initial configuration is in a
> file called "setup.xqy" could you provide and example of how would the
> user run it using xmlsh?
>
> Fwiw, curl doesn't need installing, it would just need to be on the
> disc, so the user could just run "install.bat" and that would be it
> (providing the query it curls to eval2.xqy runs without a problem)
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
>
> --
>
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 69, Issue 10
> ***
>
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


RE: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Lee, David
-- Quote ->
Ok this sounds good - so assuming the initial configuration is in a
file called "setup.xqy" could you provide and example of how would the
user run it using xmlsh?
<--

If all you need to do is post a single xquery file then using curl on
your CD would probably be easiset.
Where something like xmlsh benifits is if you have to do more then that,
such as was mentioned in a previous post about dynamically creating the
configuration data using xslt or xquery then invoking dynamic queries to
the ML server.
xmlsh provides full cross-platform scripting of most major XML tools as
well as integration in the shell of XDM types directly so scripting this
sort of thing is exactly what its good at.

To answer your question.
Presuming you have a CD with all the prerequisits for xmlsh (essentially
the Java runtime if it doesnt exist, plus the xmlsh runtime plus the ML
extension).   And you have a simple file like setup.xqy

You would make an xmlsh script file like this

install.xsh
-
import module ml=marklogic 
MLCONNECT=xcc://...connection string
ml:query -f setup.xqy 


Then run this in your .bat or .sh file as

xmlsh install.xsh


 





-Original Message-
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andrew
Welch
Sent: Tuesday, March 02, 2010 1:17 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] user installation using a query

On 2 March 2010 18:04, Lee, David  wrote:
> You might want to consider the MarkLogic extension to xmlsh which
> provides cross-platform access to xml processing and sending requests
> via either HTTP or XCC.
> This is all "100% pure java" so the scripting, and the execution will
> run identically independent of the OS.
> (windows, linux/unix , mac ... anything with a Java 1.6 ).
> And since it can execute ad-hoc queries constructed dynamnically it
> doesn't rely on "/use-cases/eval2.xqy" pre-existing.
>
> This way you don't have to write separate .BAT and .sh files for
> different OS's or depend on installations of additional 3rd party
tools
> (like curl, perl, etc).
>
> http://www.xmlsh.org

Ok this sounds good - so assuming the initial configuration is in a
file called "setup.xqy" could you provide and example of how would the
user run it using xmlsh?

Fwiw, curl doesn't need installing, it would just need to be on the
disc, so the user could just run "install.bat" and that would be it
(providing the query it curls to eval2.xqy runs without a problem)


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


RE: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Geert Josten
Hi Andrew,

Dropping in on this thread only now. The curl, wget, xmlsh, whatever options 
are nice if already available. Which of those you will use is most likely a 
matter of personal taste or whether one of those is already available to you.

But I personally think that the most ideal case is where you can manage with 
MarkLogic Server alone. The install.xqy approach is véry straight-forward, no 
hassle at all, though my install.xqy is typically a small web-app. I have 
employed it in most of the projects I have done so far with MarkLogic Server, 
and my experience is that Systems administrators can work well with that method.

The general procedure I prescribe is:

- Fetch the latest release package (zip, gz, whatever)
- Unpack and drop at some appropriate place at the server
- Go to MarkLogic Server Admin interface
- Do a one-time creation of an App Server pointing to that folder on the 
file-system, attaching it to some admin user
- Run the install.xqy (which could be a nice web-app if you are willing to take 
the effort, allowing any options you like)
- Disable the App Server untill deployment of next release

The installer web-app could provide just one button 'do it all', but you can 
also provide a few text fields to enter unique names for databases, app 
servers, users accounts, etc. Systems administrators really like to have the 
ability to manage things a bit. But instead of writing lengthy guides how to do 
that with the full-blown Admin interface, you just provide what they need.

Moreover, you could create different manager roles, unlocking different groups 
of tasks. And since MarkLogic Server can unzip as well, you could also make in 
installer web-app in which you upload a release package and have it extracted 
and deployed for you.

And yes, there is pretty much hardly anything you can't do from xquery directly 
with a few calls, that you can do from the Admin interface manually. :-)

Kind regards,
Geert

>


drs. G.P.H. (Geert) Josten
Consultant


Daidalos BV
Hoekeindsehof 1-4
2665 JZ Bleiswijk

T +31 (0)10 850 1200
F +31 (0)10 850 1199

mailto:geert.jos...@daidalos.nl
http://www.daidalos.nl/

KvK 27164984

P Please consider the environment before printing this mail.
De informatie - verzonden in of met dit e-mailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

> From: general-boun...@developer.marklogic.com
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of
> Andrew Welch
> Sent: dinsdag 2 maart 2010 19:17
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] user installation using a query
>
> On 2 March 2010 18:04, Lee, David  wrote:
> > You might want to consider the MarkLogic extension to xmlsh which
> > provides cross-platform access to xml processing and
> sending requests
> > via either HTTP or XCC.
> > This is all "100% pure java" so the scripting, and the
> execution will
> > run identically independent of the OS.
> > (windows, linux/unix , mac ... anything with a Java 1.6 ).
> > And since it can execute ad-hoc queries constructed dynamnically it
> > doesn't rely on "/use-cases/eval2.xqy" pre-existing.
> >
> > This way you don't have to write separate .BAT and .sh files for
> > different OS's or depend on installations of additional 3rd party
> > tools (like curl, perl, etc).
> >
> > http://www.xmlsh.org
>
> Ok this sounds good - so assuming the initial configuration
> is in a file called "setup.xqy" could you provide and example
> of how would the user run it using xmlsh?
>
> Fwiw, curl doesn't need installing, it would just need to be
> on the disc, so the user could just run "install.bat" and
> that would be it (providing the query it curls to eval2.xqy
> runs without a problem)
>
>
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Karl Erisman
Eric,

The procedure you describe sounds close to what I've been imagining.
If you get a chance, I would be interested in any other details you
care to provide (what you do to work around the server restarting,
which default dbs/forests/servers you wipe out, etc.).

Karl

On Tue, Mar 2, 2010 at 11:54 AM, Eric Bloch  wrote:
> Here's what we do in markmail to add a new node.  We use puppet to drive, but 
> you could do this in a scripting language and/or installer tool of your 
> choice.
>
> 0) checkout (svn co) our application code on to the box
> 1) copy marklogic rpm  to the box and install
> 2) wget a few URLs within the ML Admin app to do a few things, including 
> install our license
> 3) copy a setup-markmail.xqy script to the Admin app filesystem
> 4) wget the url of the setup script
> * this script wipes out default dbs, forests, and app servers we don't want
> * set up app-servers, dbs, forests,  index settings, and the like.
> * setup security users, roles, amps, etc...
>
> If you're interested in details, I can share more.  It's a little tricky as 
> some of the admin ops result in the server restarting.
>
> -Eric
>
> 
> From: general-boun...@developer.marklogic.com 
> [general-boun...@developer.marklogic.com] On Behalf Of Karl Erisman 
> [karl.eris...@gmail.com]
> Sent: Tuesday, March 02, 2010 9:35 AM
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] user installation using a query
>
> If your customer does not yet have MarkLogic installed, they'll have
> to use the administrative interface to configure MarkLogic itself, so
> the procedure you've outlined seems straightforward enough as long as
> your install.xqy itself is "user-friendly" (which should probably mean
> that it presents a simple interface, does not ask questions that are
> excessively technical, and shows clear confirmation or error messages
> based on what happens).
>
> I've been wondering about a broader, but closely-related topic:
> release management of production MarkLogic applications in general.
> How do others package code for system admins (customers themselves in
> Andrew's case; but probably developers or an internal team of
> specialists at most organizations) to deploy?  This applies to new
> releases or upgrades.
>
> Do you create, for each version of your application, an XQuery install
> script (much like the one Andrew plans to use) that performs steps
> such as manipulation of app servers, databases, etc. to bring the
> configuration up to date with respect to source code changes?  Any
> other hints on streamlining the process?
>
> Karl
>
> On Tue, Mar 2, 2010 at 10:41 AM, Andrew Welch  
> wrote:
>> Hi,
>>
>> It seems that everything you can do through the admin screen you can
>> do through a query... so rather give the customer a list of steps to
>> follow (create http server, create webdav server etc), I can shield
>> them from the admin screens and give them a query to run instead.
>>
>> The question is, what is the user-friendliest way for them to run that
>> xquery, when the person installing the application is likely to know
>> very little about MarkLogic?
>>
>> Is using the Docs dir the best way:
>>
>> 1) Install MarkLogic
>> 2) copy the "install.xqy" to [install dir]/Docs
>> 2) navigate to [hostname]:8000/install.xqy
>>
>> ...or is there another way?
>>
>>
>>
>> thanks
>> --
>> Andrew Welch
>> http://andrewjwelch.com
>> Kernow: http://kernowforsaxon.sf.net/
>> ___
>> General mailing list
>> General@developer.marklogic.com
>> http://xqzone.com/mailman/listinfo/general
>>
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Andrew Welch
On 2 March 2010 18:04, Lee, David  wrote:
> You might want to consider the MarkLogic extension to xmlsh which
> provides cross-platform access to xml processing and sending requests
> via either HTTP or XCC.
> This is all "100% pure java" so the scripting, and the execution will
> run identically independent of the OS.
> (windows, linux/unix , mac ... anything with a Java 1.6 ).
> And since it can execute ad-hoc queries constructed dynamnically it
> doesn't rely on "/use-cases/eval2.xqy" pre-existing.
>
> This way you don't have to write separate .BAT and .sh files for
> different OS's or depend on installations of additional 3rd party tools
> (like curl, perl, etc).
>
> http://www.xmlsh.org

Ok this sounds good - so assuming the initial configuration is in a
file called "setup.xqy" could you provide and example of how would the
user run it using xmlsh?

Fwiw, curl doesn't need installing, it would just need to be on the
disc, so the user could just run "install.bat" and that would be it
(providing the query it curls to eval2.xqy runs without a problem)


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


RE: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Lee, David
You might want to consider the MarkLogic extension to xmlsh which
provides cross-platform access to xml processing and sending requests
via either HTTP or XCC.
This is all "100% pure java" so the scripting, and the execution will
run identically independent of the OS.
(windows, linux/unix , mac ... anything with a Java 1.6 ).
And since it can execute ad-hoc queries constructed dynamnically it
doesn't rely on "/use-cases/eval2.xqy" pre-existing.

This way you don't have to write separate .BAT and .sh files for
different OS's or depend on installations of additional 3rd party tools
(like curl, perl, etc).

http://www.xmlsh.org


-David Lee


-Original Message-
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andrew
Welch
Sent: Tuesday, March 02, 2010 12:59 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] user installation using a query

On 2 March 2010 17:53, G. Ken Holman 
wrote:
> At 2010-03-02 16:41 +, Andrew Welch wrote:
>>
>> Hi,
>>
>> It seems that everything you can do through the admin screen you can
>> do through a query... so rather give the customer a list of steps to
>> follow (create http server, create webdav server etc), I can shield
>> them from the admin screens and give them a query to run instead.
>>
>> The question is, what is the user-friendliest way for them to run
that
>> xquery, when the person installing the application is likely to know
>> very little about MarkLogic?
>>
>> Is using the Docs dir the best way:
>>
>> 1) Install MarkLogic
>> 2) copy the "install.xqy" to [install dir]/Docs
>> 2) navigate to [hostname]:8000/install.xqy
>>
>> ...or is there another way?
>
> In the classroom I use "curl" to submit a composed query to
> "/use-cases/eval2.xqy", taking advantage of the ";" extension in
"1.0-ml" to
> put multiple independent queries in the single submitted file.
>
> I compose the query using XSLT and command-line arguments,
synthesizing the
> required load scripts by reading the contents of my exercise
directories,
> producing the composed query that is then submitted to the server.
>
> Students merely install Mark Logic and then run the loading
environment
> batch file in a very turnkey fashion.
>
> It does, however, expose the administration username and password in
the
> synthesized batch file that invokes curl ... so it isn't a production
> approach.
>
> This was a very helpful suggestion from one of my students.

ahh great, thanks Ken.   I'm familiar with curl... that looks like the
answer (along with a .bat as its windows)

thanks
andrew



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread G. Ken Holman

At 2010-03-02 17:58 +, you wrote:

On 2 March 2010 17:53, G. Ken Holman  wrote:
> In the classroom I use "curl" to submit a composed query to
> "/use-cases/eval2.xqy", taking advantage of the ";" extension in 
"1.0-ml" to

> put multiple independent queries in the single submitted file.
>
> I compose the query using XSLT and command-line arguments, synthesizing the
> required load scripts by reading the contents of my exercise directories,
> producing the composed query that is then submitted to the server.
>
> Students merely install Mark Logic and then run the loading environment
> batch file in a very turnkey fashion.
>
> It does, however, expose the administration username and password in the
> synthesized batch file that invokes curl ... so it isn't a production
> approach.
>
> This was a very helpful suggestion from one of my students.

ahh great, thanks Ken.   I'm familiar with curl... that looks like the
answer (along with a .bat as its windows)


Eric makes a good point, though, about server restarts.  What I do 
can be finicky.  There are times when I have to ask the students to 
run the load script a second time because one of the steps in the 
first invocation is either too early or too late and doesn't get recognized.


So it isn't fool-proof ... I'm quite the fool to prove that.  I'm 
very interested to hear of your progress.


. . . . . . . . . . . Ken


--
XSLT/XQuery training:  after http://XMLPrague.cz 2010-03-15/19
XSLT/XQuery training: San Carlos, California 2010-04-26/30
Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03
XSLT/XQuery training: Ottawa, Canada 2010-05-10/14
XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11
Vote for your XML training:   http://www.CraneSoftwrights.com/q/i/
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/q/
G. Ken Holman mailto:gkhol...@cranesoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/q/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Andrew Welch
On 2 March 2010 17:53, G. Ken Holman  wrote:
> At 2010-03-02 16:41 +, Andrew Welch wrote:
>>
>> Hi,
>>
>> It seems that everything you can do through the admin screen you can
>> do through a query... so rather give the customer a list of steps to
>> follow (create http server, create webdav server etc), I can shield
>> them from the admin screens and give them a query to run instead.
>>
>> The question is, what is the user-friendliest way for them to run that
>> xquery, when the person installing the application is likely to know
>> very little about MarkLogic?
>>
>> Is using the Docs dir the best way:
>>
>> 1) Install MarkLogic
>> 2) copy the "install.xqy" to [install dir]/Docs
>> 2) navigate to [hostname]:8000/install.xqy
>>
>> ...or is there another way?
>
> In the classroom I use "curl" to submit a composed query to
> "/use-cases/eval2.xqy", taking advantage of the ";" extension in "1.0-ml" to
> put multiple independent queries in the single submitted file.
>
> I compose the query using XSLT and command-line arguments, synthesizing the
> required load scripts by reading the contents of my exercise directories,
> producing the composed query that is then submitted to the server.
>
> Students merely install Mark Logic and then run the loading environment
> batch file in a very turnkey fashion.
>
> It does, however, expose the administration username and password in the
> synthesized batch file that invokes curl ... so it isn't a production
> approach.
>
> This was a very helpful suggestion from one of my students.

ahh great, thanks Ken.   I'm familiar with curl... that looks like the
answer (along with a .bat as its windows)

thanks
andrew



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


RE: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Eric Bloch
Here's what we do in markmail to add a new node.  We use puppet to drive, but 
you could do this in a scripting language and/or installer tool of your choice. 
 

0) checkout (svn co) our application code on to the box
1) copy marklogic rpm  to the box and install 
2) wget a few URLs within the ML Admin app to do a few things, including 
install our license
3) copy a setup-markmail.xqy script to the Admin app filesystem
4) wget the url of the setup script
* this script wipes out default dbs, forests, and app servers we don't want
* set up app-servers, dbs, forests,  index settings, and the like.
* setup security users, roles, amps, etc...

If you're interested in details, I can share more.  It's a little tricky as 
some of the admin ops result in the server restarting.

-Eric


From: general-boun...@developer.marklogic.com 
[general-boun...@developer.marklogic.com] On Behalf Of Karl Erisman 
[karl.eris...@gmail.com]
Sent: Tuesday, March 02, 2010 9:35 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] user installation using a query

If your customer does not yet have MarkLogic installed, they'll have
to use the administrative interface to configure MarkLogic itself, so
the procedure you've outlined seems straightforward enough as long as
your install.xqy itself is "user-friendly" (which should probably mean
that it presents a simple interface, does not ask questions that are
excessively technical, and shows clear confirmation or error messages
based on what happens).

I've been wondering about a broader, but closely-related topic:
release management of production MarkLogic applications in general.
How do others package code for system admins (customers themselves in
Andrew's case; but probably developers or an internal team of
specialists at most organizations) to deploy?  This applies to new
releases or upgrades.

Do you create, for each version of your application, an XQuery install
script (much like the one Andrew plans to use) that performs steps
such as manipulation of app servers, databases, etc. to bring the
configuration up to date with respect to source code changes?  Any
other hints on streamlining the process?

Karl

On Tue, Mar 2, 2010 at 10:41 AM, Andrew Welch  wrote:
> Hi,
>
> It seems that everything you can do through the admin screen you can
> do through a query... so rather give the customer a list of steps to
> follow (create http server, create webdav server etc), I can shield
> them from the admin screens and give them a query to run instead.
>
> The question is, what is the user-friendliest way for them to run that
> xquery, when the person installing the application is likely to know
> very little about MarkLogic?
>
> Is using the Docs dir the best way:
>
> 1) Install MarkLogic
> 2) copy the "install.xqy" to [install dir]/Docs
> 2) navigate to [hostname]:8000/install.xqy
>
> ...or is there another way?
>
>
>
> thanks
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Andrew Welch
Thanks Ruth, that's very helpful.

Other than "copy and paste it into CQ", what other ways are there to run it?

In this case we have to deliver the app on a CD, so that the disc can
be given to the deployment team for a trusted internal employee to
install (not an untrusted outsider :).  After installing MarkLogic,
they will need to install the app... At the moment the process looks
like it will be:

1. run a query that creates the forest, database, http, xdbc and
webdav servers (how to run this initial query? Use CQ, or copy it the
to docs folder etc?)
2. using the webdav servers (db and modules), unzip the code and the
initial database structure
3. navigate to the app and run the remaining setup (adding
collections, triggers, permissions etc)

That seems reasonable to me, it's just that first step.. cutting and
pasting into CQ isn't the best, copying the file to the docs folder
and hitting that url is a little better imho, but is there another
way?

cheers
andrew


On 2 March 2010 17:28, Ruth Stryker  wrote:
> Perhaps not exactly what you're looking for, but possibly useful, the script 
> below creates a forest, creates a database, attaches the forest to the 
> database, and sets up an http app server.
>
> One way to use it is to copy and paste it into CQ, edit the forest name, edit 
> the database name, edit the http app server name, edit the port number, edit 
> the directory path, press XML to execute the code, and then see that they 
> were all set up by going into the Admin Interface (if desired).
>
> ---
>
>
> (: forest :)
>
> xquery version "1.0-ml";
>
> import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
> "/MarkLogic/admin.xqy";
>
> let $config := admin:get-configuration()
>
> let $config := admin:forest-create(
>  $config,
>  "playground",
>  xdmp:host(),
>  ())
>
> return admin:save-configuration($config);
>
>
>
>
> (: database :)
>
> xquery version "1.0-ml";
>
> import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
> "/MarkLogic/admin.xqy";
>
> let $config := admin:get-configuration()
>
> let $config := admin:database-create(
>  $config,
>  "playground",
>  xdmp:database("Security"),
>  xdmp:database("Schemas"))
>
> return admin:save-configuration($config);
>
>
>
>
> (: attach forest to database :)
>
>
> xquery version "1.0-ml";
>
> import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
> "/MarkLogic/admin.xqy";
>
> let $config := admin:get-configuration()
>
> let $config := admin:database-attach-forest(
>  $config,
>  xdmp:database("playground"),
>  xdmp:forest("playground"))
>
> return admin:save-configuration($config);
>
>
>
> (: application server :)
>
> xquery version "1.0-ml";
>
> import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
> "/MarkLogic/admin.xqy";
>
> let $config := admin:get-configuration()
>
> let $groupid := admin:group-get-id($config, "Default")
>
> let $server := admin:http-server-create(
>  $config,
>  $groupid,
>  "8041-playground",
>  "C:\mls-projects\playground",
>  8041,
>  0,
>  admin:database-get-id($config, "playground"))
>
> return admin:save-configuration($server)
>
>
>
> -Original Message-
> From: general-boun...@developer.marklogic.com 
> [mailto:general-boun...@developer.marklogic.com] On Behalf Of Andrew Welch
> Sent: Tuesday, March 02, 2010 8:42 AM
> To: General Mark Logic Developer Discussion
> Subject: [MarkLogic Dev General] user installation using a query
>
> Hi,
>
> It seems that everything you can do through the admin screen you can
> do through a query... so rather give the customer a list of steps to
> follow (create http server, create webdav server etc), I can shield
> them from the admin screens and give them a query to run instead.
>
> The question is, what is the user-friendliest way for them to run that
> xquery, when the person installing the application is likely to know
> very little about MarkLogic?
>
> Is using the Docs dir the best way:
>
> 1) Install MarkLogic
> 2) copy the "install.xqy" to [install dir]/Docs
> 2) navigate to [hostname]:8000/install.xqy
>
> ...or is there another way?
>
>
>
> thanks
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread G. Ken Holman

At 2010-03-02 16:41 +, Andrew Welch wrote:

Hi,

It seems that everything you can do through the admin screen you can
do through a query... so rather give the customer a list of steps to
follow (create http server, create webdav server etc), I can shield
them from the admin screens and give them a query to run instead.

The question is, what is the user-friendliest way for them to run that
xquery, when the person installing the application is likely to know
very little about MarkLogic?

Is using the Docs dir the best way:

1) Install MarkLogic
2) copy the "install.xqy" to [install dir]/Docs
2) navigate to [hostname]:8000/install.xqy

...or is there another way?


In the classroom I use "curl" to submit a composed query to 
"/use-cases/eval2.xqy", taking advantage of the ";" extension in 
"1.0-ml" to put multiple independent queries in the single submitted file.


I compose the query using XSLT and command-line arguments, 
synthesizing the required load scripts by reading the contents of my 
exercise directories, producing the composed query that is then 
submitted to the server.


Students merely install Mark Logic and then run the loading 
environment batch file in a very turnkey fashion.


It does, however, expose the administration username and password in 
the synthesized batch file that invokes curl ... so it isn't a 
production approach.


This was a very helpful suggestion from one of my students.

I hope this helps.

. . . . . . . . . . . Ken


--
XSLT/XQuery training:  after http://XMLPrague.cz 2010-03-15/19
XSLT/XQuery training: San Carlos, California 2010-04-26/30
Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03
XSLT/XQuery training: Ottawa, Canada 2010-05-10/14
XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11
Vote for your XML training:   http://www.CraneSoftwrights.com/q/i/
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/q/
G. Ken Holman mailto:gkhol...@cranesoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/q/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


Re: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Karl Erisman
If your customer does not yet have MarkLogic installed, they'll have
to use the administrative interface to configure MarkLogic itself, so
the procedure you've outlined seems straightforward enough as long as
your install.xqy itself is "user-friendly" (which should probably mean
that it presents a simple interface, does not ask questions that are
excessively technical, and shows clear confirmation or error messages
based on what happens).

I've been wondering about a broader, but closely-related topic:
release management of production MarkLogic applications in general.
How do others package code for system admins (customers themselves in
Andrew's case; but probably developers or an internal team of
specialists at most organizations) to deploy?  This applies to new
releases or upgrades.

Do you create, for each version of your application, an XQuery install
script (much like the one Andrew plans to use) that performs steps
such as manipulation of app servers, databases, etc. to bring the
configuration up to date with respect to source code changes?  Any
other hints on streamlining the process?

Karl

On Tue, Mar 2, 2010 at 10:41 AM, Andrew Welch  wrote:
> Hi,
>
> It seems that everything you can do through the admin screen you can
> do through a query... so rather give the customer a list of steps to
> follow (create http server, create webdav server etc), I can shield
> them from the admin screens and give them a query to run instead.
>
> The question is, what is the user-friendliest way for them to run that
> xquery, when the person installing the application is likely to know
> very little about MarkLogic?
>
> Is using the Docs dir the best way:
>
> 1) Install MarkLogic
> 2) copy the "install.xqy" to [install dir]/Docs
> 2) navigate to [hostname]:8000/install.xqy
>
> ...or is there another way?
>
>
>
> thanks
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/
> ___
> General mailing list
> General@developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


RE: [MarkLogic Dev General] user installation using a query

2010-03-02 Thread Ruth Stryker
Perhaps not exactly what you're looking for, but possibly useful, the script 
below creates a forest, creates a database, attaches the forest to the 
database, and sets up an http app server. 

One way to use it is to copy and paste it into CQ, edit the forest name, edit 
the database name, edit the http app server name, edit the port number, edit 
the directory path, press XML to execute the code, and then see that they were 
all set up by going into the Admin Interface (if desired).

---


(: forest :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:forest-create(
  $config, 
  "playground",
  xdmp:host(), 
  ())

return admin:save-configuration($config);




(: database :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:database-create(
  $config,
  "playground",
  xdmp:database("Security"),
  xdmp:database("Schemas"))

return admin:save-configuration($config);




(: attach forest to database :)


xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $config := admin:database-attach-forest(
  $config,
  xdmp:database("playground"), 
  xdmp:forest("playground"))

return admin:save-configuration($config);



(: application server :)

xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"; at 
"/MarkLogic/admin.xqy";

let $config := admin:get-configuration()

let $groupid := admin:group-get-id($config, "Default")

let $server := admin:http-server-create(
  $config, 
  $groupid,
  "8041-playground", 
  "C:\mls-projects\playground",
  8041,
  0,
  admin:database-get-id($config, "playground"))

return admin:save-configuration($server)

 

-Original Message-
From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Andrew Welch
Sent: Tuesday, March 02, 2010 8:42 AM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] user installation using a query

Hi,

It seems that everything you can do through the admin screen you can
do through a query... so rather give the customer a list of steps to
follow (create http server, create webdav server etc), I can shield
them from the admin screens and give them a query to run instead.

The question is, what is the user-friendliest way for them to run that
xquery, when the person installing the application is likely to know
very little about MarkLogic?

Is using the Docs dir the best way:

1) Install MarkLogic
2) copy the "install.xqy" to [install dir]/Docs
2) navigate to [hostname]:8000/install.xqy

...or is there another way?



thanks
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general


[MarkLogic Dev General] user installation using a query

2010-03-02 Thread Andrew Welch
Hi,

It seems that everything you can do through the admin screen you can
do through a query... so rather give the customer a list of steps to
follow (create http server, create webdav server etc), I can shield
them from the admin screens and give them a query to run instead.

The question is, what is the user-friendliest way for them to run that
xquery, when the person installing the application is likely to know
very little about MarkLogic?

Is using the Docs dir the best way:

1) Install MarkLogic
2) copy the "install.xqy" to [install dir]/Docs
2) navigate to [hostname]:8000/install.xqy

...or is there another way?



thanks
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
___
General mailing list
General@developer.marklogic.com
http://xqzone.com/mailman/listinfo/general