com.sapportals.wcm.protocol.ice.protocol

Class ICEItem

java.lang.Object
  extended by com.sapportals.wcm.protocol.ice.protocol.ICEItemBase
      extended by com.sapportals.wcm.protocol.ice.protocol.ICEItem
All Implemented Interfaces:
IICEElement

public class ICEItem
extends ICEItemBase

ICEItem represents an ice-item element inside an ice-package. An ice-item is sended whenever content has to be added or modified on the subscriber.

Detailed information about the ICE package structur could be found in the ICE 1.1 specification section 5.2 , the ice-item element is described in section 5.2.2.1 . ice-item format

  <!ENTITY % attlist.item "
            activation            CDATA           #IMPLIED
            expiration            CDATA           #IMPLIED
            content-filename      CDATA           #IMPLIED
            content-transfer-encoding   (base64 | x-native-xml)
                                                 'x-native-xml'
            content-type          CDATA          'application/octet-stream'
            ip-status             CDATA           #IMPLIED
            xml:lang              CDATA           #IMPLIED
            license               CDATA           #IMPLIED
            rights-holder         CDATA           #IMPLIED
            show-credit           CDATA           #IMPLIED
            subscription-element  CDATA           #IMPLIED
  ">
  <!ENTITY % cm.item              "#PCDATA" >
 
  <!ELEMENT ice-item              (%cm.item;) >
  <!ATTLIST ice-item              %attlist.item;
            ice-element           CDATA   #FIXED 'ice-item'
            name                  CDATA           #REQUIRED
            item-id               CDATA           #REQUIRED
  >
 

See Also:

Copyright 2004 SAP AG


Field Summary
static String TAGNAME
           
 
Constructor Summary
ICEItem(Attributes attributes)
          Create a new ICE item.
ICEItem(String itemID, String name, String subscriptionElement, String contentFilename, String contentType, InputStream contentStream)
          Create a new ICE item.
 
Method Summary
 ICEContentEncoding getContentEncoding()
          Get the transfer encoding of the ICE item.
 String getContentFilename()
          Get the relative filename of the ICE item.
 InputStream getContentStream()
          Get the content of the ICE item as InputStream.
 String getContentType()
          Get the mime type of the content.
 String getItemID()
          Get the identifier of the ICE item within the package.
 String getName()
          Get the logical name of the ICE item.
 String getSubscriptionElement()
          Get the persistent identifier of the item in the subscription context that should be added or modified.
 void write(ContentHandler handler)
          Write the XML representation of the ICE element to a SAX ContentHandler.
 boolean writeChunk(ContentHandler handler)
          Write a chunk of XML to a SAX ContentHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAGNAME

public static final String TAGNAME
See Also:
Constant Field Values
Constructor Detail

ICEItem

public ICEItem(String itemID,
               String name,
               String subscriptionElement,
               String contentFilename,
               String contentType,
               InputStream contentStream)
Create a new ICE item.

Parameters:
itemID - The id of the item
name - The logical name of the item
subscriptionElement - The id of the item in the subscription context (might be null)
contentFilename - The filename of the content (might be null)
contentType - The type of the content (mime-type)
contentStream - An InputStream of the content of the item

ICEItem

public ICEItem(Attributes attributes)
        throws SAXException
Create a new ICE item. This constructor is used by ICEInput to decode an ICE item from an ICE payload

Parameters:
attributes - The attributes of the ice-item tag
Throws:
SAXException - Exception raised in failure situation
SAXException - if the ice-item tag is invalid
Method Detail

getContentEncoding

public ICEContentEncoding getContentEncoding()
Get the transfer encoding of the ICE item.

Returns:
The transfer encoding of the ICE item

getItemID

public String getItemID()
Get the identifier of the ICE item within the package.

Returns:
The identifier of the ICE item within the package

getName

public String getName()
Get the logical name of the ICE item.

Returns:
The logical name of the ICE item

getContentStream

public InputStream getContentStream()
                             throws IOException
Get the content of the ICE item as InputStream.

Returns:
An InputStream of the content of the ICE item.
Throws:
IOException - Exception raised in failure situation

getContentType

public String getContentType()
Get the mime type of the content.

Returns:
The mime type of the content

getContentFilename

public String getContentFilename()
Get the relative filename of the ICE item.

Returns:
The relative filename of the ICE item or null

getSubscriptionElement

public String getSubscriptionElement()
Get the persistent identifier of the item in the subscription context that should be added or modified.

Returns:
The persistent identifier of the item in the subscription context.

write

public void write(ContentHandler handler)
           throws SAXException
Write the XML representation of the ICE element to a SAX ContentHandler. This method is used by ICEOutput to create an ICE payload.

Parameters:
handler - The SAX ContentHandler (usually an XMLSerializer)
Throws:
SAXException - on error (might wrap another exception)

writeChunk

public boolean writeChunk(ContentHandler handler)
                   throws SAXException
Write a chunk of XML to a SAX ContentHandler. This method is used by ICEOutput to write an ICE payload in chunked mode.

Parameters:
handler - The SAX ContentHandler (usually a XMLSerializer)
Returns:
true if there are more chunks in the queue
Throws:
SAXException - on error (might wrap another exception)
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2011 SAP AG Complete Copyright Notice