wt.content
Class ApplicationData

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.content.ContentItem
          extended bywt.content.ApplicationData
All Implemented Interfaces:
BusinessInformation, DisplayIdentification, Externalizable, NetFactor, ObjectMappable, Persistable, Serializable
Direct Known Subclasses:
Aggregate

public class ApplicationData
extends ContentItem
implements Externalizable

Handles the file system information for the content data. This class is aggregated into classes implementing the ContentHolder interface.

Use the newApplicationData static factory method(s), not the ApplicationData constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
static String APP_DATA_KEY
           
private  long checksum
           
static String CHECKSUM
          Label for the attribute; The checksum of the uploaded file

Supported API: false
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
static String FILE_NAME
          Label for the attribute; The fileName of this piece of content.
private static int FILE_NAME_UPPER_LIMIT
           
static String FILE_SIZE
          Label for the attribute; The byte size of the uploaded file

Supported API: false
private  String fileName
           
private  long fileSize
           
static String HOLDER_KEY
           
private  String HTTP_CLASS
           
static String INTENDED_FOR_HTTP_OP
          Label for the attribute; This is a non-persisted attribute that is used to mark ApplicationData objects as intended for Upload or Download.
private  boolean intendedForHttpOp
           
 boolean newContent
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static String STREAM_DATA
          Label for the attribute.
static String STREAM_ID
          Label for the attribute.
private  ObjectReference streamData
           
private  long streamId
           
static String UPLOADED_FROM_PATH
          Label for the attribute; The path where this piece of content was uploaded from

Supported API: true
private static int UPLOADED_FROM_PATH_UPPER_LIMIT
           
private  String uploadedFromPath
           
static String VIEW_METHOD
           
 
Fields inherited from class wt.content.ContentItem
CATEGORY, CREATED_BY, DESCRIPTION, FORMAT, FORMAT_NAME, HOLDER_LINK, INTENT_TO_CHANGE, ROLE, STALE
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.fc.BusinessInformation
BUSINESS_TYPE, IDENTITY
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
ApplicationData()
           
 
Method Summary
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
private  void fileNameValidate(String a_FileName)
           
 String getBusinessType()
          

Supported API: false
 long getChecksum()
          Gets the value of the attribute: CHECKSUM.
 String getConceptualClassname()
          Deprecated.  
 String getFileName()
          Gets the value of the attribute: FILE_NAME.
 long getFileSize()
          Gets the value of the attribute: FILE_SIZE.
 float getFileSizeKB()
          

Supported API: false
 String getIdentity()
          

Supported API: false
 ObjectReference getStreamData()
          Gets the object for the association that plays role: STREAM_DATA.
 long getStreamId()
          Gets the value of the attribute: STREAM_ID.
 String getUploadedFromPath()
          Gets the value of the attribute: UPLOADED_FROM_PATH.
 URL getViewContentURL(ContentHolder holder)
          Generates a URL that can be used in a AppletContext.showDocument( ) call from an applet.
 URL getViewContentURL(ContentHolder holder, boolean withSign)
          Generates a URL that can be used in a AppletContext.showDocument() call from an applet.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize(ContentHolder holder)
          Supports initialization, following construction of an instance.
 boolean isIntendedForHttpOp()
          Gets the value of the attribute: INTENDED_FOR_HTTP_OP.
static ApplicationData newApplicationData(ContentHolder holder)
          Instatiates a new ApplicationData object based on a ContentHolder

Supported API: true
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
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(ApplicationData thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private static float roundToTwoDecimals(float number)
           
 void setChecksum(long a_Checksum)
          Sets the value of the attribute: CHECKSUM.
 void setFileName(String a_FileName)
          Sets the value of the attribute: FILE_NAME.
 void setFileSize(long a_FileSize)
          Sets the value of the attribute: FILE_SIZE.
 void setIntendedForHttpOp(boolean a_IntendedForHttpOp)
          Sets the value of the attribute: INTENDED_FOR_HTTP_OP.
 void setStreamData(ObjectReference a_StreamData)
          Sets the object for the association that plays role: STREAM_DATA.
 void setStreamId(long a_StreamId)
          Sets the value of the attribute: STREAM_ID.
 void setUploadedFromPath(String a_UploadedFromPath)
          Sets the value of the attribute: UPLOADED_FROM_PATH.
private  void streamDataValidate(ObjectReference a_StreamData)
           
private  void uploadedFromPathValidate(String a_UploadedFromPath)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.content.ContentItem
getCategory, getCreatedBy, getDescription, getFormat, getFormatName, getHolderLink, getIntentToChange, getRole, isStale, readVersion, setCategory, setCreatedBy, setDescription, setFormat, setFormatName, setHolderLink, setIntentToChange, setRole, setStale
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, initialize, readVersion, setPersistInfo, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

UPLOADED_FROM_PATH

public static final String UPLOADED_FROM_PATH
Label for the attribute; The path where this piece of content was uploaded from

Supported API: true

See Also:
Constant Field Values

UPLOADED_FROM_PATH_UPPER_LIMIT

private static int UPLOADED_FROM_PATH_UPPER_LIMIT

uploadedFromPath

private String uploadedFromPath

FILE_NAME

public static final String FILE_NAME
Label for the attribute; The fileName of this piece of content. This is what the name of the file was when you originally uploaded it.

Supported API: true

See Also:
Constant Field Values

FILE_NAME_UPPER_LIMIT

private static int FILE_NAME_UPPER_LIMIT

fileName

private String fileName

FILE_SIZE

public static final String FILE_SIZE
Label for the attribute; The byte size of the uploaded file

Supported API: false

See Also:
Constant Field Values

fileSize

private long fileSize

INTENDED_FOR_HTTP_OP

public static final String INTENDED_FOR_HTTP_OP
Label for the attribute; This is a non-persisted attribute that is used to mark ApplicationData objects as intended for Upload or Download. This is to be used with the methods ContentHelper.service.contentUpdateUpload( ) ContentHelper.service.contentUpdateDownload( )

Supported API: false

See Also:
ContentService, ContentHelper, Constant Field Values

intendedForHttpOp

private boolean intendedForHttpOp

CHECKSUM

public static final String CHECKSUM
Label for the attribute; The checksum of the uploaded file

Supported API: false

See Also:
Constant Field Values

checksum

private long checksum

STREAM_ID

public static final String STREAM_ID
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

streamId

private long streamId

STREAM_DATA

public static final String STREAM_DATA
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

streamData

private ObjectReference streamData

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

VIEW_METHOD

public static final String VIEW_METHOD
See Also:
Constant Field Values

HTTP_CLASS

private String HTTP_CLASS

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

newContent

public boolean newContent
Constructor Detail

ApplicationData

public ApplicationData()
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
Overrides:
writeExternal in class ContentItem
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
Overrides:
readExternal in class ContentItem
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ApplicationData 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

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class ContentItem
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class ContentItem
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getUploadedFromPath

public String getUploadedFromPath()
Gets the value of the attribute: UPLOADED_FROM_PATH. The path where this piece of content was uploaded from

Supported API: true

Returns:
String

setUploadedFromPath

public void setUploadedFromPath(String a_UploadedFromPath)
                         throws WTPropertyVetoException
Sets the value of the attribute: UPLOADED_FROM_PATH. The path where this piece of content was uploaded from

Supported API: true

Parameters:
a_UploadedFromPath -
Throws:
WTPropertyVetoException

uploadedFromPathValidate

private void uploadedFromPathValidate(String a_UploadedFromPath)
                               throws WTPropertyVetoException
Parameters:
a_UploadedFromPath -
Throws:
WTPropertyVetoException

getFileName

public String getFileName()
Gets the value of the attribute: FILE_NAME. The fileName of this piece of content. This is what the name of the file was when you originally uploaded it.

Supported API: true

Returns:
String

setFileName

public void setFileName(String a_FileName)
                 throws WTPropertyVetoException
Sets the value of the attribute: FILE_NAME. The fileName of this piece of content. This is what the name of the file was when you originally uploaded it.

Supported API: true

Parameters:
a_FileName -
Throws:
WTPropertyVetoException

fileNameValidate

private void fileNameValidate(String a_FileName)
                       throws WTPropertyVetoException
Parameters:
a_FileName -
Throws:
WTPropertyVetoException

getFileSize

public long getFileSize()
Gets the value of the attribute: FILE_SIZE. The byte size of the uploaded file

Supported API: false

Returns:
long

setFileSize

public void setFileSize(long a_FileSize)
                 throws WTPropertyVetoException
Sets the value of the attribute: FILE_SIZE. The byte size of the uploaded file

Supported API: false

Parameters:
a_FileSize -
Throws:
WTPropertyVetoException

isIntendedForHttpOp

public boolean isIntendedForHttpOp()
Gets the value of the attribute: INTENDED_FOR_HTTP_OP. This is a non-persisted attribute that is used to mark ApplicationData objects as intended for Upload or Download. This is to be used with the methods ContentHelper.service.contentUpdateUpload( ) ContentHelper.service.contentUpdateDownload( )

Supported API: false

Returns:
boolean
See Also:
ContentService, ContentHelper

setIntendedForHttpOp

public void setIntendedForHttpOp(boolean a_IntendedForHttpOp)
                          throws WTPropertyVetoException
Sets the value of the attribute: INTENDED_FOR_HTTP_OP. This is a non-persisted attribute that is used to mark ApplicationData objects as intended for Upload or Download. This is to be used with the methods ContentHelper.service.contentUpdateUpload( ) ContentHelper.service.contentUpdateDownload( )

Supported API: false

Parameters:
a_IntendedForHttpOp -
Throws:
WTPropertyVetoException
See Also:
ContentService, ContentHelper

getChecksum

public long getChecksum()
Gets the value of the attribute: CHECKSUM. The checksum of the uploaded file

Supported API: false

Returns:
long

setChecksum

public void setChecksum(long a_Checksum)
                 throws WTPropertyVetoException
Sets the value of the attribute: CHECKSUM. The checksum of the uploaded file

Supported API: false

Parameters:
a_Checksum -
Throws:
WTPropertyVetoException

getStreamId

public long getStreamId()
Gets the value of the attribute: STREAM_ID.

Supported API: false

Returns:
long

setStreamId

public void setStreamId(long a_StreamId)
                 throws WTPropertyVetoException
Sets the value of the attribute: STREAM_ID.

Supported API: false

Parameters:
a_StreamId -
Throws:
WTPropertyVetoException

getStreamData

public ObjectReference getStreamData()
Gets the object for the association that plays role: STREAM_DATA.

Supported API: false

Returns:
ObjectReference

setStreamData

public void setStreamData(ObjectReference a_StreamData)
                   throws WTPropertyVetoException
Sets the object for the association that plays role: STREAM_DATA.

Supported API: false

Parameters:
a_StreamData -
Throws:
WTPropertyVetoException

streamDataValidate

private void streamDataValidate(ObjectReference a_StreamData)
                         throws WTPropertyVetoException
Parameters:
a_StreamData -
Throws:
WTPropertyVetoException

newApplicationData

public static ApplicationData newApplicationData(ContentHolder holder)
                                          throws WTException
Instatiates a new ApplicationData object based on a ContentHolder

Supported API: true

Parameters:
holder -
Returns:
ApplicationData
Throws:
WTException

initialize

protected void initialize(ContentHolder holder)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
holder -
Throws:
WTException

getViewContentURL

public URL getViewContentURL(ContentHolder holder)
                      throws WTException
Generates a URL that can be used in a AppletContext.showDocument( ) call from an applet. This will initiate a download of the given ApplicationData object.

Supported API: true

Parameters:
holder -
Returns:
URL
Throws:
WTException

getIdentity

public String getIdentity()


Supported API: false

Specified by:
getIdentity in interface BusinessInformation
Overrides:
getIdentity in class ContentItem
Returns:
String

getBusinessType

public String getBusinessType()


Supported API: false

Specified by:
getBusinessType in interface BusinessInformation
Overrides:
getBusinessType in class ContentItem
Returns:
String

getFileSizeKB

public float getFileSizeKB()


Supported API: false

Returns:
float

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class ContentItem
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class ContentItem
Returns:
int

roundToTwoDecimals

private static float roundToTwoDecimals(float number)

getViewContentURL

public URL getViewContentURL(ContentHolder holder,
                             boolean withSign)
                      throws WTException
Generates a URL that can be used in a AppletContext.showDocument() call from an applet. This will initiate a download of the given ApplicationData object. If withSign is set to false (for internal use only), then the URL is not signed

Supported API: false

Parameters:
holder -
withSign - Normally it is true.
Returns:
URL
Throws:
WTException