Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Sample scripts for each product are located in the directory that shares its nam
Alternatively, you can select from the use cases below:

## Code4z - VS Code extension for the example.com company

This is an [example](code4z/example-com-extension) of an extension a fictitious company `example.com` may want to create to supplement Code4z with custom, company specific functionality. It shows now to make the functionality of custom in house ISPF applications available in VS Code.
This is an [example](code4z/example-com-extension) of an extension that a fictitious company `example.com` might want to create to supplement Code4z with custom, company-specific functionality. It shows how to make the functionality of custom in-house ISPF applications available in VS Code.

## Endevor - Automated Test Facility for Batch Applications
This [sample repository](endevor/Automated-Test-Facility-for-Batch-Applications) contains artifacts described in the [How to Leverage Endevor Processors to Test Batch Applications](https://medium.com/modern-mainframe/how-to-leverage-endevor-processors-to-test-batch-applications-6247a9dfdafa) blog on Medium. The objects are for using Endevor processors in Building an Automated Test Facility for Batch Applications in Endevor.

## Endevor - Self-servicing Project Workareas in Endevor with Dynamic Environments

This [sample repository](endevor/Self-servicing-Project-Workareas-in-Endevor-with-Dynamic-Environments) contains artifacts described in the [Self-servicing Project Workareas in Endevor with Dynamic Environments](https://medium.com/modern-mainframe/self-service-developer-workspaces-in-endevor-3b83c72bdc14) blog on Medium. The objects are sample processors for enabling self service with Dynamic Environments backed by Deferred File Creation.

## Endevor - Shipments for a Single-Destination
Expand Down
63 changes: 32 additions & 31 deletions code4z/example-com-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
# VS Code extension for the example.com company
# VS Code Extension for the Example.com Company

This is an example of an extension a company `example.com` may want to create to supplement Code4z with custom, company specific functionality.
This is an example of an extension the company `example.com` might want to create to supplement Code4z with custom, company-specific functionality.

## Making your custom ISPF apps available in VS Code
## Make Your Custom ISPF Apps Available in VS Code

If you have custom ISPF panels for your internal processes you may want to make their functionality available in VS Code as part of your DevOps modernization.
If you have custom ISPF panels for your internal processes, you can make their functionality available in VS Code as part of your DevOps modernization.

The following sections outline the steps to take.

### Update your ISPF application to run in plain TSO
### Update Your ISPF Application to Run in Plain TSO

1. Update your ISPF application to accept arguments instead of relying on screen inputs
1. Update the application to store its output to a dataset, or print it to the terminal instead of showing the result on an ISPF screen
1. Update your ISPF application to accept arguments instead of relying on screen inputs.
1. Update the application to store its output to a dataset, or print it to the terminal instead of showing the result on an ISPF screen.
1. Test your updated application by running it in TSO without ISPF and check its output.
1. Run your updated application through ZOWE CLI via the following command `zowe tso issue command "exec 'PUBLIC.REXX(REPOUT)' 'ARG1 ARG2'"`, where `PUBLIC.REXX(REPOUT)` is your REXX application and `ARG1` `ARG2` are the arguments that are passed to it. The syntax above works both in Windows CMD, PowerShell as well as Bourne compatible UNIX shells.
1. Run your updated application through Zowe CLI. Issue the following command: `zowe tso issue command "exec 'PUBLIC.REXX(REPOUT)' 'ARG1 ARG2'"`, where `PUBLIC.REXX(REPOUT)` is your REXX application and `ARG1` `ARG2` are the arguments that are passed to it. The syntax above works both in Windows CMD and PowerShell as well as in Bourne compatible UNIX shells.

### Use the basic-report command in this extension
### Use the Basic-Report Command in This Extension

1. Update the `REXX_EXEC` constant in [basic-report.js](commands/basic-report.js#L6) to point to your application.
1. Start the extension by pressing `F5`. This will start a new VS Code window with this extension.
1. In this new VS Code window open the _Command Palette_ by pressing `F1`
1. Type `example.com` in the command palette input box
1. Start the extension by pressing <kbd>F5</kbd>. This opens a new VS Code window with this extension.
1. In this new VS Code window open the Command Palette by pressing <kbd>F1</kbd>
1. Type `example.com` in the command palette input box.
A list of commands displays.
![Command Palette](command-palette.png)
1. Select the `Basic Report on a Dataset` command.
1. After a short moment an editor with the output of your applications opens.

Now you should see ![Command Palette](command-palette.png)
To try this out with a basic REXX program, you can use the included [basic-report.rexx](commands/basic-report.rexx) sample. A successful output report looks like this:

1. Select the `Basic Report on a Dataset` command
1. After a short moment an editor with the output of your applications will open
![Report](report.png)

If you would like to try this out with a basic REXX program, you can use the included [basic-report.rexx](commands/basic-report.rexx) sample. The output should look similar to ![Report](report.png)
### Explore the Enhanced-Report

### Explore the enhanced-report

The [basic report](commands/basic-report.js) is only 30 lines long. It is as simple as possible to get started quickly. To make the extension real there is a lot more to do. For example:
The [basic report](commands/basic-report.js) is only 30 lines long. It is as simple as possible to get started quickly. To complete the extension there is a lot more to do. For example:

- Input validation
- Error checking
- Remembering last entry
- Storing previous activity in memory
- Adding a progress bar
- Storing the report to a dataset and retrieving it from there
- Storing the report to a data set and retrieving it from there
- Adding a VS Code Output channel to diagnose issues
- Adding a setting for the location of the REXX exec instead of hard coding it in the extension code

All of these enhancements have been added to the [enhanced report](commands/enhanced-report.js) with its corresponding [enhanced-report.rexx](commands/enhanced-report.rexx) REXX exec. This adds a little over 100 lines of code and illustrated many other useful VS Code APIs. It also adds typescript checking via [JS Doc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) annotations to help you catch errors while authoring the code rather than at runtime.
All of these enhancements have been added to the [enhanced report](commands/enhanced-report.js) with its corresponding [enhanced-report.rexx](commands/enhanced-report.rexx) REXX exec. This adds a little over 100 lines of code and illustrates many other useful VS Code APIs. It also adds typescript checking via [JS Doc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html) annotations to help you catch errors while authoring the code rather than at runtime.

### Build the extension
### Build the Extension

The extension can be built by running the two following commands
To build the extension, run these two commands:

```
# Install development dependencies - typescript, types, and vsce
Expand All @@ -54,12 +55,12 @@ npm ci
npm run package
```

### Next steps
### Next Steps

A few ideas about what you may want to try next:
A few ideas about what you might want to try next:

- Remember last 10 user inputs and let them choose (in addition to typing a new one)
- Submit a JOB and retrieve its output instead of running a REXX exec
- Use the ZOWE SDK instead of ZOWE CLI (remove run-time dependency)
- Execute REXX exec over SSH or submit a JOB over FTP if you do not have ZOWE CLI available
- Copy the REXX exec to the mainframe before a command runs (in case the REXX does not exist) - self deploy
- Store the last 10 user inputs in memory and let the user choose one (in addition to typing a new one).
- Submit a job and retrieve its output instead of running a REXX exec.
- Use the Zowe SDK instead of Zowe CLI (remove run-time dependency).
- Execute the REXX exec over SSH, or submit a job over FTP if you do not have Zowe CLI available.
- Copy the REXX exec to the mainframe before a command runs (in case the REXX does not exist) - to self-deploy the extension.