Skip to content
Permalink
chubing
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
1 contributor

Users who have contributed to this file

Material for Friday’s Software Integration Working Group exploration of midScribe

Generate documentation from midPoint configuration objects with this tool easily and conveniently in asciidoc or HTML

Prototype of midScribe available now, production version in midPoint 4.5

Download midScribe

git clone git@github.com:Evolveum/midscribe.git
Cloning into 'midscribe'...
Enter passphrase for key '/Users/khazelton/.ssh/kh_rsa':
remote: Enumerating objects: 1232, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 1232 (delta 7), reused 37 (delta 2), pack-reused 1171
Receiving objects: 100% (1232/1232), 188.70 KiB | 798.00 KiB/s, done.
Resolving deltas: 100% (425/425), done.

bash-3.2$ cd midscribe
/Users/khazelton/opt/midscribe

bash-3.2$ ls -la
total 408
drwxr-xr-x   12 khazelton  staff     384 Sep 26 12:40 .
drwxr-xr-x  115 khazelton  staff    3680 Sep 26 12:40 ..
drwxr-xr-x   12 khazelton  staff     384 Sep 26 12:40 .git
-rw-r--r--    1 khazelton  staff     347 Sep 26 12:40 .gitignore
-rw-r--r--    1 khazelton  staff   11357 Sep 26 12:40 LICENSE
-rw-r--r--    1 khazelton  staff    2303 Sep 26 12:40 README.adoc
-rw-r--r--    1 khazelton  staff   21834 Sep 26 12:40 example.adoc
-rw-r--r--    1 khazelton  staff  144235 Sep 26 12:40 example.html
-rw-r--r--    1 khazelton  staff    2171 Sep 26 12:40 jenkins-pipeline
drwxr-xr-x    4 khazelton  staff     128 Sep 26 12:40 midscribe-cmd
drwxr-xr-x    4 khazelton  staff     128 Sep 26 12:40 midscribe-core
-rw-r--r--    1 khazelton  staff    8456 Sep 26 12:40 pom.xml

Install midScribe

mvn clean install -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] midscribe                                                          [pom]
[INFO] midscribe-core                                                     [jar]
[INFO] midscribe-cmd                                                      [jar]
[INFO]
[INFO] ------------------< com.evolveum.midpoint:midscribe >-------------------
[INFO] Building midscribe 4.4-SNAPSHOT                                    [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ midscribe ---
[INFO]
[INFO] >>> maven-source-plugin:3.2.0:jar (attach-sources) > generate-sources @ midscribe >>>
[INFO]
[INFO] <<< maven-source-plugin:3.2.0:jar (attach-sources) < generate-sources @ midscribe <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.2.0:jar (attach-sources) @ midscribe ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ midscribe ---
[INFO] Installing /Users/khazelton/opt/midscribe/pom.xml to /Users/khazelton/.m2/repository/com/evolveum/midpoint/midscribe/4.4-SNAPSHOT/midscribe-4.4-SNAPSHOT.pom
[INFO]
[INFO] ----------------< com.evolveum.midpoint:midscribe-core >----------------
[INFO] Building midscribe-core 4.4-SNAPSHOT                               [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from shibboleth: https://build.shibboleth.net/nexus/content/repositories/releases/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloading from evolveum: https://nexus.evolveum.com/nexus/content/groups/public/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloading from evolveum-snapshots: https://nexus.evolveum.com/nexus/content/repositories/snapshots/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/woodstox/stax2-api/maven-metadata.xml (856 B at 2.4 kB/s)
Downloading from oracle: https://download.oracle.com/maven/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloading from spring-milestone: https://repo.spring.io/milestone/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloading from maven-default-http-blocker: http://0.0.0.0/org/codehaus/woodstox/stax2-api/maven-metadata.xml
Downloaded from evolveum: https://nexus.evolveum.com/nexus/content/groups/public/org/codehaus/woodstox/stax2-api/maven-metadata.xml (856 B at 416 B/s)
[WARNING] Could not transfer metadata org.codehaus.woodstox:stax2-api/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/): transfer failed for http://0.0.0.0/org/codehaus/woodstox/stax2-api/maven-metadata.xml
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ midscribe-core ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ midscribe-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 25 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ midscribe-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 22 source files to /Users/khazelton/opt/midscribe/midscribe-core/target/classes
[INFO] /Users/khazelton/opt/midscribe/midscribe-core/src/main/java/com/evolveum/midscribe/generator/TemplateUtils.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/khazelton/opt/midscribe/midscribe-core/src/main/java/com/evolveum/midscribe/generator/TemplateUtils.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ midscribe-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 24 resources
...
[INFO] Installing /Users/khazelton/opt/midscribe/midscribe-cmd/target/midscribe-executable.jar to /Users/khazelton/.m2/repository/com/evolveum/midpoint/midscribe-cmd/4.4-SNAPSHOT/midscribe-cmd-4.4-SNAPSHOT-executable.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for midscribe 4.4-SNAPSHOT:
[INFO]
[INFO] midscribe .......................................... SUCCESS [  0.265 s]
[INFO] midscribe-core ..................................... SUCCESS [  3.548 s]
[INFO] midscribe-cmd ...................................... SUCCESS [  0.638 s]
[INFO] - - - - - - - - - - - - - - - -
[INFO] BUILD SUCCESS
[INFO] - - - - - - - - - - - - - - - -
[INFO] Total time:  4.499 s
[INFO] Finished at: 2022-09-26T12:41:45-05:00
[INFO] - - - - - - - - - - - - - - - -
bash-3.2$ ls -la
total 408
drwxr-xr-x   12 khazelton  staff     384 Sep 26 12:40 .
drwxr-xr-x  115 khazelton  staff    3680 Sep 26 12:40 ..
drwxr-xr-x   12 khazelton  staff     384 Sep 26 12:40 .git
-rw-r--r--    1 khazelton  staff     347 Sep 26 12:40 .gitignore
-rw-r--r--    1 khazelton  staff   11357 Sep 26 12:40 LICENSE
-rw-r--r--    1 khazelton  staff    2303 Sep 26 12:40 README.adoc
-rw-r--r--    1 khazelton  staff   21834 Sep 26 12:40 example.adoc
-rw-r--r--    1 khazelton  staff  144235 Sep 26 12:40 example.html
-rw-r--r--    1 khazelton  staff    2171 Sep 26 12:40 jenkins-pipeline
drwxr-xr-x    5 khazelton  staff     160 Sep 26 12:41 midscribe-cmd
drwxr-xr-x    5 khazelton  staff     160 Sep 26 12:41 midscribe-core
-rw-r--r--    1 khazelton  staff    8456 Sep 26 12:40 pom.xml

bash-3.2$ tree -L 4 midscribe-cmd
midscribe-cmd
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   └── resources
│   │       ├── messages.properties
│   │       └── version
│   └── test
│       ├── java
│       │   └── com
│       └── resources
│           └── example.properties
└── target
    ├── classes
    │   ├── com
    │   │   └── evolveum
    │   ├── messages.properties
    │   └── version
    ├── generated-sources
    │   └── annotations
    ├── generated-test-sources
    │   └── test-annotations
    ├── maven-archiver
    │   └── pom.properties
    ├── maven-status
    │   └── maven-compiler-plugin
    │       ├── compile
    │       └── testCompile
    ├── midscribe-executable.jar
    ├── midscribe-sources.jar
    ├── midscribe.jar
    └── test-classes
        ├── com
        │   └── evolveum
        └── example.properties

25 directories, 11 files

bash-3.2$ pwd
/Users/khazelton/opt/midscribe

Run midScribe

java -jar midscribe-cmd/target/midscribe-executable.jar generate \
 -s ~/opt/non.adoc/configXml -ao documentation.adoc
java -jar midscribe-executable.jar generate -s <FOLDER_WITH_MIDPOINT_XML_OBJECTS> -ao documentation.adoc
          ------------------------              --------------------------------      ------------------
12:43:41.388 [main] DEBUG com.evolveum.midscribe.generator.Generator - Setting up midPoint store from class: class com.evolveum.midscribe.generator.InMemoryObjectStore
12:43:41.392 [main] DEBUG com.evolveum.midscribe.generator.InMemoryObjectStore - Initializing prism context
12:43:41.499 [main] DEBUG com.evolveum.midpoint.util.DOMUtil - Initializing document builder for thread main
12:43:41.532 [main] DEBUG com.evolveum.midpoint.util.DOMUtil - Document builder factory for thread main initialized in 32 ms
12:43:43.076 [main] DEBUG com.evolveum.midpoint.util.ClassPathUtil - Found 35 classes in package com.evolveum.prism.xml.ns._public.types_3
12:43:43.183 [main] DEBUG com.evolveum.midpoint.util.ClassPathUtil - Found 14 classes in package com.evolveum.prism.xml.ns._public.query_3
12:43:43.492 [main] DEBUG com.evolveum.midpoint.util.ClassPathUtil - Found 1010 classes in package com.evolveum.midpoint.xml.ns._public.common.common_3
...
12:43:44.539 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /template/users.vm with loader org.apache.velocity.runtime.resource.ResourceCacheImpl
12:43:44.540 [main] DEBUG org.apache.velocity.loader - ResourceManager: found /template/conclusion.vm with loader org.apache.velocity.runtime.resource.ResourceCacheImpl

12:43:44.540 [main] INFO com.evolveum.midscribe.generator.Generator - Asciidoc file 'documentation.adoc' generated for all objects

bash-3.2$ ls -la
total 432
drwxr-xr-x   13 khazelton  staff     416 Sep 26 12:43 .
drwxr-xr-x  115 khazelton  staff    3680 Sep 26 12:40 ..
drwxr-xr-x   12 khazelton  staff     384 Sep 26 12:40 .git
-rw-r--r--    1 khazelton  staff     347 Sep 26 12:40 .gitignore
-rw-r--r--    1 khazelton  staff   11357 Sep 26 12:40 LICENSE
-rw-r--r--    1 khazelton  staff    2303 Sep 26 12:40 README.adoc
-rw-r--r--    1 khazelton  staff   10982 Sep 26 12:43 documentation.adoc  <== output file
-rw-r--r--    1 khazelton  staff   21834 Sep 26 12:40 example.adoc
-rw-r--r--    1 khazelton  staff  144235 Sep 26 12:40 example.html
-rw-r--r--    1 khazelton  staff    2171 Sep 26 12:40 jenkins-pipeline
drwxr-xr-x    5 khazelton  staff     160 Sep 26 12:41 midscribe-cmd
drwxr-xr-x    5 khazelton  staff     160 Sep 26 12:41 midscribe-core
-rw-r--r--    1 khazelton  staff    8456 Sep 26 12:40 pom.xml

View generated document

atom documentation.adoc