Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI utility to execute queries remotely
- Loading branch information
1 parent
8127df6
commit e306dd1
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns wolfskin.cli | ||
(:require [clojure.pprint :as pprint] | ||
[clojure.contrib.command-line :as ccl] | ||
[wolfskin.utils :as utils] | ||
)) | ||
|
||
(defn -main [& args] | ||
(ccl/with-command-line args | ||
"Command line demo" | ||
[[url "Repository URL" "http://localhost:8080/rmi"] | ||
[username u "User Name" "admin"] | ||
[password p "User password", "admin"] | ||
[workspace w "JCR Workspace"] | ||
[sql? "Sets query as JCR_SQL2" true] | ||
[xpath? "Sets query as XPATH"] | ||
[query q "Query to execute"]] | ||
(let [qtype (if sql? :sql :xpath) | ||
nodes (utils/run-query url username password workspace qtype query) | ||
] | ||
(pprint/pprint (utils/node-properties nodes))))) | ||
|
||
|
||
|