wt.content
Class DataFormat

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.fc.Item
          extended bywt.content.DataFormat
All Implemented Interfaces:
AccessControlled, BusinessInformation, DisplayIdentification, DomainAdministered, Externalizable, Identified, NetFactor, ObjectMappable, Persistable, Serializable

public class DataFormat
extends Item
implements BusinessInformation, Identified, Externalizable

Populated with all the allowable mime-types and displayed FormatNames in the system. The system will not run correctly unless the initial set of this is populated. You need to be an administrator to create these objects. Note that the formatName is contrained by the DataFormatIdentity class and must be unique. You may not extend this class.

Use the newDataFormat static factory method(s), not the DataFormat 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:
DataFormatIdentity, DataFormatKey, ContentService, Serialized Form

Field Summary
private static String CLASSNAME
           
private  String description
           
static String DESCRIPTION
          Label for the attribute; Descriptive string for this format.
private static int DESCRIPTION_UPPER_LIMIT
           
private  Vector extensions
           
static String EXTENSIONS
          Label for the attribute.
static long EXTERNALIZATION_VERSION_UID
           
static String FILE_FORMAT_ONLY
          Label for the attribute; True if this mimeType is only applicable to ApplicationData objects.
private  boolean fileFormatOnly
           
static String FORMAT_NAME
          Label for the attribute; The displayable format name for this object

Supported API: false
private static int FORMAT_NAME_UPPER_LIMIT
           
private static String FORMAT_RESOURCE
           
private  String formatName
           
private  boolean indexable
           
static String INDEXABLE
          Label for the attribute; True if this DataFormat type is indexable by the system.
static String MIME_TYPE
          Label for the attribute; The MIME type for this format.
private static int MIME_TYPE_UPPER_LIMIT
           
private  String mimeType
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static String STANDARD_ICON_STR
          Label for the attribute; A string that points to a representative icon for this format type.
private static int STANDARD_ICON_STR_UPPER_LIMIT
           
private  String standardIconStr
           
 
Fields inherited from class wt.fc.Item
VERSION_40_UID, VERSION_51_UID
 
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.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
DataFormat()
           
 
Method Summary
private  void descriptionValidate(String a_Description)
           
 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 formatNameValidate(String a_FormatName)
           
 String getBusinessType()
          Deprecated. Replaced by IdentityFactory.getDispayType(object) to return a localizable equivalent of getBusinessType(). Another alternative is ((WTObject)obj).getDisplayType().
 String getConceptualClassname()
          Deprecated.  
 String getDescription()
          Gets the value of the attribute: DESCRIPTION.
 Vector getExtensions()
          Gets the value of the attribute: EXTENSIONS.
 String getFormatName()
          Gets the value of the attribute: FORMAT_NAME.
 IdentificationObject getIdentificationObject()
          

Supported API: false
 String getIdentity()
          

Supported API: false
static String getLocalizedFormatName(String key, Locale locale)
          Utility method to return localized value of the key
 String getMimeType()
          Gets the value of the attribute: MIME_TYPE.
 String getStandardIconStr()
          Gets the value of the attribute: STANDARD_ICON_STR.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize()
          

Supported API: false
protected  void initialize(String aFormatName)
          Supports initialization, following construction of an instance.
 boolean isFileFormatOnly()
          Gets the value of the attribute: FILE_FORMAT_ONLY.
 boolean isIndexable()
          Gets the value of the attribute: INDEXABLE.
private  void mimeTypeValidate(String a_MimeType)
           
static DataFormat newDataFormat(String aFormatName)
          

Supported API: false
 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(DataFormat thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setDescription(String a_Description)
          Sets the value of the attribute: DESCRIPTION.
 void setExtensions(Vector a_Extensions)
          Sets the value of the attribute: EXTENSIONS.
 void setFileFormatOnly(boolean a_FileFormatOnly)
          Sets the value of the attribute: FILE_FORMAT_ONLY.
protected  void setFormatName(String a_FormatName)
          Sets the value of the attribute: FORMAT_NAME.
 void setIndexable(boolean a_Indexable)
          Sets the value of the attribute: INDEXABLE.
 void setMimeType(String a_MimeType)
          Sets the value of the attribute: MIME_TYPE.
 void setStandardIconStr(String a_StandardIconStr)
          Sets the value of the attribute: STANDARD_ICON_STR.
private  void standardIconStrValidate(String a_StandardIconStr)
           
 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.fc.Item
getDomainRef, isInheritedDomain, readVersion, setDomainRef, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.Persistable
checkAttributes, getPersistInfo, getType, setPersistInfo
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

FORMAT_NAME

public static final String FORMAT_NAME
Label for the attribute; The displayable format name for this object

Supported API: false

See Also:
Constant Field Values

FORMAT_NAME_UPPER_LIMIT

private static int FORMAT_NAME_UPPER_LIMIT

formatName

private String formatName

MIME_TYPE

public static final String MIME_TYPE
Label for the attribute; The MIME type for this format. Content will be downloaded with mime type. You can configure your browser to deal with different MIME types. See your browser documentation for more information on how to do this.

Supported API: false

See Also:
Constant Field Values

MIME_TYPE_UPPER_LIMIT

private static int MIME_TYPE_UPPER_LIMIT

mimeType

private String mimeType

DESCRIPTION

public static final String DESCRIPTION
Label for the attribute; Descriptive string for this format.

Supported API: false

See Also:
Constant Field Values

DESCRIPTION_UPPER_LIMIT

private static int DESCRIPTION_UPPER_LIMIT

description

private String description

INDEXABLE

public static final String INDEXABLE
Label for the attribute; True if this DataFormat type is indexable by the system.

Supported API: false

See Also:
Constant Field Values

indexable

private boolean indexable

FILE_FORMAT_ONLY

public static final String FILE_FORMAT_ONLY
Label for the attribute; True if this mimeType is only applicable to ApplicationData objects. This would be true for formats like "Microsoft Word", "Postscript" etc. It would be false for "URL Link" and "File Set".

Supported API: false

See Also:
Constant Field Values

fileFormatOnly

private boolean fileFormatOnly

STANDARD_ICON_STR

public static final String STANDARD_ICON_STR
Label for the attribute; A string that points to a representative icon for this format type. The default icon for example is wt/clients/images/generic.gif.

Supported API: false

See Also:
Constant Field Values

STANDARD_ICON_STR_UPPER_LIMIT

private static int STANDARD_ICON_STR_UPPER_LIMIT

standardIconStr

private String standardIconStr

EXTENSIONS

public static final String EXTENSIONS
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

extensions

private Vector extensions

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

FORMAT_RESOURCE

private static final String FORMAT_RESOURCE
See Also:
Constant Field Values
Constructor Detail

DataFormat

public DataFormat()
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 Item
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 Item
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

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

getFormatName

public String getFormatName()
Gets the value of the attribute: FORMAT_NAME. The displayable format name for this object

Supported API: false

Returns:
String

setFormatName

protected void setFormatName(String a_FormatName)
                      throws WTPropertyVetoException
Sets the value of the attribute: FORMAT_NAME. The displayable format name for this object

Supported API: false

Parameters:
a_FormatName -
Throws:
WTPropertyVetoException

formatNameValidate

private void formatNameValidate(String a_FormatName)
                         throws WTPropertyVetoException
Parameters:
a_FormatName -
Throws:
WTPropertyVetoException

getMimeType

public String getMimeType()
Gets the value of the attribute: MIME_TYPE. The MIME type for this format. Content will be downloaded with mime type. You can configure your browser to deal with different MIME types. See your browser documentation for more information on how to do this.

Supported API: false

Returns:
String

setMimeType

public void setMimeType(String a_MimeType)
                 throws WTPropertyVetoException
Sets the value of the attribute: MIME_TYPE. The MIME type for this format. Content will be downloaded with mime type. You can configure your browser to deal with different MIME types. See your browser documentation for more information on how to do this.

Supported API: false

Parameters:
a_MimeType -
Throws:
WTPropertyVetoException

mimeTypeValidate

private void mimeTypeValidate(String a_MimeType)
                       throws WTPropertyVetoException
Parameters:
a_MimeType -
Throws:
WTPropertyVetoException

getDescription

public String getDescription()
Gets the value of the attribute: DESCRIPTION. Descriptive string for this format.

Supported API: false

Returns:
String

setDescription

public void setDescription(String a_Description)
                    throws WTPropertyVetoException
Sets the value of the attribute: DESCRIPTION. Descriptive string for this format.

Supported API: false

Parameters:
a_Description -
Throws:
WTPropertyVetoException

descriptionValidate

private void descriptionValidate(String a_Description)
                          throws WTPropertyVetoException
Parameters:
a_Description -
Throws:
WTPropertyVetoException

isIndexable

public boolean isIndexable()
Gets the value of the attribute: INDEXABLE. True if this DataFormat type is indexable by the system.

Supported API: false

Returns:
boolean

setIndexable

public void setIndexable(boolean a_Indexable)
                  throws WTPropertyVetoException
Sets the value of the attribute: INDEXABLE. True if this DataFormat type is indexable by the system.

Supported API: false

Parameters:
a_Indexable -
Throws:
WTPropertyVetoException

isFileFormatOnly

public boolean isFileFormatOnly()
Gets the value of the attribute: FILE_FORMAT_ONLY. True if this mimeType is only applicable to ApplicationData objects. This would be true for formats like "Microsoft Word", "Postscript" etc. It would be false for "URL Link" and "File Set".

Supported API: false

Returns:
boolean

setFileFormatOnly

public void setFileFormatOnly(boolean a_FileFormatOnly)
                       throws WTPropertyVetoException
Sets the value of the attribute: FILE_FORMAT_ONLY. True if this mimeType is only applicable to ApplicationData objects. This would be true for formats like "Microsoft Word", "Postscript" etc. It would be false for "URL Link" and "File Set".

Supported API: false

Parameters:
a_FileFormatOnly -
Throws:
WTPropertyVetoException

getStandardIconStr

public String getStandardIconStr()
Gets the value of the attribute: STANDARD_ICON_STR. A string that points to a representative icon for this format type. The default icon for example is wt/clients/images/generic.gif.

Supported API: false

Returns:
String

setStandardIconStr

public void setStandardIconStr(String a_StandardIconStr)
                        throws WTPropertyVetoException
Sets the value of the attribute: STANDARD_ICON_STR. A string that points to a representative icon for this format type. The default icon for example is wt/clients/images/generic.gif.

Supported API: false

Parameters:
a_StandardIconStr -
Throws:
WTPropertyVetoException

standardIconStrValidate

private void standardIconStrValidate(String a_StandardIconStr)
                              throws WTPropertyVetoException
Parameters:
a_StandardIconStr -
Throws:
WTPropertyVetoException

getExtensions

public Vector getExtensions()
Gets the value of the attribute: EXTENSIONS.

Supported API: false

Returns:
Vector

setExtensions

public void setExtensions(Vector a_Extensions)
                   throws WTPropertyVetoException
Sets the value of the attribute: EXTENSIONS.

Supported API: false

Parameters:
a_Extensions -
Throws:
WTPropertyVetoException

getIdentity

public String getIdentity()


Supported API: false

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

getIdentificationObject

public IdentificationObject getIdentificationObject()
                                             throws WTException


Supported API: false

Specified by:
getIdentificationObject in interface Identified
Returns:
IdentificationObject
Throws:
WTException

newDataFormat

public static DataFormat newDataFormat(String aFormatName)
                                throws WTException


Supported API: false

Parameters:
aFormatName -
Returns:
DataFormat
Throws:
WTException

initialize

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

Supported API: false

Parameters:
aFormatName -
Throws:
WTException

getBusinessType

public String getBusinessType()
Deprecated. Replaced by IdentityFactory.getDispayType(object) to return a localizable equivalent of getBusinessType(). Another alternative is ((WTObject)obj).getDisplayType().

Gets the value of the attribute: BUSINESS_TYPE. Identifies the type of the object for business purposes. This is typically the class name of the object but may be derived from some other attribute of the object.

Supported API: false

Specified by:
getBusinessType in interface BusinessInformation
Returns:
String

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 Item
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 Item
Returns:
int

initialize

protected void initialize()
                   throws WTException
Description copied from class: Item


Supported API: false

Overrides:
initialize in class Item
Throws:
WTException

getLocalizedFormatName

public static String getLocalizedFormatName(String key,
                                            Locale locale)
Utility method to return localized value of the key

Parameters:
key -
Returns:
String