|
Oracle Secure Enterprise Search Java API Reference 11g Release 2 (11.2.1.0.0) E17597-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.search.admin.api.ws.client.Attachment
public class Attachment
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>
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 |
---|
public Attachment()
Method Detail |
---|
public DataHandler getDataHandler()
DataHandler
.public void setDataHandler(DataHandler value)
value
- The attachment content as DataHandler
.public List getProperties()
getProperties().add( newProperty );NOTE: Not currently used.
List
of AdminProperty
.public String getResourceName()
public void setResourceName(String value)
value
- The resource name.public String getResourcePath()
public void setResourcePath(String value)
value
- The resource path.
|
Oracle Secure Enterprise Search Java API Reference 11g Release 2 (11.2.1.0.0) E17597-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |