com.sap.netweaver.coll.wiki.api

Interface IWikiAttachmentManager


public interface IWikiAttachmentManager

Entry point for managing attachments in the wiki application.


Method Summary
 IWikiAttachment createAttachment(long documentID, String name, String typeContent, byte[] data)
          Creates attachment to page
 boolean deleteAttachment(long pageID, long attachmentID)
          Deletes attachment with specific unique identifier attached to a page
 IWikiAttachment getAttachment(long pageID, long attachmentID)
          Retrieves attachment with specific unique identifier attached to a page
 byte[] getAttachmentData(long pageID, long attachmentID, long offset, int size)
          Retrieves the attachment content as byte array.
 Iterable<IWikiAttachment> getAttachments(long pageID)
          Retrieves all attachments to given paged.
 Iterable<String[]> getProperties(long attachmentID)
          Retrieves extended properties of attachment
 String getProperty(long attachmentID, String name)
          Retrieves extended property of attachment
 Iterable<String[]> setProperties(long attachmentID, String[] names, String[] values)
          Sets extended propertyies to attachment
 Iterable<String[]> setProperty(long attachmentID, String name, String value)
          Sets extended property to attachment
 

Method Detail

getAttachments

Iterable<IWikiAttachment> getAttachments(long pageID)
                                         throws com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException
Retrieves all attachments to given paged.

Parameters:
pageID - unique identifier of page
Returns:
attachments iterable
Throws:
com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException

getAttachment

IWikiAttachment getAttachment(long pageID,
                              long attachmentID)
                              throws com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException,
                                     com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Retrieves attachment with specific unique identifier attached to a page

Parameters:
pageID - unique identifier of page
attachmentID - unique identifier of attachment
Returns:
attachment
Throws:
com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException

deleteAttachment

boolean deleteAttachment(long pageID,
                         long attachmentID)
                         throws com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException,
                                com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException,
                                com.sap.netweaver.coll.wiki.exception.UnauthorizedException,
                                com.sap.netweaver.coll.wiki.exception.WikiAttachmentException
Deletes attachment with specific unique identifier attached to a page

Parameters:
pageID - unique identifier of page
attachmentID - unique identifier of attachment
Returns:
true if attachment was found and delete
Throws:
com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
com.sap.netweaver.coll.wiki.exception.UnauthorizedException
com.sap.netweaver.coll.wiki.exception.WikiAttachmentException

getAttachmentData

byte[] getAttachmentData(long pageID,
                         long attachmentID,
                         long offset,
                         int size)
                         throws com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException,
                                com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException,
                                IOException
Retrieves the attachment content as byte array.

Parameters:
pageID - unique identifier of page
attachmentID - unique identifier of attachment
offset - starting position
size - size
Returns:
content as byte array
Throws:
com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
IOException

createAttachment

IWikiAttachment createAttachment(long documentID,
                                 String name,
                                 String typeContent,
                                 byte[] data)
                                 throws com.sap.netweaver.coll.wiki.exception.UnauthorizedException,
                                        com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException,
                                        IllegalStateException,
                                        com.sap.netweaver.coll.wiki.exception.WikiAttachmentException
Creates attachment to page

Parameters:
documentID - unique identifier of page
name - name of attachment
typeContent - content type of attachment
data - data of attachment
Returns:
created attachment
Throws:
com.sap.netweaver.coll.wiki.exception.UnauthorizedException
com.sap.netweaver.coll.wiki.exception.WikiPageNotFoundException
IllegalStateException
com.sap.netweaver.coll.wiki.exception.WikiAttachmentException

getProperties

Iterable<String[]> getProperties(long attachmentID)
                                 throws com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Retrieves extended properties of attachment

Parameters:
attachmentID - unique identifier of attachment
Returns:
iterable of strings
Throws:
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException

getProperty

String getProperty(long attachmentID,
                   String name)
                   throws com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Retrieves extended property of attachment

Parameters:
attachmentID - unique identifier of attachment
name - name of extended property
Returns:
value of extended property
Throws:
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException

setProperties

Iterable<String[]> setProperties(long attachmentID,
                                 String[] names,
                                 String[] values)
                                 throws com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Sets extended propertyies to attachment

Parameters:
attachmentID -
names - array of names
values - array of corresponding values
Returns:
the set properties
Throws:
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException

setProperty

Iterable<String[]> setProperty(long attachmentID,
                               String name,
                               String value)
                               throws com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Sets extended property to attachment

Parameters:
attachmentID - unique identifier of attachment
name - name of extended property
value - value of extended property
Returns:
the set property
Throws:
com.sap.netweaver.coll.wiki.exception.WikiAttachmentNotFoundException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[com.sap] KMC-WIKI [com.sap] com.sap.netweaver.coll.wiki.api api BC-COM-WIK


Copyright 2014 SAP AG Complete Copyright Notice