From: Василий С. <wst...@gm...> - 2012-01-25 12:52:54
|
Hi, let me introduce my mini-app for working with svn (use svn client) svn/controller.xql *xquery version* "3.0"; declare variable $exist:path external; declare variable $exist:resource external; declare variable $exist:root external; declare variable $exist:controller external; *declare option* exist:serialize "method=html5 media-type=text/html indent=no"; <html> <head> <title>SVN Client</title> <link rel="stylesheet" href=" http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"/> </head> <body style="width: 80%; margin: auto"> <h2>SVN Client</h2> <div class="row"> <div class="span8"> <h5> Checkout</h5> <form method="post"> <fieldset> <label for="svn-url">URL:</label><input name="svn-url"type ="text"/><br/><br/> <label for="destination">Collection:</label><input name= "destinatoin" type="text"/> </fieldset> <input type="submit" class="btn primary" name="action" value ="checkout"/> </form> <div> { *if* (*request:get-parameter*("action", "") = "checkout") *then* ( *let* $login := *xmldb:login*("/db/", "admin", "") *return* *subversion:checkout*(*request:get-parameter*( "svn-url", ""), *request:get-parameter*("destinatoin", "")) ) *else* () } </div> </div> <div class="span8"> <h5> Add or Delete</h5> <form method="post"> <fieldset> <label for="destination">Collection/Resource:</label><input name="destinatoin" type="text"/> </fieldset> <input type="submit" class="btn primary" name="action" value ="add"/> <input type="submit" class="btn danger" name="action" value= "delete"/> </form> <div> { *let* $l := *xmldb:login*("/db/", "admin", "") *let* $r := *if* (*request:get-parameter*("action", "") = "add") *then* *subversion:add*(*request:get-parameter*( "destination", "")) *else* *if* (*request:get-parameter*("action", "") = "delete") *then* *subversion:delete*(*request:get-parameter*("destination", "")) *else* () *return* $r } </div> </div> </div> <div class="row"> <div class="span8"> <h5> Checkin</h5> <form method="post"> <fieldset> <label for="destination">Collection:</label><input name= "destinatoin" type="text"/><br/><br/> <label for="comment">Comment:</label><textarea name= "comment" rows="5"/><br/><br/> <label for="login">SVN Login:</label><input name="login"type ="text"/><br/><br/> <label for="pass">SVN Pass:</label><input name="pass"type ="password"/> </fieldset> <input type="submit" class="btn primary" name="action" value ="checkin"/> </form> <div> { *if* (*request:get-parameter*("action", "") = "checkin") *then* ( *let* $login := *xmldb:login*("/db/", "admin", "") *return* *subversion:commit*( *request:get-parameter*("destinatoin", ""), *request:get-parameter*("comment", ""), *request:get-parameter*("login", ""), *request:get-parameter*("pass", "") ) ) *else* () } </div> </div> <div class="span8"> <h5> Delete</h5> <form method="post"> <fieldset> <label for="destination">Collection or resource:</label ><input name="destinatoin" type="text"/><br/><br/> </fieldset> <input type="submit" class="btn primary" name="action" value ="Info"/> </form> <div> { *if* (*request:get-parameter*("action", "") = "Info") *then* ( *let* $login := *xmldb:login*("/db/", "admin", "") *return* *subversion:info*(*request:get-parameter*( "destinatoin", "")) ) *else* () } </div> </div> </div> </body> </html> -- С наилучшими пожеланиями Василий Старцев |