You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,18 +35,18 @@ To deploy the sample you will need to import the projects into CICS Explorer.
35
35
36
36
To install the sample as a CICS bundle:
37
37
38
-
1. Export the CICS bundle from Eclipse by selecting the project com.ibm.cicsdev.ejb.bundle > Export Bundle Project to z/OS UNIX File System.
38
+
1. Export the CICS bundle from Eclipse by selecting the project **com.ibm.cicsdev.ejb.bundle** > **Export Bundle Project to z/OS UNIX File System**.
39
39
2. Define and install a JVMSERVER resource named `DFHWLP` in the CICS region.
40
40
3. Add the features `ejbLite-3.2`, `jsf-2.2` and `jaxrs-2.0` to the `featureManager` element in the Liberty JVM server's server.xml configuration file.
41
41
4. Define and install a BUNDLE resource.
42
42
43
43
To install the sample through Liberty configuration
44
-
1. Export the EAR project from Eclipse by selecting the project com.ibm.cicsdev.ejb.app > File > Export > EAR file > Next > choose a destination > Finish.
44
+
1. Export the EAR project from Eclipse by selecting the project **com.ibm.cicsdev.ejb.app** > **File** > **Export** > **EAR file** > **Next** > choose a destination > **Finish**.
45
45
2. Copy the EAR file in binary to the `apps` directory in the Liberty configuration directory on zFS.
46
46
3. Replace the Liberty configuration file `server.xml` or update elements featureManager, safRegistry and application using [server.xml](etc/config/server.xml) as a basis.
47
47
4. Install a JVMSERVER resource in the CICS region.
48
48
49
-
**Note:**JVMSERVER autoconfigure will configure the JVM server with the necessary elements in server.xml. Ensure autoconfigure is enabled in the JVM profile of the JVMSERVER used to run this sample.
49
+
**Note:**JVM server autoconfigure will configure the JVM server with the necessary elements in server.xml. Ensure autoconfigure is enabled in the JVM profile of the JVMSERVER used to run this sample.
50
50
51
51
If the sample is correctly deployed, you should see the following messages in the Liberty logs:
52
52
@@ -56,21 +56,21 @@ A CWWKT0016I: Web application available (default_host): http://mvs.example.ibm.c
56
56
A CWWKT0016I: Web application available (default_host): http://mvs.example.ibm.com:9080/stock/
57
57
```
58
58
59
-
If you use CICS bundle deployment, you will also need to define a RACF profile for users to access the stock REST API.
59
+
If you use CICS bundle deployment, you will also need to define a RACF EJBROLE profile for users to access the stock REST API which is protected by the Administrator role.
If you don't have RACF access, you could alter the `Administrator` role in the code to be the `cicsAllAuthenticated` role instead, which is always configured for CICS bundles, in the [CatalogueBean](projects/com.ibm.cicsdev.ejb/ejbModule/com/ibm/cicsdev/ejb/CatalogueBean.java) class.
66
+
If you don't have RACF access, you could alter the `Administrator` role in the [CatalogueBean](projects/com.ibm.cicsdev.ejb/ejbModule/com/ibm/cicsdev/ejb/CatalogueBean.java) to be the `cicsAllAuthenticated` role instead, which is always configured for CICS bundles,
67
67
68
68
## Running the Sample
69
-
To create new items in the store send a HTTP request to the stock API:
69
+
To create new items in the store send an authenticated HTTP request to the stock API. The authenticated user must have access to the role named in the CatalogueBean.
**Note:** We use BASIC authentication here, but any form of HTTP or HTTPS authentication would work.
89
-
90
-
You can use this request using the command line tool cURL:
88
+
You can use this request using the command line tool cURL, replacing <hostname>, <port> and <WEBUSER> with your own values.
91
89
92
90
```shell
93
-
curl mvs.example.ibm.com:9080/stock/api/items/ -X POST -d '{ "name": "CICS TS for z/OS", "stock": 2 }' -H 'Content-Type: application/json' --user MVSUSER1
91
+
curl <hostname>:<port>/stock/api/items/ -X POST -d '{ "name": "CICS TS for z/OS", "stock": 2 }' -H 'Content-Type: application/json' --user <WEBUSER>
94
92
```
95
93
96
-
Once one or more items have been created, you can then use a browser to navigate to http://mvs.example.ibm.com:9080/shop/ and use the shop.
94
+
**Note:** We use HTTP BASIC authentication in this example but other forms of authentiation could be used.
95
+
96
+
97
+
Once one or more items have been created, you can then use a browser to navigate to http://hostname:port/shop/ and use the shop via the CartBean. There is no role protecting
98
+
the CartBean so these requests do not need to be authenticated.
97
99
98
-
More stock can be added to an item through the following request (in this case we update item with the ID `1`):
100
+
More stock can be added to an item through the following HTTP request (in this case we update item with the ID `1`):
Because TSQs are not recoverable by default, to get the benefit of EJB transactions in the project, you would need to define a TS Model similar to this:
135
+
Because CICS TSQs are not recoverable by default, to get the benefit of EJB transactions in the project, you would need to define a TS model definition similar to this:
All the projects with code are Eclipse projects. To import these projects:
141
143
142
-
1. In Eclipse select *File* > *Import* > *General/Existing Projects into Workspace*
143
-
2.*Browse* to the `projects` directory.
144
+
1. In Eclipse select **File** > **Import** > **General/Existing Projects into Workspace**
145
+
2.**Browse** to the `projects` directory.
144
146
3. Ensure all 5 projects are checked
145
-
4.*Finish* to import the source projects.
147
+
4.**Finish** to import the source projects.
146
148
147
-
Optionally, you can import the CICS bundle project by following the same steps, but with the `etc` directory.
148
149
149
150
## Notes
150
151
[Twitter Bootstrap](http://getbootstrap.com/) is linked to for styling of the JSF web pages. This is pulled from a content delivery network (CDN) online. If external links are blocked, these web pages will continue to work without Bootstrap, but the Bootstrap CSS can also be downloaded and added by changing the `link` element:
0 commit comments