diff --git a/.gitignore b/.gitignore index b1adc24..35b386c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/*.iml .idea/modules .idea/.gitignore +.idea/codeStyles build .gradle .gradle.properties diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2b87adc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# R2Z Changelog + +All notable changes to the R2Z will be documented in this file. + +## `1.3.0 (2023-02-22)` + +* Deprecation: This library is deprecated since 1.3.0 + + +* Feature: GitHub issue #3: Zowe Kotlin SDK: Java-like Kotlin API ([56788c1a](https://github.com/zowe/zowe-explorer-intellij/commit/56788c1a)) +* Feature: Implement ZosUssFile (copying methods - from uss to dsn and to uss folder) ([2bb0b257](https://github.com/zowe/zowe-explorer-intellij/commit/2bb0b257)) + + +* Bugfix: GitHub issue #9: Error Creating Connection ([bbc16d72](https://github.com/zowe/zowe-client-kotlin-sdk/commit/bbc16d72)) diff --git a/README.md b/README.md index d09d6f9..dc2418b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# WARNING: THIS REPOSITORY IS MARKED AS 'DEPRECATED' AND WON'T BE MAINTAINED. CONSIDER SWITCHING TO ZOWE CLIENT KOTLIN SDK WITH THE SIMILAR APPROACH TO WORK WITH Z/OSMF REST API ([link](https://github.com/zowe/zowe-client-kotlin-sdk)) + ## zOSMF Retrofit Library This library covert zOSMF Rest API with kotlin object oriented code using Retrofit. r2z will allow you to send http requests to your zOSMF. @@ -42,6 +44,14 @@ if (response.isSuccessful){ ``` Please note that in order to create API stub, you have to specify that the response should be converted by gson. And that's how you can easily use r2z. +## Documentation with Dokka + +To build Dokka documentattion, run: +``` +./gradlew dokkaHtml +``` +Docs will be added to *build/dokka/html* + ## How to run tests ### Unit tests diff --git a/build.gradle b/build.gradle index 655bafb..6419668 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,12 @@ // Copyright © 2020 IBA Group, a.s. All rights reserved. Use of this source code is governed by Eclipse Public License – v 2.0 that can be found at: https://www.eclipse.org/legal/epl-2.0/ +import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.kotlin.config.LanguageVersion +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id 'java' id 'org.jetbrains.kotlin.jvm' version '1.6.21' + id 'org.jetbrains.dokka' version '1.7.20' } apply plugin: 'java' @@ -26,7 +30,7 @@ repositories { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.21" - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' testImplementation 'com.squareup.okhttp3:mockwebserver:4.10.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' implementation 'com.squareup.retrofit2:retrofit:2.9.0', @@ -34,21 +38,35 @@ dependencies { 'com.squareup.retrofit2:converter-scalars:2.9.0', 'com.google.code.gson:gson:2.10', 'com.starxg:java-keytar:1.0.0', - 'org.yaml:snakeyaml:1.29', - 'org.junit.jupiter:junit-jupiter-api:5.8.2' + 'org.yaml:snakeyaml:1.33' } test { useJUnitPlatform() } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { +tasks.withType(KotlinCompile).all { kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() - languageVersion = org.jetbrains.kotlin.config.LanguageVersion.LATEST_STABLE.versionString + languageVersion = LanguageVersion.LATEST_STABLE.versionString } } +tasks.withType(DokkaTask.class) { + String dokkaBaseConfiguration = """ + { + "footerMessage": "(c) 2022 IBA Group", + "templatesDir": "${file("dokka/templates").getAbsolutePath().replace('\\', '/')}", + "customAssets": ["${file("dokka/assets/zowe-icon.png").getAbsolutePath().replace('\\', '/')}"], + "customStyleSheets": ["${file("dokka/assets/logo-styles.css").getAbsolutePath().replace('\\', '/')}"] + } + """ + pluginsMapConfiguration.set( + // fully qualified plugin name to json configuration + ["org.jetbrains.dokka.base.DokkaBase": dokkaBaseConfiguration] + ) +} + task sourceJar(type: Jar) { classifier "sources" from sourceSets.main.allSource diff --git a/dokka/assets/logo-styles.css b/dokka/assets/logo-styles.css new file mode 100644 index 0000000..0f410c7 --- /dev/null +++ b/dokka/assets/logo-styles.css @@ -0,0 +1,15 @@ +.library-name a { + position: relative; + margin-left: 55px; +} + +.library-name a::before { + content: ''; + background: url("../images/zowe-icon.png") center no-repeat; + background-size: contain; + position: absolute; + width: 50px; + height: 50px; + top: -18px; + left: -55px; +} diff --git a/dokka/assets/zowe-icon.png b/dokka/assets/zowe-icon.png new file mode 100644 index 0000000..5b979db Binary files /dev/null and b/dokka/assets/zowe-icon.png differ diff --git a/dokka/templates/includes/footer.ftl b/dokka/templates/includes/footer.ftl new file mode 100644 index 0000000..55e7a5e --- /dev/null +++ b/dokka/templates/includes/footer.ftl @@ -0,0 +1,15 @@ +<#macro display> +
+#macro> diff --git a/dokka/templates/includes/header.ftl b/dokka/templates/includes/header.ftl new file mode 100644 index 0000000..87938fd --- /dev/null +++ b/dokka/templates/includes/header.ftl @@ -0,0 +1,25 @@ +<#import "source_set_selector.ftl" as source_set_selector> +<#macro display> + +#macro> diff --git a/dokka/templates/includes/page_metadata.ftl b/dokka/templates/includes/page_metadata.ftl new file mode 100644 index 0000000..67b4018 --- /dev/null +++ b/dokka/templates/includes/page_metadata.ftl @@ -0,0 +1,6 @@ +<#macro display> +- * See JSDoc for "waitForStatusCommon" for full details on polling and other logic. + * [waitForStatusCommon] to adjust. * * @param job document of the z/OS job to wait for (see z/OSMF Jobs APIs for details) * @return job document @@ -52,10 +50,7 @@ class MonitorJobs( /** * Given the jobname/jobid, waits for the status of the job to be "OUTPUT". This API will poll for the OUTPUT status * once every 3 seconds indefinitely. If the polling interval/duration is NOT sufficient, use - * "waitForStatusCommon" to adjust. - * - * - * See JavaDoc for "waitForStatusCommon" for full details on polling and other logic. + * [waitForStatusCommon] to adjust. * * @param jobName the z/OS jobname of the job to wait for output status (see z/OSMF Jobs APIs for details) * @param jobId the z/OS jobid of the job to wait for output status (see z/OSMF Jobs APIS for details) @@ -78,7 +73,7 @@ class MonitorJobs( * than the current status of the job, then the method returns immediately (since the job will never enter the * requested status) with the current status of the job. * - * @param params monitor jobs parameters, see MonitorJobWaitForParams object + * @param params [MonitorJobWaitForParams] object * @return job document * @throws Exception error processing wait check request */ @@ -98,7 +93,7 @@ class MonitorJobs( /** * "Polls" (sets timeouts and continuously checks) for the status of the job to match the desired status. * - * @param params monitor jobs params, see MonitorJobWaitForParams + * @param params [MonitorJobWaitForParams] object * @return job document * @throws Exception error processing poll check request */ @@ -128,7 +123,7 @@ class MonitorJobs( /** * Checks the status of the job for the expected status (OR that the job has progressed passed the expected status). * - * @param params monitor jobs params, see MonitorJobWaitForParams + * @param params [MonitorJobWaitForParams] object * @return boolean true when the job status is obtained * @throws Exception error processing check request */ @@ -168,7 +163,7 @@ class MonitorJobs( /** * Checks if the given message is within the job output within line limit. * - * @param params monitor jobs params, see MonitorJobWaitForParams + * @param params [MonitorJobWaitForParams] object * @param message message string * @return boolean message found status * @throws Exception error processing check request @@ -201,7 +196,7 @@ class MonitorJobs( /** * "Polls" (sets timeouts and continuously checks) for the given message within the job output. * - * @param params monitor jobs params, see MonitorJobWaitForParams + * @param params [MonitorJobWaitForParams] object * @param message message string * @return boolean message found status * @throws Exception error processing poll check request @@ -230,7 +225,7 @@ class MonitorJobs( /** * Determines if a given job is in a running state or not. * - * @param params monitor jobs params, see MonitorJobWaitForParams + * @param params [MonitorJobWaitForParams] object * @return true if in running state * @throws Exception error processing running status check */ @@ -246,7 +241,7 @@ class MonitorJobs( /** * Given jobname/jobid, checks for the desired message continuously (based on the interval and attempts specified). * - * @param params monitor jobs parameters, see MonitorJobWaitForParams object + * @param params [MonitorJobWaitForParams] object * @param message message string * @return job document * @throws Exception error processing wait check request @@ -268,7 +263,7 @@ class MonitorJobs( /** * Given a Job document (has jobname/jobid), waits for the given message from the job. This API will poll for * the given message once every 3 seconds for at least 1000 times. If the polling interval/duration is NOT - * sufficient, use "waitForMessageCommon" method to adjust. + * sufficient, use [waitForMessageCommon] method to adjust. * * @param job document of the z/OS job to wait for (see z/OSMF Jobs APIs for details) * @param message message string @@ -290,9 +285,7 @@ class MonitorJobs( /** * Given a Job document (has jobname/jobid), waits for the given status of the job. This API will poll for * the given status once every 3 seconds for at least 1000 times. If the polling interval/duration is NOT - * sufficient, use "waitForStatusCommon" method to adjust. - *
- * See JavaDoc for "waitForStatusCommon" for full details on polling and other logic.
+ * sufficient, use [waitForStatusCommon] method to adjust.
*
* @param job document of the z/OS job to wait for (see z/OSMF Jobs APIs for details)
* @param statusType status type, see JobStatus.Type object
@@ -309,7 +302,7 @@ class MonitorJobs(
/**
* Given the jobname/jobid, waits for the given status of the job. This API will poll for the given status once
* every 3 seconds for at least 1000 times. If the polling interval/duration is NOT sufficient, use
- * "waitForStatusCommon" method to adjust.
+ * [waitForStatusCommon] method to adjust.
*
* @param jobName the z/OS jobname of the job to wait for output status (see z/OSMF Jobs APIs for details)
* @param jobId the z/OS jobid of the job to wait for output status (see z/OSMF Jobs APIS for details)
@@ -328,4 +321,4 @@ class MonitorJobs(
))
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zosjobs/SubmitJobs.kt b/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zosjobs/SubmitJobs.kt
index e501b43..13472b5 100644
--- a/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zosjobs/SubmitJobs.kt
+++ b/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zosjobs/SubmitJobs.kt
@@ -27,7 +27,7 @@ class SubmitJobs(
/**
* Submit a job that resides in a z/OS data set.
*
- * @param jobDataSet job Dataset to be translated into SubmitJobParams object
+ * @param jobDataSet job Dataset to be translated into [SubmitJobParams] object
* @return job document with details about the submitted job
* @throws Exception error on submitting
*/
@@ -38,7 +38,7 @@ class SubmitJobs(
/**
* Submit a job that resides in a z/OS data set.
*
- * @param params submit job parameters, see SubmitJobParams object
+ * @param params [SubmitJobParams] object
* @return job document with details about the submitted job
* @throws Exception error on submitting
*/
@@ -75,7 +75,7 @@ class SubmitJobs(
/**
* Submit a JCL string to run
*
- * @param params submit jcl parameters, see SubmitJclParams object
+ * @param params [SubmitJclParams] object
* @return job document with details about the submitted job
* @throws Exception error on submitting
*/
@@ -98,4 +98,4 @@ class SubmitJobs(
return response?.body() as SubmitJobRequest? ?: throw Exception("No body returned")
}
-}
\ No newline at end of file
+}
diff --git a/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zostso/CollectedResponses.kt b/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zostso/CollectedResponses.kt
new file mode 100644
index 0000000..59771e8
--- /dev/null
+++ b/src/main/kotlin/eu/ibagroup/r2z/zowe/client/sdk/zostso/CollectedResponses.kt
@@ -0,0 +1,21 @@
+// Copyright © 2020 IBA Group, a.s. All rights reserved. Use of this source code is governed by Eclipse Public License – v 2.0 that can be found at: https://www.eclipse.org/legal/epl-2.0/
+
+package eu.ibagroup.r2z.zowe.client.sdk.zostso
+
+import eu.ibagroup.r2z.TsoResponse
+
+/**
+ * Tso collected Responses
+ */
+data class CollectedResponses(
+
+ /**
+ * z/OSMF synchronous most tso command response messages.
+ */
+ val tsos: List