|
Clearspace API (1.10.16) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.JiveGlobals
public class JiveGlobals
This class controls access to a number of global propeties in the applcation.
Additionally, this class controls access to Jive properties. If the application is on, property manipulation must be done through this class and not the database or xml files directly. Properties come in 3 types:getLocalProperty(String)getLocalProperty(String, int)getLocalProperties(String)setLocalProperty(String, String)setLocalProperties(Map)deleteLocalProperty(String)getJiveProperty(String)getJiveProperty(String, String)getJivePropertyNames()getJivePropertyNames(String)getJiveProperties(String)getJiveIntProperty(String, int)getJiveBooleanProperty(String)getJiveBooleanProperty(String, boolean)setJiveProperty(String, String)setJiveProperties(java.util.Map)deleteJiveProperty(String)getLocalizedJiveProperty(String, java.util.Locale)getLocalizedPropertyLocales(String)setLocalizedJiveProperty(String, String, java.util.Locale)deleteLocalizedJiveProperty(String, java.util.Locale)
| Nested Class Summary | |
|---|---|
static interface |
JiveGlobals.JiveHomeProvider
A pluggable way to specify a value for jiveHome. |
static class |
JiveGlobals.ResetLocalizationSettingsClusterTask
|
| Field Summary | |
|---|---|
static boolean |
failedLoading
Indicates loading a reference to the jiveHome directory failed. |
static java.lang.String |
jiveHome
Location of the jiveHome directory. |
static JiveProperties<java.lang.String,java.lang.String> |
setupProperties
Local Jive properties (from jive_startup.xml). |
| Method Summary | |
|---|---|
static void |
deleteJiveProperty(java.lang.String name)
Deletes a Jive property. |
static void |
deleteLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
Deletes a localized Jive property. |
static void |
deleteLocalProperty(java.lang.String name)
Deletes a local property. |
static java.lang.String |
formatDate(java.util.Date date)
Formats a Date object and returns a formatted String. |
static java.lang.String |
formatDateTime(java.util.Date date)
Formats a Date object to return a date and time using the global locale. |
static java.lang.String |
getBuildProperty(java.lang.String name)
Returns a build-level property. |
static java.lang.String |
getCharacterEncoding()
Returns the character set that Jive uses for encoding. |
static java.lang.String |
getDefaultBaseURL()
Returns the base URL of this Jive installation - usually: http://[yoursite]/[webapp-path] This uses the Jive property of jiveURL which is settable through the config file or admin console. |
static boolean |
getJiveBooleanProperty(java.lang.String name)
Returns the specified Jive property as a boolean or returns false if the property doesn't exist or isn't parseable. |
static boolean |
getJiveBooleanProperty(java.lang.String name,
boolean defaultValue)
Returns the specified Jive property as a boolean or returns defaultValue if the property doesn't exist or isn't parseable. |
static java.lang.String |
getJiveHome()
Returns the location of the jiveHome directory. |
static int |
getJiveIntProperty(java.lang.String name,
int defaultValue)
Returns the specified Jive property as an integer or returns the defaultValue if the property does't exist or the value isn't a number. |
static JiveObject |
getJiveObjectFromURL(JiveContext jiveContext,
java.lang.String url)
Returns a JiveObject that matches the specified url or null if no object matches
the specified url. |
static java.lang.String |
getJiveObjectURL(JiveObject jiveObject)
Returns the full (including domain name as set in the jiveURL jive property ) URL to this JiveObject or the default base url if the jive content object does not have
a specific url. |
static java.util.List<java.lang.String> |
getJiveProperties(java.lang.String parent)
Return all immediate children property values of a parent Jive property as a list of strings, or an empty list if there are no children. |
static java.lang.String |
getJiveProperty(java.lang.String name)
Returns the value of the specified property or null if the value doesn't exist. |
static java.lang.String |
getJiveProperty(java.lang.String name,
java.lang.String defaultValue)
Returns a Jive property. |
static java.util.List<java.lang.String> |
getJivePropertyNames()
Returns all Jive property names. |
static java.util.List<java.lang.String> |
getJivePropertyNames(java.lang.String parent)
Return all immediate children property names of a parent Jive property as a list of strings, or an empty list if there are no children. |
static java.util.Locale |
getLocale()
Returns the global Locale used by Jive. |
static java.lang.String |
getLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
Returns a localized Jive property given its name and locale. |
static java.util.List<java.util.Locale> |
getLocalizedPropertyLocales(java.lang.String name)
Returns a list of locales where this property is set. |
static java.util.List<java.lang.String> |
getLocalProperties(java.lang.String parent)
Return all immediate children property values of a parent local property as a list of strings, or an empty list if there are no children. |
static java.lang.String |
getLocalProperty(java.lang.String name)
Returns a local property. |
static int |
getLocalProperty(java.lang.String name,
int defaultValue)
Returns a local property as an integer. |
static java.util.Map<java.lang.String,java.lang.String> |
getSpiProperties(java.lang.String spiClass)
|
static java.lang.String |
getSpiProperty(java.lang.String spiClass,
java.lang.String name)
|
static java.util.Date |
getStartupDate()
Returns the date the Jive system was started. |
static java.util.TimeZone |
getTimeZone()
Returns the global TimeZone used by Jive. |
static java.util.Map<java.lang.String,java.lang.String> |
getUnmodifiableMap()
|
static boolean |
isSetup()
Returns true if the application has been set up, false otherwise. |
static boolean |
isWhiteLabel()
Returns true if the application is running in white label mode, false otherwise. |
static void |
resetLocalization()
Resets locale specific settings so they will be reread from properties. |
static void |
setCharacterEncoding(java.lang.String characterEncoding)
Sets the character set that Jive uses for encoding. |
static void |
setConfigName(java.lang.String configName)
Allows the name of the local config file name to be changed. |
static void |
setJiveHome(java.lang.String jHome)
Sets the location of the jiveHome directory. |
static void |
setJiveProperties(java.util.Map<java.lang.String,java.lang.String> propertyMap)
Sets multiple Jive properties at once. |
static void |
setJiveProperty(java.lang.String name,
java.lang.String value)
Sets a Jive property. |
static void |
setLocale(java.util.Locale newLocale)
Sets the global locale used by Jive. |
static void |
setLocalizedJiveProperty(java.lang.String name,
java.lang.String value,
java.util.Locale locale)
Sets a localized Jive property. |
static void |
setLocalProperties(java.util.Map<java.lang.String,java.lang.String> propertyMap)
Sets multiple local properties at once. |
static void |
setLocalProperty(java.lang.String name,
java.lang.String value)
Sets a local property. |
static void |
setSpiProperties(java.lang.String spiClass,
java.util.Map<java.lang.String,java.lang.String> config)
|
static void |
setSpiProperty(java.lang.String clazz,
java.lang.String name,
java.lang.String value)
|
static void |
setTimeZone(java.util.TimeZone newTimeZone)
Sets the global time zone used by Jive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String jiveHome
public static boolean failedLoading
public static JiveProperties<java.lang.String,java.lang.String> setupProperties
| Method Detail |
|---|
public static java.util.Date getStartupDate()
public static java.util.Locale getLocale()
Locale used by Jive. A locale specifies language and country
codes, and is used for internationalization. The default locale is system dependant
and is determined by calling Locale.getDefault().
public static void setLocale(java.util.Locale newLocale)
Locale.getDefault().
newLocale - the global locale for Jive.public static java.lang.String getCharacterEncoding()
com.jivesoftware.community.web.filter.SetResponseCharacterEncodingFilter
is installed in this application's web.xml file, which will set the incoming character encoding
to the one reported by this method.
public static void setCharacterEncoding(java.lang.String characterEncoding)
throws java.io.UnsupportedEncodingException
getCharacterEncoding().
characterEncoding - the global Jive character encoding.
java.io.UnsupportedEncodingException - if the specified character encoding is invalid.public static java.util.TimeZone getTimeZone()
TimeZone used by Jive. The default is the JDK's default time zone.
public static void setTimeZone(java.util.TimeZone newTimeZone)
newTimeZone - the new global time zone used by this application.public static void resetLocalization()
public static java.lang.String formatDate(java.util.Date date)
Date object and returns a formatted String. This uses the date formatter
which in turn uses the default locale.
date - the Date to format.
public static java.lang.String formatDateTime(java.util.Date date)
Date object to return a date and time using the global locale.
date - the Date to format.
public static java.lang.String getDefaultBaseURL()
public static java.lang.String getJiveObjectURL(JiveObject jiveObject)
JiveObject or the default base url if the jive content object does not have
a specific url. Objects for which URL's can be generated are as follows:
jiveObject - the jive object to return the url for
JiveObject
public static JiveObject getJiveObjectFromURL(JiveContext jiveContext,
java.lang.String url)
JiveObject that matches the specified url or null if no object matches
the specified url.
jiveContext - the context to use to retrieve the jive objecturl - the url to a JiveObject
JiveObject that matches the specified urlpublic static java.lang.String getJiveHome()
public static void setJiveHome(java.lang.String jHome)
jiveHome directory. This method is only intended to be
used during setup and should not set called in normal operations.
jHome - the path to jiveHomepublic static void setConfigName(java.lang.String configName)
configName - the name of the config file.public static boolean isSetup()
public static java.lang.String getLocalProperty(java.lang.String name)
<foo>
<bar>
<prop>some value</prop>
</bar>
</foo>
name - the name of the property to return.
public static int getLocalProperty(java.lang.String name,
int defaultValue)
name - the name of the property to return.defaultValue - the value returned if the property could not be loaded or was not a
number.
public static java.util.List<java.lang.String> getLocalProperties(java.lang.String parent)
parent - the name of the parent property to return the children for.
public static void setLocalProperty(java.lang.String name,
java.lang.String value)
name - the name of the property being set.value - the value of the property being set.public static void setLocalProperties(java.util.Map<java.lang.String,java.lang.String> propertyMap)
propertyMap - a map of properties, keyed on property name.public static void deleteLocalProperty(java.lang.String name)
name - the name of the property to delete.public static java.lang.String getJiveProperty(java.lang.String name)
name - the name of the property to return.
public static java.lang.String getJiveProperty(java.lang.String name,
java.lang.String defaultValue)
name - the name of the property.defaultValue - value returned if the property doesn't exist.
public static java.util.List<java.lang.String> getJivePropertyNames()
public static java.util.List<java.lang.String> getJivePropertyNames(java.lang.String parent)
parent - the parent property to return all child properties for
public static java.util.List<java.lang.String> getJiveProperties(java.lang.String parent)
parent - the name of the parent property to return the children for.
public static int getJiveIntProperty(java.lang.String name,
int defaultValue)
name - the name of the property.defaultValue - value returned if the property doesn't exist or was not a number.
public static boolean getJiveBooleanProperty(java.lang.String name)
name - the name of the property to return.
public static boolean getJiveBooleanProperty(java.lang.String name,
boolean defaultValue)
name - the name of the property.defaultValue - value returned if the property doesn't exist.
public static void setJiveProperty(java.lang.String name,
java.lang.String value)
name - the name of the property being set.value - the value of the property being set.public static void setJiveProperties(java.util.Map<java.lang.String,java.lang.String> propertyMap)
propertyMap - a map of properties, keyed on property name.public static void deleteJiveProperty(java.lang.String name)
name - the name of the property to delete.
public static java.lang.String getLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
name - the name of the propertylocale - the locale this property applies to
public static java.util.List<java.util.Locale> getLocalizedPropertyLocales(java.lang.String name)
locales where this property is set. If the property doesn't
exist or is not set then an empty list is returned.
name - the name of the property to check.
Locale objects where this property is set or an empty list
if the property doesn't exist.
public static void setLocalizedJiveProperty(java.lang.String name,
java.lang.String value,
java.util.Locale locale)
name - the name of the property being set.value - the value of the property being set.locale - the locale of the property
public static void deleteLocalizedJiveProperty(java.lang.String name,
java.util.Locale locale)
name - the name of the property to delete.locale - the locale of the propertypublic static boolean isWhiteLabel()
public static java.lang.String getBuildProperty(java.lang.String name)
name - the name of the proeprty
public static java.util.Map<java.lang.String,java.lang.String> getUnmodifiableMap()
public static void setSpiProperty(java.lang.String clazz,
java.lang.String name,
java.lang.String value)
public static java.lang.String getSpiProperty(java.lang.String spiClass,
java.lang.String name)
public static java.util.Map<java.lang.String,java.lang.String> getSpiProperties(java.lang.String spiClass)
public static void setSpiProperties(java.lang.String spiClass,
java.util.Map<java.lang.String,java.lang.String> config)
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||