Skip to content

Commit 93fd00b

Browse files
authored
Merge pull request #1 from cicsdev/aj-main
5.5 branch
2 parents a248601 + a1e1ac0 commit 93fd00b

51 files changed

Lines changed: 1199 additions & 312 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/java.yaml

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,25 @@ name: Build
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ["cicsts/v5.5"]
66
pull_request:
7-
branches: ["main"]
7+
branches: ["cicsts/v5.5"]
88
schedule:
99
- cron: '0 0 * * *'
1010

1111
jobs:
1212
check-copyright:
13-
name: Check Copyright
1413
runs-on: ubuntu-latest
14+
name: Check Copyright
1515
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0
20-
21-
- name: Check Copyright
22-
env:
23-
EXTENSIONS: "*.java"
24-
BASE_COPYRIGHT: "Copyright IBM Corp. 2016"
25-
run: |
26-
for ext in "$EXTENSIONS"; do
27-
for file in $(find . -type f -name "$ext" -path "./cics-java-liberty-link-app/*"); do
28-
echo "Processing file: $file"
29-
30-
LAST_MODIFIED_YEAR=$(git log --follow -1 --format="%ad" --date=format:"%Y" -- "$file")
31-
32-
if ! grep -q "Copyright" "$file"; then
33-
echo -e "/**\n * $BASE_COPYRIGHT\n */\n$(cat "$file")" > "$file"
34-
else
35-
# Extract existing copyright line
36-
CURRENT_COPYRIGHT=$(grep -o "Copyright IBM Corp. [0-9]\{4\}\(, [0-9]\{4\}\)\?" "$file")
37-
38-
# Check if LAST_MODIFIED_YEAR is anywhere in current copyright
39-
if [[ "$CURRENT_COPYRIGHT" != *"$LAST_MODIFIED_YEAR"* ]]; then
40-
# Check if copyright has two years
41-
if [[ "$CURRENT_COPYRIGHT" =~ ,\ [0-9]{4}$ ]]; then
42-
# If there is already a second year, replace it
43-
sed -i "s/$BASE_COPYRIGHT, [0-9]\{4\}/$BASE_COPYRIGHT, $LAST_MODIFIED_YEAR/" "$file"
44-
else
45-
# If there is no second year, add it
46-
sed -i "s/$BASE_COPYRIGHT/$BASE_COPYRIGHT, $LAST_MODIFIED_YEAR/" "$file"
47-
fi
48-
fi
49-
fi
50-
done
51-
done
52-
- name: Create Pull Request
53-
uses: peter-evans/create-pull-request@v7
16+
- uses: actions/checkout@v4
17+
- id: copyright-action
18+
uses: cicsdev/.github/.github/actions/samples-copyright-checker@139edd8dc23af7f4f7dd9afe4d56a1053fe426a7
5419
with:
20+
directory: './cics-java-liberty-tsq-app/'
21+
file-extensions: '*.java *.html'
22+
base-copyright: 'Copyright IBM Corp. 2025'
5523
token: ${{ secrets.GITHUB_TOKEN }}
56-
base: ${{ github.head_ref }}
5724

5825
build-mvnw:
5926
name: Build Maven Wrapper

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>cics-java-liberty-link</name>
3+
<name>cics-java-liberty-tsq</name>
44
<comment></comment>
55
<projects>
66
</projects>

.settings/org.eclipse.buildship.core.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ arguments=
22
auto.sync=false
33
build.scans.enabled=false
44
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5-
connection.project.dir=cics-java-liberty-link-app
5+
connection.project.dir=cics-java-liberty-tsq-app
66
eclipse.preferences.version=1
77
gradle.user.home=
88
java.home=

README.md

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
# Sample: cics-java-liberty-link
2-
[![Build](https://github.com/cicsdev/cics-java-liberty-link/actions/workflows/java.yaml/badge.svg)](https://github.com/cicsdev/cics-java-liberty-link/actions/workflows/java.yaml)
1+
# Sample: cics-java-liberty-tsq
32

4-
A sample CICS Java application showing use of the `com.ibm.cics.server.invocation.CICSProgram` annotation to link to an Enterprise Java program running in a Liberty JVM server.
3+
This sample demonstrates a Java EE web application running on a Liberty JVM server in CICS. It provides a web interface to interact with Temporary Storage Queues (TSQs) using the JCICS API.
54

65
## Contents
7-
A set of sample components that demonstrate how to annotate a POJO packaged in a WAR (Web application), deploy it to a Liberty JVM server, and then LINK to (or call) that POJO from a CICS program or CICS transaction.
86

9-
- [cics-java-liberty-link](./cics-java-liberty-link) - Top-level project.
10-
- [cics-java-liberty-link-app](./cics-java-liberty-link-app) - Web application project.
11-
- [cics-java-liberty-link-bundle](./cics-java-liberty-link-bundle) - CICS bundle plug-in based project, contains Web application and WLPH transaction bundle-parts. Use with Gradle and Maven builds.
12-
- [etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle](./etc/eclipse_projects/com.ibm.cics.server.examples.wlp.link.bundle) - CICS Explorer based CICS bundle project, contains Web application and WLPH transaction bundle-parts. Use with CICS Explorer 'Export to zFS' deployment capability.
7+
- [cics-java-liberty-tsq](./cics-java-liberty-tsq) - Top-level project.
8+
- [cics-java-liberty-tsq-app](./cics-java-liberty-tsq-app) - Web application project.
9+
- [cics-java-liberty-tsq-bundle](./cics-java-liberty-tsq-bundle) - CICS bundle plug-in based project, contains Web application. Use with Gradle and Maven builds.
10+
- [etc/eclipse_projects/com.ibm.cics.server.examples.wlp.tsq.bundle](./etc/eclipse_projects/com.ibm.cics.server.examples.wlp.tsq.bundle) - CICS Explorer based CICS bundle project, contains Web application. Use with CICS Explorer 'Export to zFS' deployment capability.
1311
- [etc/config/liberty/server.xml](./etc/config/liberty/server.xml) - A template `server.xml` demonstrating the minimum configuration required to run the sample.
1412

1513
## Prerequisites
@@ -23,7 +21,7 @@ A set of sample components that demonstrate how to annotate a POJO packaged in a
2321
## Downloading
2422

2523
- Clone the repository using your IDEs support, such as the Eclipse Git plugin
26-
- **or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-liberty-link/archive/main.zip) and unzip onto the workstation
24+
- **or**, download the sample as a [ZIP](https://github.com/cicsdev/cics-java-liberty-tsq/archive/main.zip) and unzip onto the workstation
2725

2826
> [!TIP]
2927
> Eclipse Git provides an 'Import existing Projects' check-box when cloning a repository.
@@ -63,8 +61,8 @@ You can build the sample in a variety of ways:
6361

6462

6563
> [!IMPORTANT]
66-
> The sample comes pre-configured for use with a JDK 1.8 and CICS TS V5.5 Libraries for Java EE 6/7. When you initially import the project to your IDE, if your IDE is not configured for a JDK 1.8, or does not have CICS Explorer SDK installed, you might experience local project compile errors. To resolve issues you should configure the Project's build-path to add/remove your preferred combination of CICS TS, JDK, and Liberty's Enterprise Java libraries (Java EE or Jakarta EE). Resolving errors might also depend on how you wish to build and deploy the sample. If you are building and deploying through CICS Explorer SDK and 'Export to zFS' you should edit the link-app's Project properties. Select 'Java Build Path', on the Libraries tab select 'Classpath', click 'Add Library', select 'CICS with Enterprise Java and Liberty' Library, and choose the appropriate CICS and Enterprise Java versions.
67-
If you are building and deploying with Gradle or Maven then you don't necessarily need to fix the local errors, but to do so, you can do as above, or you can run a tooling refresh on the link-app project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...".
64+
> The sample comes pre-configured for use with a JDK 1.8 and CICS TS V5.5 Libraries for Java EE 8. When you initially import the project to your IDE, if your IDE is not configured for a JDK 1.8, or does not have CICS Explorer SDK installed, you might experience local project compile errors. To resolve issues you should configure the Project's build-path to add/remove your preferred combination of CICS TS, JDK, and Liberty's Enterprise Java libraries (Java EE or Jakarta EE). Resolving errors might also depend on how you wish to build and deploy the sample. If you are building and deploying through CICS Explorer SDK and 'Export to zFS' you should edit the tsq-app's Project properties. Select 'Java Build Path', on the Libraries tab select 'Classpath', click 'Add Library', select 'CICS with Enterprise Java and Liberty' Library, and choose the appropriate CICS and Enterprise Java versions.
65+
If you are building and deploying with Gradle or Maven then you don't necessarily need to fix the local errors, but to do so, you can do as above, or you can run a tooling refresh on the tsq-app project. For example, in Eclipse: right-click on "Project", select "Gradle -> Refresh Gradle Project", **or** right-click on "Project", select "Maven -> Update Project...".
6866
6967
> [!TIP]
7068
> In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update.
@@ -76,14 +74,14 @@ If you are using the Egit client to clone the repo, remember to tick the button
7674

7775
### Option 2: Building with Gradle
7876

79-
For a complete build you should run the settings.gradle file in the top-level 'cics-java-liberty-link' directory which is designed to invoke the individual build.gradle files for each project.
77+
For a complete build you should run the settings.gradle file in the top-level 'cics-java-liberty-tsq' directory which is designed to invoke the individual build.gradle files for each project.
8078

81-
If successful, a WAR file is created inside the `cics-java-liberty-link-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/build/distribution` directory.
79+
If successful, a WAR file is created inside the `cics-java-liberty-tsq-app/build/libs` directory and a CICS bundle ZIP file inside the `cics-java-liberty-tsq-bundle/build/distribution` directory.
8280

8381
[!NOTE]
8482
In Eclipse, the output 'build' directory is often hidden by default. From the Package Explorer pane, select the three dot menu, choose filters and un-check the Gradle build folder to view its contents.
8583

86-
The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, defined in the [`cics-java-liberty-link-bundle/build.gradle`](cics-java-liberty-link-bundle/build.gradle) file, or alternatively can be set on the command line:
84+
The JVM server the CICS bundle is targeted at is controlled through the `cics.jvmserver` property, defined in the [`cics-java-liberty-tsq-bundle/build.gradle`](cics-java-liberty-tsq-bundle/build.gradle) file, or alternatively can be set on the command line:
8785

8886
**Gradle Wrapper (Linux/Mac):**
8987
```shell
@@ -104,10 +102,10 @@ gradle clean build -Pcics.jvmserver=MYJVM
104102

105103
### Option 3: Building with Apache Maven
106104

107-
For a complete build you should run the pom.xml file in the top-level 'cics-java-liberty-link' directory. A WAR file is created inside the `cics-java-liberty-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/target` directory.
105+
For a complete build you should run the pom.xml file in the top-level 'cics-java-liberty-tsq' directory. A WAR file is created inside the `cics-java-liberty-tsq-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-tsq-bundle/target` directory.
108106

109107
If building a CICS bundle ZIP the CICS JVM server name for the WAR bundle part should be modified in the
110-
`cics.jvmserver` property, defined in [`cics-java-liberty-link-bundle/pom.xml`](cics-java-liberty-link-bundle/pom.xml) file under the `defaultjvmserver` configuration property, or alternatively can be set on the command line.
108+
`cics.jvmserver` property, defined in [`cics-java-liberty-tsq-bundle/pom.xml`](cics-java-liberty-tsq-bundle/pom.xml) file under the `defaultjvmserver` configuration property, or alternatively can be set on the command line.
111109

112110
**Maven Wrapper (Linux/Mac):**
113111
```shell
@@ -129,53 +127,51 @@ mvn clean verify -Dcics.jvmserver=MYJVM
129127
## Deploying to a Liberty JVM server
130128

131129
Ensure you have the following features defined in your Liberty server.xml:
132-
* `cicsts:link-1.0`
130+
* `<feature>servlet-4.0</feature>`
133131

134132
A template server.xml is provided [here](./etc/config/liberty/server.xml).
135133

136-
### Deploying CICS Bundles with CICS Explorer
137-
1. Optionally, change the name of the JVMSERVER in the .warbundle file of the CICS bundle project from DFHWLP to the name of your JVMSERVER resource defined in CICS.
138-
2. Export the bundle project to zFS by selecting 'Export Bundle project to z/OS Unix File System' from the context menu.
139-
3. In CICS, create a bundle definition, setting the bundle directory attribute to the zFS location you just exported to, and install it.
140-
4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
134+
## Deploying to CICS
141135

142-
### Deploying CICS Bundles from Gradle or Maven
143-
1. Manually upload the ZIP file from the _cics-java-liberty-link-bundle/target_ or _cics-java-liberty-link-bundle/build/distributions_ directory to zFS.
144-
2. Unzip this ZIP file on zFS (e.g. `${JAVA_HOME}/bin/jar xf /path/to/bundle.zip`).
145-
3. Create a CICS BUNDLE resource definition, setting the bundle directory attribute to the zFS location you just extracted to, and install it into the CICS region.
146-
4. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
136+
### Option 1 - Deploying using CICS Explorer SDK and the provided CICS bundle project
137+
1. Deploy the CICS bundle project 'com.ibm.cics.server.examples.wlp.tsq.bundle' from CICS Explorer using the **Export Bundle Project to z/OS UNIX File System** wizard. This CICS bundle includes the WAR bundlepart to run the sample.
147138

148-
### Deploying directly with Liberty's application configuration
149-
1. Manually upload the WAR file from the _cics-java-liberty-link-app/target_ or _cics-java-liberty-link-app/build/libs_ directory to zFS.
150-
2. Add an `<application>` element to the Liberty server.xml to define the web application.
151-
3. Check the CICS region for the dynamically created PROGRAM resource HELLOWLP using the Programs view in CICS Explorer, or the CEMT INQUIRE PROGRAM command.
152139

140+
### Option 2 - Deploying using CICS Explorer SDK with own CICS bundle project
141+
1. Copy and paste the built WAR from your *projects/cics-java-liberty-tsq-app/target* or *projects/cics-java-liberty-tsq-app/build/libs* directory into a new Eclipse CICS bundle project.
142+
2. Create a new bundlepart that references the WAR file.
143+
3. Right click using the ** Export Bundle Project to z/OS UNIX File System ** wizard.
153144

154-
## Running
155145

156-
If you deployed the sample through CICS Explorer (Export to zFS), or through the CICS bundle plug-in as a ZIP and manually FTP'd the resource to zFS, the sample can be run using the `WLPH` transaction that is provided as a bundlepart within the CICS bundle definition.
146+
### Option 3 - Deploying using CICS Explorer (Remote System Explorer) and CICS Bundle ZIP
147+
1. Connect to USS on the host system
148+
2. Create the bundle directory for the project.
149+
3. Copy & paste the built CICS bundle ZIP file from your *projects/cics-java-liberty-tsq-bundle/target* or *projects/cics-java-liberty-tsq-bundle/build/distributions* directory to z/FS on the host system into the bundle directory.
150+
4. Extract the ZIP by right-clicking on the ZIP file > User Action > unjar...
151+
5. Refresh the bundle directory
157152

158-
Alternatively, you can define your own CICS transaction to invoke the program 'HELLOWLP', or you can use the CECI transaction to invoke the sample program:
159153

160-
```text
161-
CECI LINK PROGRAM(HELLOWLP)
162-
```
154+
### Option 4 - Deploying using command line tools
155+
1. Upload the built CICS bundle ZIP file from your *projects/cics-java-liberty-tsq-bundle/target* or *projects/cics-java-liberty-tsq-bundle/build/distributions* directory to z/FS on the host system (e.g. FTP).
156+
2. Connect to USS on the host system (e.g. SSH).
157+
3. Create the bundle directory for the project.
158+
4. Move the CICS bundle ZIP file into the bundle directory.
159+
5. Change directory into the bundle directoy.
160+
6. Extract the CICS bundle ZIP file. This can be done using the `jar` command. For example:
161+
```shell
162+
jar xf file.zip
163+
```
163164

164-
The program prints a message to the STDOUT output stream of the JVM server it runs on.
165+
---
165166

166-
You can pass a channel with a container:
167167

168-
```text
169-
CECI PUT CONTAINER(NAME) CHAR FROM(MATTHEW) CHANNEL(CHAN)
170-
CECI LINK PROG(HELLOWLP) CHANNEL(CHAN)
171-
```
172-
173-
(ensure both commands are entered in the same CECI session).
168+
## Running
174169

170+
The servlet is accessed with the following URL: [http://zos.example.com:9080/cics-java-liberty-tsq-app/](http://zos.example.com:9080/cics-java-liberty-tsq-app/).
175171

172+
If using Maven/Gradle build and deployment, The servlet is accessed with the following URL: [http://zos.example.com:9080/cics-java-liberty-tsq-app-1.0.0/](http://zos.example.com:9080/cics-java-liberty-tsq-app-1.0,0/).
176173

177-
## Find out more
178-
For more information about invoking Java EE applications in a Liberty JVM server from CICS programs, see [Linking to Java applications in a Liberty JVM server by using the @CICSProgram annotation](https://www.ibm.com/docs/en/cics-ts/latest?topic=djariljs-linking-java-applications-in-liberty-jvm-server-by-using-cicsprogram-annotation).
174+
You will see a TSQ interface rendered.
179175

180176

181177
## License

cics-java-liberty-link-app/.classpath

Lines changed: 0 additions & 12 deletions
This file was deleted.

cics-java-liberty-link-app/.settings/org.eclipse.wst.common.component

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)