Skip navigation links

Oracle Secure Enterprise Search Java API Reference
11g Release 1 (11.1.2.0.0)

E14433-02


oracle.search.admin.api.ws.client
Class Attachment

java.lang.Object
  extended by oracle.search.admin.api.ws.client.Attachment


public class Attachment
extends Object

A binary attachment that is sent and returned separately from the object XML over the Web Service. The attachment data is sent as application/octet-stream using MIME attachments, and is modeled with a javax.activation.DataHandler.

The only object type that currently supports binary attachments is the skinBundle type. The attachments for a skinBundle correspond to Query Template User Interface files, such as images and FreeMarker template files.

In addition to the binary data, an Attachment also consists of a resource name and path. The resource name is the reference name to the Attachment in the object XML. The resource path represents a logical path to the Attachment, such as a file system or repository path. The supported values of the resource name and path depend on the object type. For example, when creating a skinBundle, the attachment name must be the relative path of the file in the bundle, such as templates/inc_header.ftl. This corresponds to the "path" attribute of "search:file" in the object XML. When exporting a skinBundle, the resource name is the same name as when the Attachment was created. The resource path should not be set when creating a skinBundle. When exporting a skinBundle, the resource path is set to "attachments/skinBundle/mySkinBundle/resourceName", where "mySkinBundle" is the name of the skinBundle, and "resourceName" is the resource name.

The following example initializes an Attachment for a skinBundle from a byte array:

   // Get the bytes from a file
   byte[] myData = getBytesFromFile( myFile );

   // Setup the DataHandler
   String contentType = "application/octet-stream";
   javax.mail.util.ByteArrayDataSource src = new javax.mail.util.ByteArrayDataSource( myData, contentType );
   javax.activation.DataHandler dataHandler = new javax.activation.DataHandler( source );

   // Setup the Attachment.
   Attachment attachment = new Attachment();
   attachment.setResourceName( "/templates/inc_header.ftl" );
   attachment.setDataHandler( dataHandler );

   // Use Attachment as input to the create or update operations
   // ...
 

The following schema fragment specifies the expected SOAP XML for this class:

 <complexType name="attachment">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element name="dataHandler" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
         <element name="properties" type="{http://search.oracle.com/Admin}adminProperty" maxOccurs="unbounded" minOccurs="0"/>
         <element name="resourceName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
         <element name="resourcePath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
       </sequence>
     </restriction>
   </complexContent>
 </complexType>
 
See Also:
AdminPortType

Constructor Summary
Attachment()
           

 

Method Summary
 DataHandler getDataHandler()
          Returns the attachment content.
 List getProperties()
          Returns the list of administration properties.
 String getResourceName()
          Returns the resource name.
 String getResourcePath()
          Returns the resource path.
 void setDataHandler(DataHandler value)
          Sets the attachment content.
 void setResourceName(String value)
          Sets the resource name.
 void setResourcePath(String value)
          Sets the resource path.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Attachment

public Attachment()

Method Detail

getDataHandler

public DataHandler getDataHandler()
Returns the attachment content.
Returns:
The attachment content as a DataHandler.

setDataHandler

public void setDataHandler(DataHandler value)
Sets the attachment content.
Parameters:
value - The attachment content as DataHandler.

getProperties

public List getProperties()
Returns the list of administration properties. To add a new property:
   getProperties().add( newProperty );
 
NOTE: Not currently used.
Returns:
A non-null List of AdminProperty.

getResourceName

public String getResourceName()
Returns the resource name. The resource name is used as a reference to the attachment in the object XML. The format of the resource name is determined by the object type.
Returns:
The resource name.

setResourceName

public void setResourceName(String value)
Sets the resource name. The resource name is used as a reference to the attachment in the object XML. The format of the resource name is determined by the object type.
Parameters:
value - The resource name.

getResourcePath

public String getResourcePath()
Returns the resource path. The resource path represents a logical path to the attachment, such as a file system path. The format of the resource path is determined by the object type.
Returns:
The resource path.

setResourcePath

public void setResourcePath(String value)
Sets the resource path. The resource path represents a logical path to the attachment, such as a file system path. The format of the resource path is determined by the object type.
Parameters:
value - The resource path.

Skip navigation links

Oracle Secure Enterprise Search Java API Reference
11g Release 1 (11.1.2.0.0)

E14433-02


Copyright © 2006, 2010, Oracle and/or its affiliates. All rights reserved.