102 lines
6.6 KiB
HTML
102 lines
6.6 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Retrieving PrintObject attributes" />
|
||
|
<meta name="abstract" content="" />
|
||
|
<meta name="description" content="" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="printatt" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Retrieving PrintObject attributes</title>
|
||
|
</head>
|
||
|
<body id="printatt"><a name="printatt"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Retrieving PrintObject attributes</h1>
|
||
|
<div><p></p>
|
||
|
<div class="section"><p>You can retrieve print object attributes by using the attribute
|
||
|
ID and one of these methods from the base PrintObject class:</p>
|
||
|
<ul><li>Use <a href="javadoc/com/ibm/as400/access/PrintObject.html#GETINTEGERATTRIBUTE(INT)"> getIntegerAttribute(int attributeID)</a> to retrieve an
|
||
|
integer type attribute.</li>
|
||
|
<li>Use <a href="javadoc/com/ibm/as400/access/PrintObject.html#GETFLOATATTRIBUTE(INT)"> getFloatAttribute(int attributeID)</a> to retrieve a floating
|
||
|
point type attribute.</li>
|
||
|
<li>Use <a href="javadoc/com/ibm/as400/access/PrintObject.html#GETSTRINGATTRIBUTE(INT)"> getStringAttribute(int attributeID)</a> to retrieve a string
|
||
|
type attribute.</li>
|
||
|
</ul>
|
||
|
<p>The attributeID parameter is an integer that identifies which attribute
|
||
|
to retrieve. All of the IDs are defined as public constants in the base PrintObject
|
||
|
class. The <a href="printattributes.htm#printattributes">PrintAttributes</a> file
|
||
|
contains an entry of each attribute ID. The entry includes a description of
|
||
|
the attribute and its type (integer, floating point, or string). For a list
|
||
|
of which attributes may be retrieved using these methods, select the following
|
||
|
links:</p>
|
||
|
<ul><li><a href="afpresourceattrs.htm#afpresourceattrs">AFPResourceAttrs</a> for AFP™ Resources</li>
|
||
|
<li><a href="outputqueueattrs.htm#outputqueueattrs">OutputQueueAttrs</a> for
|
||
|
output queues</li>
|
||
|
<li><a href="printerattrs.htm#printerattrs">PrinterAttrs</a> for printers</li>
|
||
|
<li><a href="printerfileattrs.htm#printerfileattrs">PrinterFileAttrs</a> for
|
||
|
printer files</li>
|
||
|
<li><a href="spooledfileattrs.htm#spooledfileattrs">SpooledFileAttrs</a> for
|
||
|
spooled files</li>
|
||
|
<li><a href="writerjobattrs.htm#writerjobattrs">WriterJobAttrs</a> for
|
||
|
writer jobs</li>
|
||
|
</ul>
|
||
|
<p>To achieve acceptable performance, these attributes are copied to
|
||
|
the client. These attributes are copied either when the objects are listed,
|
||
|
or the first time they are needed if the object was created implicitly. This
|
||
|
keeps the object from going to the host every time the application needs to
|
||
|
retrieve an attribute. This also makes it possible for the Java™ print
|
||
|
object instance to contain out-of-date information about the object on the
|
||
|
server. The user of the object can refresh all of the attributes by calling
|
||
|
the <a href="javadoc/com/ibm/as400/access/PrintObject.html#UPDATE()"> update()</a> method on the object. In addition, if the application
|
||
|
calls any methods on the object that would cause the object's attributes to
|
||
|
change, the attributes are automatically updated. For example, if an output
|
||
|
queue has a status attribute of RELEASED (getStringAttribute(ATTR_OUTQSTS);
|
||
|
returns a string of "RELEASED"), and the <a href="javadoc/com/ibm/as400/access/OutputQueue.html#HOLD()">hold()</a> method is called on the output queue, getting
|
||
|
the status attribute after that returns HELD.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">setAttributes method</h4><p>You can use the <a href="javadoc/com/ibm/as400/access/SpooledFile.html#SETATTRIBUTES(COM.IBM.AS400.ACCESS.PRINTPARAMETERLIST)"> setAttributes</a> method to change the attributes of spooled
|
||
|
files and printer file objects. Select the following links for a list or which
|
||
|
attributes may be set:</p>
|
||
|
<ul><li><a href="printerfileattrs.htm#printerfileattrs">PrinterFileAttrs</a> file
|
||
|
for printer files</li>
|
||
|
<li><a href="spooledfileattrs.htm#spooledfileattrs">SpooledFileAttrs</a> for
|
||
|
spooled files</li>
|
||
|
</ul>
|
||
|
<p>The setAttributes method takes a <a href="javadoc/com/ibm/as400/access/PrintParameterList.html"> PrintParameterList</a> parameter, which is a class that
|
||
|
is used to hold a collection of attributes IDs and their values. The list
|
||
|
starts out empty, and the caller can add attributes to the list by using the
|
||
|
various <a href="javadoc/com/ibm/as400/access/PrintParameterList.html#SETPARAMETER(INT, INT)"> setParameter()</a> methods on it.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">PrintParameterList class</h4><p>You can use the PrintParameterList
|
||
|
class to pass a group of attributes to a method that takes any of a number
|
||
|
of attributes as parameters. For example, you can send a spooled file using
|
||
|
TCP (LPR) by using the SpooledFile method, <a href="javadoc/com/ibm/as400/access/SpooledFile.html#SENDTCP(COM.IBM.AS400.ACCESS.PRINTPARAMETERLIST)"> sendTCP()</a>. The PrintParameterList object contains the
|
||
|
required parameters for the send command, such as the remote system and queue,
|
||
|
plus any optional parameters desired, such as whether to delete the spooled
|
||
|
file after it is sent. In these cases, the method documentation gives a list
|
||
|
of required and optional attributes. The PrintParameterList setParameter()
|
||
|
method does not check which attributes you are setting and the values that
|
||
|
you set them to. The PrintParameterList setParameter() method simply contains
|
||
|
the values to pass along to the method. In general, extra attributes in the
|
||
|
PrintParameterList are ignored, and illegal values on the attributes that
|
||
|
are used are diagnosed on the server.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|