When a BCM Web API request is to be run from a browser, due to a security function called CORS (cross-origin resource sharing), you might not be able to run the JavaScript file that includes the processing to run the BCM Web API request, except in the case of HTML of the same origin (domain) downloaded from the host. For this reason, perform the following procedure to register the JavaScript file for the plug-in.
- Save the JavaScript file in zFS on the host by using the ISO 8859-1 character encoding.
- Create a properties file that specifies the name of the JavaScript file and
the directory containing the JavaScript file, and then save the properties file in zFS.
The following is an example of a properties file:
- For izu.externalapp.code.root, specify the name of the directory containing the JavaScript file.
- For taskSAFResourceName1, specify the RACF profile name ZOSMF.value-specified-for-pluginId.value-specified-for-taskId1 of the plug-in.
- For taskNavigationURL1, specify the path of the JavaScript file.
importType=plugin izu.externalapp.file.version=1.0.0 izu.externalapp.local.context.root=. # the relative path of code directory izu.externalapp.code.root=. pluginId=BCMAPIJS pluginDefaultName=BCMAPIJS pluginDescription=sample script for using BCM Web API aboutPanelPath=./about.txt taskId1=BCMAPI taskVersion1=1.0 taskCategoryId1=11 taskDispName1=BCMAPI taskDispDesc1=task of sample script for using BCM Web API taskSAFResourceName1=ZOSMF.BCMAPIJS.BCMAPI taskNavigationURL1=./BCMAPIJS.html taskBundleUrl1=./nls/ taskBundleFileName1=bundle.js taskMinZOS1=04.26.00 taskMinZOSMF1=04.26.00
BCMAPIJS: Value of pluginId
BCMAPI: Value of taskId1
BCMAPIJS.html: Name of the JavaScript file in which the BCM Web API is specified
- In the z/OSMF window, select Import manager. Next, on the Import tab, enter the path of the properties file and then click Import.
- Run the following RACF
command:
RDEFINE ZMFAPLA IZUDFLT.ZOSMF.BCMAPIJS.BCMAPI UACC(NONE) PERMIT IZUDFLT.ZOSMF.BCMAPIJS.BCMAPI CLASS(ZMFAPLA) ID(IZUADMIN) ACCESS(CONTROL) PERMIT IZUDFLT.ZOSMF.BCMAPIJS.BCMAPI CLASS(ZMFAPLA) ID(user-ID-of-the-user-running-the-BCM-Web-API-server) ACCESS(READ) SETROPTS RACLIST(ZMFAPLA) REFRESH
BCMAPIJS: The value of pluginId specified for properties
BCMAPI: The value of taskId1 specified for properties