|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.portalpages.common.helpers.ModelHelper
public class ModelHelper
Constructor Summary | |
---|---|
ModelHelper()
|
Method Summary | |
---|---|
static boolean |
CheckIsURLString(java.lang.String strIn)
Checks that a string starts with http:// or https://. |
static boolean |
GetFormElementBool(XPHashtable _htFormData,
java.lang.String strFormElement,
boolean bDefault)
Gets a boolean Form Element from a hashtable of form data - returns the default value if the form element was not found or is empty. |
static PTDuration |
GetFormElementDuration(XPHashtable _htFormData,
java.lang.String strFormElementDurationInput,
java.lang.String strFormElementDurationUnitsSelect,
PTDuration ptdDefault)
Gets a boolean Form Element from a hashtable of form data - returns the default value if the form element was not found or is empty. |
static int |
GetFormElementInt(XPHashtable _htFormData,
java.lang.String strFormElement,
int nDefault)
Gets an integer Form Element from a hashtable of form data - returns the default value if the form element was not found or is empty. |
static long |
GetFormElementLong(XPHashtable _htFormData,
java.lang.String strFormElement,
long lDefault)
Gets a long Form Element from a hashtable of form data - returns the default value if the form element was not found or is empty. |
static java.lang.String |
GetFormElementString(XPHashtable _htFormData,
java.lang.String strFormElement,
java.lang.String strDefault)
Gets a string Form Element from a hashtable of form data - returns the default value if the form element was not found or is empty. |
static boolean |
HasTrailingSlash(java.lang.String strIn)
|
static boolean |
IsBlankString(java.lang.String sData)
Checks to see if the string array passed in is null or of zero length |
static boolean |
IsBlankStringArray(java.lang.String[] arsData)
Checks to see if the string array passed in is null or of zero length OR the first element is a blank string. |
static boolean |
IsEmptyStringArray(java.lang.String[] arsData)
Checks to see if the string array passed in is null or of zero length |
static XPArrayList |
ObjectArrayToXPArray(java.lang.Object[] arObj)
Translates an Object array into an XPArrayList. |
static boolean |
ObjectToBool(java.lang.Object objValue,
boolean bDefault)
Returns the value of objValue or bDefault if objValue is null or the conversion fails. |
static int |
ObjectToInt(java.lang.Object objValue,
int nDefault)
Returns the value of objValue or nDefault if objValue is null or the conversion fails. |
static boolean |
PBReadBool(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
boolean bDefault)
Reads a boolean value from a property bag. |
static int |
PBReadInt(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
int nDefault)
Reads an int value from a property bag. |
static java.lang.String |
PBReadString(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
java.lang.String strDefault)
Reads a String value from a property bag. |
static void |
PBWrite(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
boolean bValue)
Writes a value to a property bag. |
static void |
PBWrite(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
int nValue)
Writes a value to a property bag. |
static void |
PBWrite(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
long lValue)
Writes a value to a property bag. |
static void |
PBWrite(IXPPropertyBag ptPropBag,
java.lang.String sPropID,
java.lang.String strValue)
Writes a value to a property bag. |
static XPArrayList |
StringArrayToXPArray(java.lang.String[] arsIn)
|
static java.lang.String |
TrimAllTrailingSlashes(java.lang.String strIn)
|
static java.lang.String |
TrimTrailingSlash(java.lang.String strIn)
|
static int |
ValidateBool(boolean bValid,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError)
Validates an arbitrary boolean. |
static int |
ValidateDurationRange(PTDuration ptdIn,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError,
long lMinMilli,
long lMaxMilli)
Validates that a specified Duration falls within the specified duration range (specified in milliseconds). |
static int |
ValidateIntegerRange(int nIn,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError,
int nMin,
int nMax)
Validates that an integer is within the specified range (nMin to nMax). |
static int |
ValidateIsURLString(java.lang.String strIn,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError)
Validates that a string starts with http:// or https://. |
static int |
ValidateLoginPassword(java.lang.String strLogin,
java.lang.String strPassword,
java.lang.String strNULLPASSWORD,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError)
Validates that both a login and password were set. |
static int |
ValidateNonEmptyString(java.lang.String strIn,
AActivitySpace asOwner,
java.lang.String strError,
int nLastError)
Validates that a string is non-empty. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelHelper()
Method Detail |
---|
public static boolean GetFormElementBool(XPHashtable _htFormData, java.lang.String strFormElement, boolean bDefault)
_htFormData
- strFormElement
- bDefault
- TODO bug 45991: Remove this unused parameter, since a default of "true" makes no sense for a checkbox. If the checkbox value is absent from the form post, it was not checked.
public static PTDuration GetFormElementDuration(XPHashtable _htFormData, java.lang.String strFormElementDurationInput, java.lang.String strFormElementDurationUnitsSelect, PTDuration ptdDefault)
_htFormData
- strFormElementDurationInput
- strFormElementDurationUnitsSelect
- ptdDefault
-
public static boolean IsEmptyStringArray(java.lang.String[] arsData)
data
-
public static boolean IsBlankStringArray(java.lang.String[] arsData)
data
-
public static boolean IsBlankString(java.lang.String sData)
data
-
public static int GetFormElementInt(XPHashtable _htFormData, java.lang.String strFormElement, int nDefault)
_htFormData
- strFormElement
- nDefault
-
public static long GetFormElementLong(XPHashtable _htFormData, java.lang.String strFormElement, long lDefault)
_htFormData
- strFormElement
- lDefault
-
public static java.lang.String GetFormElementString(XPHashtable _htFormData, java.lang.String strFormElement, java.lang.String strDefault)
_htFormData
- strFormElement
- strDefault
-
public static XPArrayList ObjectArrayToXPArray(java.lang.Object[] arObj)
arObj
-
public static boolean ObjectToBool(java.lang.Object objValue, boolean bDefault)
public static int ObjectToInt(java.lang.Object objValue, int nDefault)
public static boolean PBReadBool(IXPPropertyBag ptPropBag, java.lang.String sPropID, boolean bDefault)
sPropID
- ptPropBag
- bDefault
-
public static int PBReadInt(IXPPropertyBag ptPropBag, java.lang.String sPropID, int nDefault)
sPropID
- ptPropBag
- nDefault
-
public static java.lang.String PBReadString(IXPPropertyBag ptPropBag, java.lang.String sPropID, java.lang.String strDefault)
sPropID
- ptPropBag
- strDefault
-
public static void PBWrite(IXPPropertyBag ptPropBag, java.lang.String sPropID, java.lang.String strValue)
sPropID
- ptPropBag
- strValue
- public static void PBWrite(IXPPropertyBag ptPropBag, java.lang.String sPropID, int nValue)
sPropID
- ptPropBag
- nValue
- public static void PBWrite(IXPPropertyBag ptPropBag, java.lang.String sPropID, long lValue)
sPropID
- ptPropBag
- lValue
- public static void PBWrite(IXPPropertyBag ptPropBag, java.lang.String sPropID, boolean bValue)
sPropID
- ptPropBag
- bValue
- public static int ValidateDurationRange(PTDuration ptdIn, AActivitySpace asOwner, java.lang.String strError, int nLastError, long lMinMilli, long lMaxMilli)
ptdIn
- asOwner
- strError
- nLastError
- lMinMilli
- lMaxMilli
-
public static int ValidateBool(boolean bValid, AActivitySpace asOwner, java.lang.String strError, int nLastError)
ptdIn
- asOwner
- strError
- nLastError
- lMinMilli
- lMaxMilli
-
public static int ValidateIntegerRange(int nIn, AActivitySpace asOwner, java.lang.String strError, int nLastError, int nMin, int nMax)
nIn
- asOwner
- strError
- nLastError
- nMin
- nMax
-
public static boolean CheckIsURLString(java.lang.String strIn)
strIn
-
public static int ValidateIsURLString(java.lang.String strIn, AActivitySpace asOwner, java.lang.String strError, int nLastError)
strIn
- asOwner
- strError
- nLastError
-
public static boolean HasTrailingSlash(java.lang.String strIn)
public static java.lang.String TrimTrailingSlash(java.lang.String strIn)
public static java.lang.String TrimAllTrailingSlashes(java.lang.String strIn)
public static int ValidateNonEmptyString(java.lang.String strIn, AActivitySpace asOwner, java.lang.String strError, int nLastError)
strIn
- asOwner
- strError
- nLastError
-
public static int ValidateLoginPassword(java.lang.String strLogin, java.lang.String strPassword, java.lang.String strNULLPASSWORD, AActivitySpace asOwner, java.lang.String strError, int nLastError)
strLogin
- strPassword
- strNULLPASSWORD
- asOwner
- strError
- nLastError
-
public static XPArrayList StringArrayToXPArray(java.lang.String[] arsIn)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |