***  This interface provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.publish
Interface ViewerEntryInterface

All Superinterfaces:
com.sas.entities.EntityKeyInterface, EntryInterface, com.sas.io.InputStreamProviderInterface, com.sas.io.ReaderProviderInterface, java.rmi.Remote
All Known Implementing Classes:
ViewerEntry

public interface ViewerEntryInterface
extends EntryInterface, com.sas.io.InputStreamProviderInterface, com.sas.io.ReaderProviderInterface

The ViewerEntryInterface provides a mechanism for setting and getting the attributes of a viewer entry. In the MVA Publishing Framework, a viewer is a custom-written template that contains HTML tags for formatting result set package content for view-only transports, such as e-mail. The viewer file is applied to the package during package publishing. A viewer file is particularly useful for rendering a SAS data set in a tabular format for viewing in e-mail. Also, it is useful for streaming dynamic information in the form of a binary file or a URL for inclusion in an electronic newsletter format.

The viewer is not used for rendering purposes in the Java Publishing Framework, but viewer entries can be published and retrieved.

Since:
1.0

Field Summary
static int HTML_VIEWER
           
static int TEXT_VIEWER
           
 
Method Summary
 java.lang.String getEncoding()
          Returns the encoding of viewer.
 java.io.InputStream getInputStream()
          Gets the input stream for the viewer entry.
 java.io.InputStream getInputStream(java.lang.Object streamID)
          Deprecated. Use getInputStream() which now supports remote input streams.
 java.lang.String getMIMEType()
          Returns the MIME type associated with this viewer entry.
 java.lang.String getName()
          Returns the name of the file.
 java.io.Reader getReader()
          Gets reader for this viewer entry.
 java.io.Reader getReader(java.lang.Object readerID)
          Deprecated. Use getReader() which now supports remote readers.
 com.sas.io.RemoteInputStreamInterface getRemoteInputStream(java.lang.Object streamID)
          Deprecated. Use getInputStream() which now supports remote input streams.
 com.sas.io.RemoteReaderInterface getRemoteReader(java.lang.Object readerID)
          Deprecated. Use getReader() which now supports remote readers.
 int getViewerType()
          Returns the type of viewer, HTML or text.
 java.lang.Object hasInputStream()
          Deprecated.  this method no longer needed as getInputStream() will return an input stream that can be used in a remote environment
 java.lang.Object hasReader()
          Deprecated.  this method no longer needed as getReader() will return a reader that can be used in a remote environment
 void setEncoding(java.lang.String encoding)
          Sets the viewer encoding.
 void setMIMEType(java.lang.String mimeType)
          Sets the MIME type associated with this viewer file.
 
Methods inherited from interface com.sas.services.publish.EntryInterface
getDescription, getNameValuePairs, getURL, isReadOnly, setDescription, setNameValuePairs
 

Field Detail

HTML_VIEWER

static final int HTML_VIEWER
See Also:
Constant Field Values

TEXT_VIEWER

static final int TEXT_VIEWER
See Also:
Constant Field Values
Method Detail

getEncoding

java.lang.String getEncoding()
                             throws java.rmi.RemoteException,
                                    TransportException
Returns the encoding of viewer.

Returns:
String The encoding of the viewer; can be null.
Throws:
TransportException - If the transport encounters an error getting the encoding.
java.rmi.RemoteException - If a network anomaly is encountered.
java.lang.IllegalStateException - If the package is already closed.

setEncoding

void setEncoding(java.lang.String encoding)
                 throws java.lang.IllegalStateException,
                        java.rmi.RemoteException
Sets the viewer encoding.

If this is a text viewer, the encoding is used when constructing the Reader that is returned by getReader and getRemoteReader, and it is used to publish the viewer.

If this is an HTML viewer, the encoding of the HTML viewer is published as metadata along with the viewer entry. When published, the HTML viewer is parsed. If the charset= attribute is specified in the META tag, this encoding value will be used. If not found, the value set using this method will be used. Otherwise, a default encoding of ISO-8859-1 will be set.

Parameters:
encoding - The encoding for this viewer.
Throws:
java.lang.IllegalStateException - If the entry is read only or if the package containing this entry has already been closed.
java.rmi.RemoteException - If a network anomaly is encountered

getViewerType

int getViewerType()
                  throws TransportException,
                         java.rmi.RemoteException
Returns the type of viewer, HTML or text.

Returns:
int The type of viewer. Supported viewer types include HTML_VIEWER or TEXT_VIEWER.
Throws:
TransportException - If the transport encounters an error getting the viewer type.
java.rmi.RemoteException - If a network anomaly is encountered
java.lang.IllegalStateException - If the package is already closed.

getName

java.lang.String getName()
                         throws java.rmi.RemoteException,
                                TransportException
Returns the name of the file.

Returns:
String The name of the file.
Throws:
TransportException - If the transport encounters an error getting the name of the file.
java.rmi.RemoteException - If a network anomaly is encountered.
java.lang.IllegalStateException - If the package is already closed.

getMIMEType

java.lang.String getMIMEType()
                             throws java.rmi.RemoteException,
                                    TransportException
Returns the MIME type associated with this viewer entry. The user-specified MIME type is assigned when the viewer entry is published.

Returns:
String The MIME type associated with this file; can be null.
Throws:
TransportException - If the transport encounters an error getting the MIME type.
java.rmi.RemoteException - If a network anomaly is encountered.
java.lang.IllegalStateException - If the package is already closed.

setMIMEType

void setMIMEType(java.lang.String mimeType)
                 throws java.lang.IllegalStateException,
                        java.rmi.RemoteException
Sets the MIME type associated with this viewer file.

Parameters:
mimeType - The MIME type associated with this viewer file.
Throws:
java.lang.IllegalStateException - If the entry is read only or if the package containing this entry has already been closed.
java.rmi.RemoteException - If a network anomaly is encountered.

getInputStream

java.io.InputStream getInputStream(java.lang.Object streamID)
                                   throws java.lang.IllegalStateException,
                                          java.rmi.UnmarshalException,
                                          java.io.IOException,
                                          java.rmi.RemoteException
Deprecated. Use getInputStream() which now supports remote input streams.

Gets the input stream for the viewer entry. This method is only supported by HTML viewers. Because input streams are not remotable, this method will throw a RemoteException if it is invoked on a remote object. Distributed applications should utilize getRemoteInputStream(java.lang.Object) in order to obtain the input stream.

Specified by:
getInputStream in interface com.sas.io.InputStreamProviderInterface
Parameters:
streamID - The stream description should be null; it will be ignored.
Returns:
The input stream that can be used for reading the contents of this viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on a text viewer or if the package containing this entry is already closed.
java.rmi.UnmarshalException - If invoked on a remote object.
java.io.IOException - If an error occurs constructing the input stream.
java.rmi.RemoteException - If a network anomaly is encountered.

getRemoteInputStream

com.sas.io.RemoteInputStreamInterface getRemoteInputStream(java.lang.Object streamID)
                                                           throws java.lang.IllegalStateException,
                                                                  java.io.IOException,
                                                                  java.rmi.RemoteException
Deprecated. Use getInputStream() which now supports remote input streams.

Get the remote input stream for the viewer entry. This method is only valid for HTML viewers. Because input streams are not remotable, distributed applications should use remote input streams.

Specified by:
getRemoteInputStream in interface com.sas.io.InputStreamProviderInterface
Parameters:
streamID - The stream description should be null; it will be ignored.
Returns:
RemoteInputStream The remote input stream that can be used for reading the contents of this viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on a text viewer or if the package containing this entry is already closed.
java.io.IOException - If an error occurs constructing the remote input stream.
java.rmi.RemoteException - If a network anomaly is encountered.

getReader

java.io.Reader getReader(java.lang.Object readerID)
                         throws java.lang.IllegalStateException,
                                java.rmi.UnmarshalException,
                                java.io.IOException,
                                java.rmi.RemoteException
Deprecated. Use getReader() which now supports remote readers.

Gets reader for this viewer entry. This method is only valid for text viewers. Because readers are not remotable, this method will throw a RemoteException if it is invoked on a remote object. Distributed applications should utilize getRemoteReader(java.lang.Object) in order to obtain the reader.

Specified by:
getReader in interface com.sas.io.ReaderProviderInterface
Parameters:
readerID - The reader description should be null; it will be ignored.
Returns:
The reader that can be used for reading the contents of the viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on an html viewer
java.rmi.UnmarshalException - If invoked on a remote object.
java.io.IOException - If an error occurs constructing the reader.
java.rmi.RemoteException - If a network anomaly is encountere.

getRemoteReader

com.sas.io.RemoteReaderInterface getRemoteReader(java.lang.Object readerID)
                                                 throws java.lang.IllegalStateException,
                                                        java.io.IOException,
                                                        java.rmi.RemoteException
Deprecated. Use getReader() which now supports remote readers.

Get the remote reader for this viewer entry. This method is only valid for text viewers. Because readers are not remotable, distributed applications should use remote readers.

Specified by:
getRemoteReader in interface com.sas.io.ReaderProviderInterface
Parameters:
readerID - The reader description should be null; it will be ignored.
Returns:
RemoteReader The remote reader that can be used for reading the contents of the viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on an html viewer
java.io.IOException - If an error occurs constructing the remote reader.
java.rmi.RemoteException - If a network anomaly is encountered.

hasReader

java.lang.Object hasReader()
                           throws java.rmi.UnmarshalException,
                                  java.rmi.RemoteException
Deprecated.  this method no longer needed as getReader() will return a reader that can be used in a remote environment

Check if getReader(java.lang.Object) will succeed. See getReader(java.lang.Object) to determine whether this method should be used.

Specified by:
hasReader in interface com.sas.io.ReaderProviderInterface
Returns:
non-null if getReader(java.lang.Object) would succeed; throws UnmarshalException if it would fail
Throws:
java.rmi.UnmarshalException - if invoked on a remote object
java.rmi.RemoteException - if a network I/O error occurs.

hasInputStream

java.lang.Object hasInputStream()
                                throws java.rmi.UnmarshalException,
                                       java.rmi.RemoteException
Deprecated.  this method no longer needed as getInputStream() will return an input stream that can be used in a remote environment

Check if getInputStream(java.lang.Object) will succeed. See getInputStream(java.lang.Object) to determine whether this method should be used.

Specified by:
hasInputStream in interface com.sas.io.InputStreamProviderInterface
Returns:
Object non-null if getInputStream(java.lang.Object) would succeed; throws UnmarshalException if it would fail
Throws:
java.rmi.UnmarshalException - if invoked on a remote obejct
java.rmi.RemoteException - if a network anomaly is encountered.
java.lang.IllegalStateException - if this result package has already been closed.

getInputStream

java.io.InputStream getInputStream()
                                   throws java.lang.IllegalStateException,
                                          java.io.IOException,
                                          java.rmi.RemoteException
Gets the input stream for the viewer entry.

Returns:
The input stream that can be used for reading the contents of this viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on a text viewer or if the package containing this entry is already closed.
java.io.IOException - If an error occurs constructing the input stream.
java.rmi.RemoteException - If a network anomaly is encountered.

getReader

java.io.Reader getReader()
                         throws java.lang.IllegalStateException,
                                java.io.IOException,
                                java.rmi.RemoteException
Gets reader for this viewer entry.

Returns:
The reader that can be used for reading the contents of the viewer entry.
Throws:
java.lang.IllegalStateException - If invoked on an html viewer
java.io.IOException - If an error occurs constructing the reader.
java.rmi.RemoteException - If a network anomaly is encountere.

***  This interface provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.