org.opengts.db.tables
Class Resource

java.lang.Object
  extended by org.opengts.dbtools.DBRecord<RT>
      extended by org.opengts.db.AccountRecord<Resource>
          extended by org.opengts.db.tables.Resource

public class Resource
extends AccountRecord<Resource>


Nested Class Summary
static class Resource.Dimension
           
static class Resource.Key
           
 
Nested classes/interfaces inherited from class org.opengts.db.AccountRecord
AccountRecord.AccountKey<RT extends DBRecord>
 
Nested classes/interfaces inherited from class org.opengts.dbtools.DBRecord
DBRecord.DBChangeListener
 
Field Summary
static java.lang.String FLD_properties
           
static java.lang.String FLD_resourceID
           
static java.lang.String FLD_title
           
static java.lang.String FLD_type
           
static java.lang.String FLD_value
           
static java.lang.String PROP_HEIGHT
           
static java.lang.String PROP_ICON_HEIGHT
           
static java.lang.String PROP_ICON_URL
           
static java.lang.String PROP_ICON_WIDTH
           
static java.lang.String PROP_WIDTH
           
static java.lang.String RESID_PrivateLabel_Properties_
           
static java.lang.String RESID_TemporaryProperties
           
static java.lang.String TYPE_BINARY
           
static java.lang.String TYPE_COLOR
           
static java.lang.String TYPE_HTML
           
static java.lang.String TYPE_IMAGE_
           
static java.lang.String TYPE_IMAGE_GENERIC
           
static java.lang.String TYPE_IMAGE_GIF
           
static java.lang.String TYPE_IMAGE_JPEG
           
static java.lang.String TYPE_IMAGE_PNG
           
static java.lang.String TYPE_RTPROPS
           
static java.lang.String TYPE_TEXT
           
static java.lang.String TYPE_URL
           
static java.lang.String TYPE_URL_
           
static java.lang.String TYPE_URL_IMAGE
           
static java.lang.String TYPE_URL_PDF
           
static java.lang.String TYPE_XML
           
 
Fields inherited from class org.opengts.db.AccountRecord
FLD_accountID, FLD_displayName, FLD_isActive, FLD_notes
 
Fields inherited from class org.opengts.dbtools.DBRecord
errorDescription, excludedUpdateFields, FLD_creationMillis, FLD_creationTime, FLD_description, FLD_lastUpdateAccount, FLD_lastUpdateTime, FLD_lastUpdateUser, hasError, ID_SIZE, isValidating, lastSQLException, NOTIFY_GROUP, PSEUDO_FIELD_CHAR, tempProps
 
Constructor Summary
Resource()
           
Resource(Resource.Key key)
           
 
Method Summary
protected static Resource _getResource(java.lang.String acctID, java.lang.String resID)
           
protected static Resource _getResource(java.lang.String acctID, java.lang.String resID, boolean create)
           
 RTProperties _getRTProperties()
           
protected  void _setProperties(java.lang.String v)
           
protected static boolean _setResource(java.lang.String acctID, java.lang.String resID, java.lang.String type, java.lang.String desc, java.lang.Object value)
          Creates/Sets the specified Resourse
static Resource createNewResource(Account account, java.lang.String resID)
          Create new Resource with key will throw DBException if resource key already exists
static boolean exists(java.lang.String acctID, java.lang.String resID)
           
 Resource.Dimension getDimension(int dftWidth, int dftHeight)
           
static DBFactory<Resource> getFactory()
           
static java.lang.Object getGlobalResourceValue(java.lang.String resID)
          Gets a global resource value (owned by the "sysadmin" account)
 Resource.Dimension getIconDimension(int dftWidth, int dftHeight)
           
 java.lang.String getIconURL(java.lang.String dft)
           
static RTProperties getPrivateLabelPropertiesForHost(java.lang.String hostName, java.lang.String urlPath)
          Gets the custom property resources for the specified hostname
 java.lang.String getProperties()
           
 double getProperty(java.lang.String key, double dft)
           
 int getProperty(java.lang.String key, int dft)
           
 long getProperty(java.lang.String key, long dft)
           
 java.lang.String getProperty(java.lang.String key, java.lang.String dft)
           
static Resource getResource(Account account, java.lang.String resID)
           
static Resource getResource(Account account, java.lang.String resID, boolean create)
           
 java.lang.String getResourceID()
           
static OrderedSet<java.lang.String> getResources(DBSelect<Resource> dsel)
           
static OrderedSet<java.lang.String> getResourcesForAccount(java.lang.String acctId, java.lang.String startsWith)
           
 RTProperties getRTProperties()
           
 java.lang.String getStringValue()
           
static java.lang.String getTableDescription(java.util.Locale loc)
           
 java.lang.String getTitle()
           
 java.lang.String getType()
           
 byte[] getValue()
           
 boolean isBinaryType()
           
static boolean isBinaryType(java.lang.String type)
          Returns true if the specified type represents a Binary value
 boolean isImage()
           
 boolean isImageURL()
           
 boolean isRTProperties()
           
 boolean isStringType()
           
static boolean isStringType(java.lang.String type)
          Returns true if the specified type represents a String
 boolean isURL()
           
static void main(java.lang.String[] args)
           
 void setCreationDefaultValues()
          Override to set default values
static boolean setGlobalResourceValue(java.lang.String resID, java.lang.String type, java.lang.String desc, java.lang.Object value)
          Creates/Sets a global resource (owned by the "sysadmin" account)
 void setProperties(java.lang.String v)
           
static boolean setResource(Account account, java.lang.String resID, java.lang.String type, java.lang.String desc, java.lang.Object value)
          Creates/Set the specified Resourse
 void setRTProperties(RTProperties v)
           
 void setStringValue(java.lang.String v)
           
 void setTitle(java.lang.String v)
           
 void setType(java.lang.String v)
           
 void setValue(byte[] v)
           
 void setValue(java.lang.Object v)
           
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Returns a String representation of the DBRecordKey for this DBRecord
 
Methods inherited from class org.opengts.db.AccountRecord
createSystemAdminAccount, getAccount, getAccountDescription, getAccountID, getDisplayName, getFilteredID, getFilteredID, getIsActive, getNotes, GetSimpleLocalString, getSystemAdminAccount, getSystemAdminAccountID, hasAccount, hasSystemAdminAccountID, isAccountManager, isActive, isSystemAdmin, isSystemAdmin, isSystemAdminAccountID, isValidID, newField_accountID, newField_accountID, newField_displayName, newField_displayName, newField_isActive, newField_isActive, newField_notes, newField_notes, setAccount, setDisplayName, setIsActive, setNotes, setRuntimeDefaultValues
 
Methods inherited from class org.opengts.dbtools.DBRecord
_getFactory, _reload, addChangedNotification, addExcludedUpdateFields, adjustStringLength_1, adjustStringLength, appendFieldValues, clearChanged, clearError, clearExcludedUpdateFields, clearLastCaughtSQLException, equals, excludeFieldFromUpdate, excludeFieldFromUpdate, fireChangeNotification, geKeyValue, getCreationDateTime, getCreationMillis, getCreationTime, GetCurrentAccount, GetCurrentUser, getDefaultFieldValueKey, getDescription, getErrorDescription, getFactory, getFactory, getField, getFieldBoolean, getFieldDateTime, getFieldDouble, getFieldFloat, getFieldInt, getFieldLong, getFieldName, getFieldString, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getKeyValue, getLastCaughtSQLException, getLastUpdateAccount, getLastUpdateTime, getLastUpdateTime, getLastUpdateUser, getNextGroup, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordKey, getRecords, getRecords, getTemporaryProperties, getValue, getVirtual, hasChanged, hasError, hasField, hasFieldValue, hasOptionalFieldValue, hasTemporaryProperties, insert, isFieldUnsigned, isLastCaughtSQLExceptionErrorCode, isOkToReload, isOkToSave, isValidating, isVirtual, lock, lockRead, lockWrite, newField_creationMillis, newField_creationTime, newField_creationTime, newField_description, newField_description, newField_lastUpdateAccount, newField_lastUpdateAccount, newField_lastUpdateTime, newField_lastUpdateUser, newField_lastUpdateUser, printXML, printXML, printXML, printXML, printXML, printXML, recordDidInsert, recordDidUpdate, recordWillInsert, recordWillUpdate, reload, reload, removeChangedNotification, save, select, select, select, setAllFieldValues, setAllFieldValues, setAllFieldValues, setAllFieldValues, setChanged, setChanged, setCreationMillis, setCreationTime, SetCurrentAccount, SetCurrentUser, setDescription, setError, setError, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setIgnoreInvalidFields, setKeyValue, setLastCaughtSQLException, setLastUpdateAccount, setLastUpdateTime, setLastUpdateUser, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setValidating, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVirtual, toXML, toXML, toXML, toXML, toXML, unlock, update, update, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESID_TemporaryProperties

public static final java.lang.String RESID_TemporaryProperties
See Also:
Constant Field Values

RESID_PrivateLabel_Properties_

public static final java.lang.String RESID_PrivateLabel_Properties_
See Also:
Constant Field Values

TYPE_TEXT

public static final java.lang.String TYPE_TEXT
See Also:
Constant Field Values

TYPE_XML

public static final java.lang.String TYPE_XML
See Also:
Constant Field Values

TYPE_HTML

public static final java.lang.String TYPE_HTML
See Also:
Constant Field Values

TYPE_URL

public static final java.lang.String TYPE_URL
See Also:
Constant Field Values

TYPE_URL_

public static final java.lang.String TYPE_URL_
See Also:
Constant Field Values

TYPE_URL_IMAGE

public static final java.lang.String TYPE_URL_IMAGE
See Also:
Constant Field Values

TYPE_URL_PDF

public static final java.lang.String TYPE_URL_PDF
See Also:
Constant Field Values

TYPE_IMAGE_

public static final java.lang.String TYPE_IMAGE_
See Also:
Constant Field Values

TYPE_IMAGE_JPEG

public static final java.lang.String TYPE_IMAGE_JPEG
See Also:
Constant Field Values

TYPE_IMAGE_GIF

public static final java.lang.String TYPE_IMAGE_GIF
See Also:
Constant Field Values

TYPE_IMAGE_PNG

public static final java.lang.String TYPE_IMAGE_PNG
See Also:
Constant Field Values

TYPE_IMAGE_GENERIC

public static final java.lang.String TYPE_IMAGE_GENERIC
See Also:
Constant Field Values

TYPE_BINARY

public static final java.lang.String TYPE_BINARY
See Also:
Constant Field Values

TYPE_RTPROPS

public static final java.lang.String TYPE_RTPROPS
See Also:
Constant Field Values

TYPE_COLOR

public static final java.lang.String TYPE_COLOR
See Also:
Constant Field Values

PROP_WIDTH

public static final java.lang.String PROP_WIDTH
See Also:
Constant Field Values

PROP_HEIGHT

public static final java.lang.String PROP_HEIGHT
See Also:
Constant Field Values

PROP_ICON_URL

public static final java.lang.String PROP_ICON_URL
See Also:
Constant Field Values

PROP_ICON_WIDTH

public static final java.lang.String PROP_ICON_WIDTH
See Also:
Constant Field Values

PROP_ICON_HEIGHT

public static final java.lang.String PROP_ICON_HEIGHT
See Also:
Constant Field Values

FLD_resourceID

public static final java.lang.String FLD_resourceID
See Also:
Constant Field Values

FLD_type

public static final java.lang.String FLD_type
See Also:
Constant Field Values

FLD_title

public static final java.lang.String FLD_title
See Also:
Constant Field Values

FLD_properties

public static final java.lang.String FLD_properties
See Also:
Constant Field Values

FLD_value

public static final java.lang.String FLD_value
See Also:
Constant Field Values
Constructor Detail

Resource

public Resource()

Resource

public Resource(Resource.Key key)
Method Detail

isStringType

public static boolean isStringType(java.lang.String type)
Returns true if the specified type represents a String

Parameters:
type - The specified type
Returns:
True if the specified represents a String value

isBinaryType

public static boolean isBinaryType(java.lang.String type)
Returns true if the specified type represents a Binary value

Parameters:
type - The specified type
Returns:
True if the specified represents a Binary value

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<Resource> getFactory()

getTableDescription

public static java.lang.String getTableDescription(java.util.Locale loc)

getResourceID

public java.lang.String getResourceID()

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String v)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String v)

isStringType

public boolean isStringType()

isBinaryType

public boolean isBinaryType()

isURL

public boolean isURL()

isImageURL

public boolean isImageURL()

isImage

public boolean isImage()

isRTProperties

public boolean isRTProperties()

getProperties

public java.lang.String getProperties()

setProperties

public void setProperties(java.lang.String v)

_setProperties

protected void _setProperties(java.lang.String v)

setRTProperties

public void setRTProperties(RTProperties v)

getRTProperties

public RTProperties getRTProperties()

_getRTProperties

public RTProperties _getRTProperties()

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String dft)

getProperty

public int getProperty(java.lang.String key,
                       int dft)

getProperty

public long getProperty(java.lang.String key,
                        long dft)

getProperty

public double getProperty(java.lang.String key,
                          double dft)

getDimension

public Resource.Dimension getDimension(int dftWidth,
                                       int dftHeight)

getIconURL

public java.lang.String getIconURL(java.lang.String dft)

getIconDimension

public Resource.Dimension getIconDimension(int dftWidth,
                                           int dftHeight)

getValue

public byte[] getValue()

setValue

public void setValue(byte[] v)

setValue

public void setValue(java.lang.Object v)

setStringValue

public void setStringValue(java.lang.String v)

getStringValue

public java.lang.String getStringValue()

setCreationDefaultValues

public void setCreationDefaultValues()
Description copied from class: DBRecord
Override to set default values

Overrides:
setCreationDefaultValues in class DBRecord<Resource>

toString

public java.lang.String toString()
Description copied from class: DBRecord
Returns a String representation of the DBRecordKey for this DBRecord

Overrides:
toString in class DBRecord<Resource>
Returns:
A String representation of the DBRecordKey for this DBRecord

exists

public static boolean exists(java.lang.String acctID,
                             java.lang.String resID)
                      throws DBException
Throws:
DBException

_getResource

protected static Resource _getResource(java.lang.String acctID,
                                       java.lang.String resID)
                                throws DBException
Throws:
DBException

getResource

public static Resource getResource(Account account,
                                   java.lang.String resID)
                            throws DBException
Throws:
DBException

getGlobalResourceValue

public static java.lang.Object getGlobalResourceValue(java.lang.String resID)
                                               throws DBException
Gets a global resource value (owned by the "sysadmin" account)

Throws:
DBException

getResource

public static Resource getResource(Account account,
                                   java.lang.String resID,
                                   boolean create)
                            throws DBException
Throws:
DBException

_getResource

protected static Resource _getResource(java.lang.String acctID,
                                       java.lang.String resID,
                                       boolean create)
                                throws DBException
Throws:
DBException

createNewResource

public static Resource createNewResource(Account account,
                                         java.lang.String resID)
                                  throws DBException
Create new Resource with key will throw DBException if resource key already exists

Parameters:
account - The Account
resID - The Resource-ID
Throws:
DBException - if Account/Resource-ID already exists

setResource

public static boolean setResource(Account account,
                                  java.lang.String resID,
                                  java.lang.String type,
                                  java.lang.String desc,
                                  java.lang.Object value)
                           throws DBException
Creates/Set the specified Resourse

Parameters:
account - The Account
resID - The Resource-ID
type - The Resource type
desc - The Resource description
value - The Resource value
Returns:
True if there was an existing resource which was overwritten
Throws:
DBException

_setResource

protected static boolean _setResource(java.lang.String acctID,
                                      java.lang.String resID,
                                      java.lang.String type,
                                      java.lang.String desc,
                                      java.lang.Object value)
                               throws DBException
Creates/Sets the specified Resourse

Parameters:
acctID - The Account-ID
resID - The Resource-ID
type - The Resource type
desc - The Resource description
value - The Resource value
Returns:
True if there was an existing resource which was overwritten
Throws:
DBException

setGlobalResourceValue

public static boolean setGlobalResourceValue(java.lang.String resID,
                                             java.lang.String type,
                                             java.lang.String desc,
                                             java.lang.Object value)
                                      throws DBException
Creates/Sets a global resource (owned by the "sysadmin" account)

Throws:
DBException

getResourcesForAccount

public static OrderedSet<java.lang.String> getResourcesForAccount(java.lang.String acctId,
                                                                  java.lang.String startsWith)
                                                           throws DBException
Throws:
DBException

getResources

public static OrderedSet<java.lang.String> getResources(DBSelect<Resource> dsel)
                                                 throws DBException
Throws:
DBException

getPrivateLabelPropertiesForHost

public static RTProperties getPrivateLabelPropertiesForHost(java.lang.String hostName,
                                                            java.lang.String urlPath)
Gets the custom property resources for the specified hostname

Returns:
The Resource RTProperties, or null if the properties are not found

main

public static void main(java.lang.String[] args)