wt.content
Class ContentHelper

java.lang.Object
  extended bywt.content.ContentHelper
All Implemented Interfaces:
Externalizable, Serializable

public class ContentHelper
extends Object
implements Externalizable

Used by clients to access the ContentService and defines some client side helper methods to manipulate content, status objects, and initiate uploads and downloads. Usage is ... ContentHelper.service.contentServiceMethod( args ); Also defines some client side helper methods

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
static String APP_DATA_KEY
           
private static String CLASSNAME
           
private static boolean DEBUG
           
static String DOWNLOAD_METHOD
           
static long EXTERNALIZATION_VERSION_UID
           
static String HOLDER_KEY
           
private static String HTTP_CLASS
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static ContentService service
          

Supported API: true
static String UPLOAD_METHOD
           
 
Constructor Summary
ContentHelper()
           
 
Method Summary
static void doDownload(ContentHolder holder, ApplicationData appData, AppletContext context)
          Deprecated.  
static void doDownload(HttpContentOperation op, HttpOperationItem opItem, AppletContext context)
          Deprecated.  
static void doUpload(HttpContentOperation operation, AppletContext context)
          Deprecated.  
static void followURL(URLData url, AppletContext context)
          follows a URL link for a given URLData object in a new window

Supported API: false
static Vector getAggregateFiles(Aggregate agg)
          Deprecated.  
static Vector getAggregateMembers(Aggregate agg)
          Get the list of ContentItem's for the passed Aggregate.
static Vector getApplicationData(ContentHolder holder)
          Get the list of ApplicationData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the primary for a FormatContentHolder

Supported API: true
static Vector getApplicationDataExcludeRoles(ContentHolder holder, String excludeRoles)
          Get the list of ApplicationData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the primary for a FormatContentHolder.
static Vector getContentList(ContentHolder holder)
          Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will NOT return the primary content for a FormatContentHolder.
static Vector getContentListAll(ContentHolder holder)
          Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will return the primary content for a FormatContentHolder, as well as any other attached content.
static Vector getContentListExcludeRoles(ContentHolder holder, String excludeRoles)
          Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will NOT return the primary content for a FormatContentHolder.
static URL getDownloadURL(ContentHolder holder, ApplicationData appData)
          Generates a URL that can be used in download from the server.
static URL getDownloadURL(ContentHolder holder, ApplicationData appData, boolean replicatedContent)
          Generates a URL that can be used in download from the server.
static URL getDownloadURL(ContentHolder holder, ApplicationData appData, boolean replicatedContent, String fileName)
          Generates a URL that can be used in download from the server.
static URL getDownloadURL(ContentHolder holder, ApplicationData appData, String fileName)
          Generates a URL that can be used in download from the server.
private static Vector getExcludeRoles(String excludeRoles)
           
static HttpContentOperation getOperation(ContentHolder holder)
          Deprecated.  
static ContentItem getPrimary(FormatContentHolder holder)
          Returns the primary ContentItem for a FormatContentHolder, if it exists.
static Vector getStatusList(HttpContentOperation operation)
          Deprecated.  
static URL getUploadURL(ContentHolder holder)
          Generates a URL that can be used in an upload post.
static URL getUploadURL(ObjectIdentifier an_oid)
          

Supported API: false
static Vector getURLData(ContentHolder holder)
          Get the list of URLData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the Primary for a FormatConentHolder.
static boolean needToGetContent(ContentHolder holder)
          This will return true if the passed ContentHolder has already been passed to the server to get it's content.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(ContentHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

public static final ContentService service


Supported API: true


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

DEBUG

private static boolean DEBUG

UPLOAD_METHOD

public static final String UPLOAD_METHOD
See Also:
Constant Field Values

DOWNLOAD_METHOD

public static final String DOWNLOAD_METHOD
See Also:
Constant Field Values

HTTP_CLASS

private static final String HTTP_CLASS
See Also:
Constant Field Values

HOLDER_KEY

public static final String HOLDER_KEY
See Also:
Constant Field Values

APP_DATA_KEY

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

ContentHelper

public ContentHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ContentHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getContentList

public static Vector getContentList(ContentHolder holder)
                             throws WTException
Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will NOT return the primary content for a FormatContentHolder.

Supported API: true

Parameters:
holder -
Returns:
Vector
Throws:
WTException

getURLData

public static Vector getURLData(ContentHolder holder)
                         throws WTException
Get the list of URLData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the Primary for a FormatConentHolder.

Supported API: true

Parameters:
holder -
Returns:
Vector
Throws:
WTException

getApplicationData

public static Vector getApplicationData(ContentHolder holder)
                                 throws WTException
Get the list of ApplicationData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the primary for a FormatContentHolder

Supported API: true

Parameters:
holder -
Returns:
Vector
Throws:
WTException

getStatusList

public static Vector getStatusList(HttpContentOperation operation)
                            throws WTException
Deprecated.  

Gets the list of statuses out of the HttpContentOperation object. This should be used after a call to getHttpContentOperationStatuses( HttpContentOperation)

Supported API: false

Parameters:
operation -
Returns:
Vector
Throws:
WTException

doUpload

public static void doUpload(HttpContentOperation operation,
                            AppletContext context)
                     throws WTException
Deprecated.  

Initiates an upload based on the given HttpContentOperation object for a particular AppletContext.

Supported API: false

Parameters:
operation -
context -
Throws:
WTException

doDownload

public static void doDownload(HttpContentOperation op,
                              HttpOperationItem opItem,
                              AppletContext context)
                       throws WTException,
                              InterruptedException
Deprecated.  

Initiates an upload based on the given HttpOperationObject using the passed AppletContext.

Supported API: false

Parameters:
op -
opItem -
context -
Throws:
WTException
InterruptedException

doDownload

public static void doDownload(ContentHolder holder,
                              ApplicationData appData,
                              AppletContext context)
                       throws WTException,
                              InterruptedException
Deprecated.  

Initiates a download based on the given ContentHolder and ApplicationData object using a particular AppletContext.

Supported API: false

Parameters:
holder -
appData -
context -
Throws:
WTException
InterruptedException

followURL

public static void followURL(URLData url,
                             AppletContext context)
                      throws WTException,
                             MalformedURLException
follows a URL link for a given URLData object in a new window

Supported API: false

Parameters:
url -
context -
Throws:
WTException
MalformedURLException

needToGetContent

public static boolean needToGetContent(ContentHolder holder)
This will return true if the passed ContentHolder has already been passed to the server to get it's content.

Supported API: true

Parameters:
holder -
Returns:
boolean

getOperation

public static HttpContentOperation getOperation(ContentHolder holder)
                                         throws WTException
Deprecated.  

Get a HttpContentOperation object out of the passed ContentHolder This should be done after a call to ContentHelper.service.contentUpdateUpload( ContentHolder ) or ContentHelper.service.contentUpdateDownload( ContentHolder )

Supported API: false

Parameters:
holder -
Returns:
HttpContentOperation
Throws:
WTException

getPrimary

public static ContentItem getPrimary(FormatContentHolder holder)
Returns the primary ContentItem for a FormatContentHolder, if it exists. A call to ContentHelper.service.getContents should be used to populate the content information inside of the FormatContentHolder prior to calling this method.

Supported API: true

Parameters:
holder -
Returns:
ContentItem

getAggregateFiles

public static Vector getAggregateFiles(Aggregate agg)
                                throws WTException
Deprecated.  

Get the list of ContentItem's for the passed Aggregate. This should be done after a call to ContentHelper.service.getContents( ContentHolder )

Supported API: false

Parameters:
agg -
Returns:
Vector
Throws:
WTException

getUploadURL

public static URL getUploadURL(ContentHolder holder)
                        throws WTException
Generates a URL that can be used in an upload post.

Supported API: true

Parameters:
holder -
Returns:
URL
Throws:
WTException

getUploadURL

public static URL getUploadURL(ObjectIdentifier an_oid)
                        throws WTException


Supported API: false

Parameters:
an_oid -
Returns:
URL
Throws:
WTException

getDownloadURL

public static URL getDownloadURL(ContentHolder holder,
                                 ApplicationData appData)
                          throws WTException
Generates a URL that can be used in download from the server.

Supported API: true

Parameters:
holder -
appData -
Returns:
URL
Throws:
WTException

getAggregateMembers

public static Vector getAggregateMembers(Aggregate agg)
                                  throws WTException
Get the list of ContentItem's for the passed Aggregate. This should be done after a call to ContentHelper.service.getContents( ContentHolder )

Supported API: true

Parameters:
agg -
Returns:
Vector
Throws:
WTException

getContentListAll

public static Vector getContentListAll(ContentHolder holder)
                                throws WTException
Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will return the primary content for a FormatContentHolder, as well as any other attached content.

Supported API: true

Parameters:
holder -
Returns:
Vector
Throws:
WTException

getApplicationDataExcludeRoles

public static Vector getApplicationDataExcludeRoles(ContentHolder holder,
                                                    String excludeRoles)
                                             throws WTException
Get the list of ApplicationData objects out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) This will NOT return the primary for a FormatContentHolder. This method will also exclude any objects of the ContentRoleTypes in the role String input.

Supported API: true

Parameters:
holder -
excludeRoles - The list of roles that this method should exclude. The roles are in the external format like SECONDARY, THUMBNAIL, and THUMBNAIL3D. The roles should be in a comma delimited string. This method will convert them to the ContentRoleType objects. If a string in the list isn't converted because of an exception, that role type will not be excluded.
Returns:
Vector
Throws:
WTException

getContentListExcludeRoles

public static Vector getContentListExcludeRoles(ContentHolder holder,
                                                String excludeRoles)
                                         throws WTException
Get the list of ContentItem out of the passed ContentHolder This should be done after a call to ContentHelper.service.getContents( ContentHolder ) Note this will NOT return the primary content for a FormatContentHolder. This method will also exclude any objects of the ContentRoleTypes in the role String input.

Supported API: true

Parameters:
holder -
excludeRoles - The list of roles that this method should exclude. The roles are in the external format like SECONDARY, THUMBNAIL, and THUMBNAIL3D. The roles should be in a comma delimited string. This method will convert them to the ContentRoleType objects. If a string in the list isn't converted because of an exception, that role type will not be excluded.
Returns:
Vector
Throws:
WTException

getDownloadURL

public static URL getDownloadURL(ContentHolder holder,
                                 ApplicationData appData,
                                 boolean replicatedContent)
                          throws WTException
Generates a URL that can be used in download from the server. The URL points to the document which contains a list of possible download URLs. Based on replicatedContent input argument, URLs to replicated content can be included.

Supported API: true

Parameters:
holder -
appData -
replicatedContent -
Returns:
URL
Throws:
WTException

getDownloadURL

public static URL getDownloadURL(ContentHolder holder,
                                 ApplicationData appData,
                                 String fileName)
                          throws WTException
Generates a URL that can be used in download from the server.

Supported API: false

Parameters:
holder -
appData -
Returns:
URL
Throws:
WTException

getDownloadURL

public static URL getDownloadURL(ContentHolder holder,
                                 ApplicationData appData,
                                 boolean replicatedContent,
                                 String fileName)
                          throws WTException
Generates a URL that can be used in download from the server. The URL points to the document which contains a list of possible download URLs. Based on replicatedContent input argument, URLs to replicated content can be included.

Supported API: true

Parameters:
holder -
appData -
replicatedContent -
fileName -
Returns:
URL
Throws:
WTException

getExcludeRoles

private static Vector getExcludeRoles(String excludeRoles)