com.ibm.eNetwork.beans.HOD
Class MacroPrinterDriver

java.lang.Object
  |
  +--com.ibm.eNetwork.beans.HOD.MacroPrinterDriver
All Implemented Interfaces:
com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf

public class MacroPrinterDriver
extends java.lang.Object
implements com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf

MacroPrinterDriver provides assess to the local Windows platform printer stream. This printer driver is specifically tailored to the rendering requirements of a Macro script interacting with a TN3270 host screen (Session.sessionType = = ECLSession.SESSION_TYPE_3270_STR).

These are an important reference classes:

See Also:
Macro.getMacroPrinterDriver(), MacroActionPrintStart, MacroActionPrintExtract, MacroActionPrintEnd

Constructor Summary
MacroPrinterDriver(com.ibm.eNetwork.ECL.ECLSession eclSession)
          There is no default constructor for this class, because an instance of a ECLSession must be provided.
MacroPrinterDriver(com.ibm.eNetwork.ECL.ECLSession eclSession, java.util.Properties p)
          There is no default constructor for this class, because an instance of a ECLSession must be provided.
 
Method Summary
 int closePrinter()
          The closePrinter method closes the printer driver and flushes the print job.
 java.util.Properties createDefaultPrinterDriverProperties()
          The returned Properties contains default valued configuration parameters of this printer driver implementation.
 java.util.Hashtable createPrinterPropertiesTypesAndDefaults()
          The returned Hashtable contains default values information for the configuration parameters of this printer driver implementation.
 java.util.Properties getProperties()
          Retrieves the Properties of the printer driver at their current configuration settings.
 boolean openPrinter()
          The openPrinter method readies the printer driver and opens a new printer job stream.
 void setProperties(java.util.Properties p)
          Set the properties that configure the printer driver.
 void setSessionLUType(int type)
          Set the LU type of the printer session data stream using a PDConstants value.
 void setSessionType(java.lang.String type)
          Set the type of host printer sesson.
 int writePrinter(com.ibm.eNetwork.ECL.ECLPS ps)
          The printer driver will render the entire presentation space to the underlying printer stream.
 int writePrinter(com.ibm.eNetwork.ECL.ECLPS ps, int SRow, int SCol, int ERow, int ECol)
          The printer driver will render a rectangular portion of the presentation space to the underlying printer stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroPrinterDriver

public MacroPrinterDriver(com.ibm.eNetwork.ECL.ECLSession eclSession)
There is no default constructor for this class, because an instance of a ECLSession must be provided.

Note: currently only a TN3270 session type of ECLSession is valid.

Parameters:
eclSession - An instance of ECLSession.

MacroPrinterDriver

public MacroPrinterDriver(com.ibm.eNetwork.ECL.ECLSession eclSession,
                          java.util.Properties p)
There is no default constructor for this class, because an instance of a ECLSession must be provided.

Note: currently only a TN3270 session type of ECLSession is valid.

Parameters:
eclSession - An instance of ECLSession.
p - The container for macro printer driver properties settings.
Method Detail

setSessionType

public void setSessionType(java.lang.String type)
Set the type of host printer sesson.

Note - Only the value ECLSession.SESSION_TYPE_3270_PRT_STR is currently valid.

Specified by:
setSessionType in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Parameters:
type - A ECLSession.SESSION_TYPE_xxxx_PRT_STR value.


setSessionLUType

public void setSessionLUType(int type)
Set the LU type of the printer session data stream using a PDConstants value.

Specified by:
setSessionLUType in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Parameters:
type - A PDConstants value to indicate the LU type.

setProperties

public void setProperties(java.util.Properties p)
Set the properties that configure the printer driver. The starting point Properties object is obtained via createDefaultPrinterDriverProperties().

Specified by:
setProperties in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Parameters:
p - Properties to configure the printer driver.

See Also:
getProperties(), createDefaultPrinterDriverProperties(), createPrinterPropertiesTypesAndDefaults()

getProperties

public java.util.Properties getProperties()
Retrieves the Properties of the printer driver at their current configuration settings.

Specified by:
getProperties in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Returns:
Properties - containing configuration parameters.

See Also:
setProperties(Properties)

writePrinter

public int writePrinter(com.ibm.eNetwork.ECL.ECLPS ps,
                        int SRow,
                        int SCol,
                        int ERow,
                        int ECol)
                 throws java.lang.Exception
The printer driver will render a rectangular portion of the presentation space to the underlying printer stream.

Note: currently only a TN3270-specific printer driver is available.

Specified by:
writePrinter in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Parameters:
ps - The presentation space object (ECLPS) that is the source of data.
SRow - The starting row (base 1).
SCol - The starting column (base 1).
ERow - The ending row (-1 means very last row).
ECol - The ending column (-1 means very last column).

Returns:
int - return code
Throws:
java.lang.Exception - The printer driver may be performing actions to the local hard drive or across a network. The caller should be prepared to catch an Exception.

See Also:
openPrinter(), writePrinter(ECLPS), closePrinter()

writePrinter

public int writePrinter(com.ibm.eNetwork.ECL.ECLPS ps)
                 throws java.lang.Exception
The printer driver will render the entire presentation space to the underlying printer stream.

Note: currently only a TN3270-specific printer driver is available.

Specified by:
writePrinter in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Parameters:
ps - The presentation space object (ECLPS) that is the source of data for the printer driver.

Returns:
int - return code
Throws:
java.lang.Exception - The printer driver may be performing actions to the local hard drive or accross a network. The caller should be prepared to catch an Exception.

See Also:
openPrinter(), writePrinter(ECLPS, int, int, int, int), closePrinter()

openPrinter

public boolean openPrinter()
                    throws java.lang.Exception
The openPrinter method readies the printer driver and opens a new printer job stream.

Note: currently only a TN3270-specific printer driver is available.

Specified by:
openPrinter in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Returns:
int - return code

Throws:
java.lang.Exception - The caller should be prepared to catch an Exception.
See Also:
writePrinter(ECLPS), writePrinter(ECLPS, int, int, int, int), closePrinter()

closePrinter

public int closePrinter()
The closePrinter method closes the printer driver and flushes the print job.

Specified by:
closePrinter in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Returns:
int - return code

See Also:
openPrinter(), writePrinter(ECLPS), writePrinter(ECLPS, int, int, int, int)

createDefaultPrinterDriverProperties

public java.util.Properties createDefaultPrinterDriverProperties()
The returned Properties contains default valued configuration parameters of this printer driver implementation.

The key is the name of the parameter as a String. The value is the associated default value represented by a String.

Caution: some parameter value changes require companion parameters to be changed in coordination.

Specified by:
createDefaultPrinterDriverProperties in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Returns:
Properteies - contains default key-value pairs.

See Also:
createPrinterPropertiesTypesAndDefaults()

createPrinterPropertiesTypesAndDefaults

public java.util.Hashtable createPrinterPropertiesTypesAndDefaults()
The returned Hashtable contains default values information for the configuration parameters of this printer driver implementation.

The key-value pairs contains three types of information: The (1) key is the string name of the property. The value Object is an instance of the intended (2) value type initialized to the intended (3) default value of the property.

Specified by:
createPrinterPropertiesTypesAndDefaults in interface com.ibm.eNetwork.beans.HOD.intf.PrinterDriverIntf
Returns:
Hashtable - contains defaults values and type of printer driver configuration parameters.

See Also:
createDefaultPrinterDriverProperties()