BEA Logo BEA WebLogic Java Adapter for Mainframe 4.1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Java Adapter for Mainframe User Guide Doc Home   |   BEA WebLogic Java Adapter for Mainframe User Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Code Generator Reference Pages

 

This section contains reference pages for the BEA WebLogic Java Adapter for Mainframe COBOL code generator (eGen COBOL). It describes the rules for writing the script file that controls the code generator.

 


eGen COBOL

The eGen COBOL tool maps a COBOL copybook into a Java class.

Synopsis

Invoke the tool with the following command:

java com.bea.jam.egen.EgenCobol scriptfile

where:

  java

is the name of the Java virtual machine executable in the Java Development Kit (JDK).

  com.bea.jam.egen.EgenCobol

is the full class name of the eGenCobol tool.

  scriptfile

is the script file that controls the eGen COBOL tool. You must write this script file on an application-by-application basis. (See Listing A-1 for an example).

If the JAM installation bin directory has been added to your path, then the eGen COBOL tool may also be invoked with the command:

egencobol scriptfile

Listing A-1 Example of scriptfile.egen


### example script
#

view demo.CustomDataView from emprec.cpy

service demoService accepts CustomDataView returns CustomDataView

page demoPage "Demo Page"
{
view demo.CustomDataView

buttons
{
"Try It" service(demoService) shows demoPage
}
}

servlet demo.DemoServlet shows demoPage


Script Syntax Reserved Words

The reserved words shown in Table A-1 must be used as specified in the Grammar section.

Note: A reserved word can be used as an identifier if it is enclosed in either single or double quotation marks (refer to General Rules).

Table A-1 Reserved Words

accepts

buttons

class

client

codepage

ejb

from

generate

group

is

method

page

reset

returns

server

service

servlet

shows

support

view

xml




General Rules

Grammar

The following grammar is described using a modified Backus-Naur Form (BNF) syntax, such as in many industry-standard software reference guides. It specifies a context-free grammar. Reserved words are shown in bold. Comments are in italics preceded by a dash (-).

  script:

definition | script definition

  fulldefinition:

generate definition | definition

  definition:

viewdef | servicedef | servletdef | ejbdef | classdef | pagedef

  viewdef:

view viewname from copybook | viewdf viewmodifier

  viewmodifier:

codepage codepagename | support xml

  servicedef:

service servicename accepts fullViewname returns fullViewname

  servletdef:

servlet classname shows pagename

  ejbdef:

clientejb | serverejb

  clientejb:

client ejb classname ejbregistration { clientmethods }

  serverejb:

server ejb classname ejbregistration { servermethods }

  classdef:

client class classname { clientmethods }

  pagedef:

page pagename title { view viewname buttons { buttonlist } }

  buttonlist:

buttondef | buttonlist buttondef

  buttondef:

servicebutton | ejbbutton

  clientmethods:

clientmethoddef | clientmethods clientmethoddef

  clientmethoddef:

method methodname is servicename

  servermethods:
  servermehtoddef | servermethods servermethodddef

  servermethoddef:
   method methodname (fullviewname) returns fullviewname

  servicebutton:

buttonname service ( servicename ) shows pagename

  ejbbutton:

buttonname ejbmethod ( fullViewname ) returns fullViewname

  viewname:

classname

  fullViewname:

viewname | viewname [ codepagename ]

  copybook:

identifier

-An identifier that names a file containing a COBOL data definition.

  servicename:

identifier

-An identifier that matches a resource definition in your jcrmgw.cfg file

  pagename:

identifier

-An identifier that names a page definition.

  codepagename:

identifier

-The name of a codepage to be used for character translation to/from mainframe data formats. This must be a codepage supported by the JDK being used.

  methodname:

identifier

-The name to be given to a generated Java method.

  classname:

identifier

-An identifier that names a Java class, including any package name.

  ejbregistration:

identifier

-The name that will be used to register the home interface for an EJB.

  title:

identifier

-The title to be placed into the HTML generated for a page.

  buttonname:

identifier

-A button name that will be used in the HTML generated for a page.

  ejbmethod:

identifier

-An EJB classname and method specification that should look like this:

package.ejbclass.method

or

ejbclass.method

Results of Running the Code Generator