Skip to content

Commit 2d67063

Browse files
committed
add description for building and running
1 parent d8cb634 commit 2d67063

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ The easiest way to set up the environment is to:
66
2. Clone this repository.
77
3. Open IntelliJ IDEA and open project. `File -> Open.. -> <project_path>` (Select `Gradle` if needed.)
88
4. `Build -> Build Project`
9-
5. `Run -> Run... -> com.incquerylabs.vhci.modelaccess.twc.rest.Crawler.kt`
9+
10+
## Run the crawler
11+
12+
### From IntelliJ IDEA
13+
14+
1. `Run -> Run... -> com.incquerylabs.vhci.modelaccess.twc.rest.Crawler.kt` (set arguments in Configuration)
15+
16+
### Application
17+
18+
1. `gradle shadowJar` or download from GitHub releases
19+
1. `java -jar build/libs/vhci.modelaccess.twc.rest-1.0-SNAPSHOT-all.jar <args>` with arguments (see below)
20+
1021

1122
## Example arguments
1223

1324
### OpenSE Cookbook model on twc.openmbee.org
1425

15-
-S twc.openmbee.org -P 8111 -ssl -W 9c368adc-10cc-45d9-bec6-27aedc80e68b -R c6bede89-cd5e-487b-aca8-a4f384370759 -B 29110c0f-bdc1-4294-ae24-9fd608629cac -REV 350 -C 2000 openmbeeguest guest
26+
`-S twc.openmbee.org -P 8111 -ssl -W 9c368adc-10cc-45d9-bec6-27aedc80e68b -R c6bede89-cd5e-487b-aca8-a4f384370759 -B 29110c0f-bdc1-4294-ae24-9fd608629cac -REV 350 -C 2000 -u openmbeeguest -pw guest`
1627

1728
### TMT on twc.openmbee.org
1829

19-
-S twc.openmbee.org -P 8111 -ssl -W 9c368adc-10cc-45d9-bec6-27aedc80e68b -R 6819171d-1f52-4792-a08d-15d50d47985a -B a95e8bd1-f7d2-433e-a0a1-0c1cd7702e59 -REV 229 -C 2000 openmbeeguest guest
30+
`-S twc.openmbee.org -P 8111 -ssl -W 9c368adc-10cc-45d9-bec6-27aedc80e68b -R 6819171d-1f52-4792-a08d-15d50d47985a -B a95e8bd1-f7d2-433e-a0a1-0c1cd7702e59 -REV 229 -C 2000 -u openmbeeguest -pw guest`

com.incquerylabs.vhci.modelaccess.twc.rest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ compileTestKotlin {
2424
}
2525

2626
vertx {
27-
mainVerticle = 'com.incquerylabs.vhci.modelaccess.twc.rest.verticles.MainVerticle'
27+
launcher = 'com.incquerylabs.vhci.modelaccess.twc.rest.CrawlerKt'
2828
}
2929

3030
wrapper {

com.incquerylabs.vhci.modelaccess.twc.rest/src/main/kotlin/com/incquerylabs/vhci/modelaccess/twc/rest/Crawler.kt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,23 @@ fun main(args: Array<String>) {
1919

2020
val cli = CLI.create("crawler")
2121
.setSummary("A REST Client to query all model element from server.")
22-
.addArguments(
23-
listOf(
24-
Argument()
25-
.setArgName("username")
26-
.setIndex(0)
27-
.setDefaultValue("admin")
28-
.setDescription("TWC username."),
29-
Argument()
30-
.setArgName("password")
31-
.setIndex(1)
32-
.setDefaultValue("admin")
33-
.setDescription("TWC password.")
34-
)
35-
)
3622
.addOptions(
3723
listOf(
3824
Option()
3925
.setLongName("help")
4026
.setShortName("h")
4127
.setDescription("Show help site.")
4228
.setFlag(true),
29+
Option()
30+
.setLongName("username")
31+
.setShortName("u")
32+
.setDefaultValue("admin")
33+
.setDescription("TWC username."),
34+
Option()
35+
.setLongName("password")
36+
.setShortName("pw")
37+
.setDefaultValue("admin")
38+
.setDescription("TWC password."),
4339
Option()
4440
.setLongName("server")
4541
.setShortName("S")
@@ -106,6 +102,8 @@ fun main(args: Array<String>) {
106102
val sd = vertx.sharedData()
107103
val twcMap = sd.getLocalMap<Any, Any>("twcMap")
108104

105+
val usr = commandLine.getOptionValue<String>("username")
106+
val pswd = commandLine.getOptionValue<String>("password")
109107
val serverOpt = commandLine.getOptionValue<String>("server")
110108
val portOpt = commandLine.getOptionValue<String>("port")
111109
val isSslEnabled = commandLine.isFlagEnabled("ssl")
@@ -205,8 +203,6 @@ fun main(args: Array<String>) {
205203
error("Deploy failed: ${deploy.cause().message}")
206204
} else {
207205

208-
val usr = commandLine.getArgumentValue<String>("username")
209-
val pswd = commandLine.getArgumentValue<String>("password")
210206
twcMap["credential"] =
211207
"Basic ${java.util.Base64.getEncoder().encodeToString("${usr}:${pswd}".toByteArray())}"
212208
twcMap["username"] = usr

0 commit comments

Comments
 (0)