public class SkinPropertyService extends BaseService
_serviceName| Modifier and Type | Method and Description |
|---|---|
static boolean |
areSkinsConfigured()
Reports whether properties are fully configured.
|
static boolean |
bypassConfiguration()
Reports whether the metacat configuration utility should be run.
|
static void |
checkAndSetProperty(javax.servlet.http.HttpServletRequest request,
java.lang.String skinName,
java.lang.String propertyName)
Take input from the user in an HTTP request about an property to be
changed and update the metacat property file with that new value if it
has changed from the value that was originally set.
|
static void |
checkAndSetProperty(java.lang.String newValue,
java.lang.String skinName,
java.lang.String propertyName)
Check user input against existing value and update the metacat property
file with that new value if it has changed from the value that was
originally set.
|
void |
doRefresh() |
static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.SortedProperties> |
getBackupProperties()
Get the main backup properties file.
|
static edu.ucsb.nceas.utilities.SortedProperties |
getBackupProperties(java.lang.String skinName)
Get the main backup properties file.
|
static SkinPropertyService |
getInstance()
Get the single instance of SkinPropertyService.
|
static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.PropertiesMetaData> |
getMetaData()
Get the main properties metadata.
|
static edu.ucsb.nceas.utilities.PropertiesMetaData |
getMetaData(java.lang.String skinName)
Get the main properties metadata.
|
static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.SortedProperties> |
getProperties()
Get the main backup properties file.
|
static edu.ucsb.nceas.utilities.SortedProperties |
getProperties(java.lang.String skinName)
Get the main backup properties file.
|
static java.lang.String |
getProperty(java.lang.String skinName,
java.lang.String propertyName)
Utility method to get a property value from the properties file for a
specific skin.
|
static java.util.Vector<java.lang.String> |
getPropertyNames(java.lang.String skinName)
Get a set of all property names for a given skin.
|
static java.util.Vector<java.lang.String> |
getPropertyNamesByGroup(java.lang.String skinName,
java.lang.String groupName)
Get a Set of all property names that start with the groupName prefix.
|
static void |
persistAllProperties()
Save the properties to a properties file.
|
static void |
persistBackupProperties(java.lang.String skinName)
Writes out backup configurable properties to a file.
|
static void |
persistProperties(java.lang.String skinName)
Save the properties to a properties file.
|
boolean |
refreshable() |
static void |
setProperty(java.lang.String skinName,
java.lang.String propertyName,
java.lang.String newValue)
Utility method to set a property value both in memory and to the
properties file
|
static void |
setPropertyNoPersist(java.lang.String skinName,
java.lang.String propertyName,
java.lang.String newValue)
Utility method to set a property value in memory.
|
void |
stop() |
refreshpublic static SkinPropertyService getInstance() throws ServiceException
servletContext - the context we will use to get relative pathsServiceExceptionpublic boolean refreshable()
refreshable in class BaseServicepublic void doRefresh()
throws ServiceException
doRefresh in class BaseServiceServiceExceptionpublic void stop()
throws ServiceException
stop in class BaseServiceServiceExceptionpublic static java.lang.String getProperty(java.lang.String skinName,
java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
skinName - the skin for which we want to retrieve the propertypropertyName - the name of the property requestededu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic static java.util.Vector<java.lang.String> getPropertyNames(java.lang.String skinName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
skinName - the skin for which we want to retrieve the property namesedu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic static java.util.Vector<java.lang.String> getPropertyNamesByGroup(java.lang.String skinName,
java.lang.String groupName)
throws edu.ucsb.nceas.utilities.PropertyNotFoundException
groupName - the prefix of the keys to search for.edu.ucsb.nceas.utilities.PropertyNotFoundExceptionpublic static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.SortedProperties> getProperties()
public static edu.ucsb.nceas.utilities.SortedProperties getProperties(java.lang.String skinName)
public static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.SortedProperties> getBackupProperties()
public static edu.ucsb.nceas.utilities.SortedProperties getBackupProperties(java.lang.String skinName)
public static java.util.HashMap<java.lang.String,edu.ucsb.nceas.utilities.PropertiesMetaData> getMetaData()
public static edu.ucsb.nceas.utilities.PropertiesMetaData getMetaData(java.lang.String skinName)
public static void setProperty(java.lang.String skinName,
java.lang.String propertyName,
java.lang.String newValue)
throws java.io.IOException,
edu.ucsb.nceas.utilities.GeneralPropertyException
propertyName - the name of the property requestednewValue - the new value for the propertyjava.io.IOExceptionedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void setPropertyNoPersist(java.lang.String skinName,
java.lang.String propertyName,
java.lang.String newValue)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
propertyName - the name of the property requestednewValue - the new value for the propertyedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void persistProperties(java.lang.String skinName)
throws java.io.IOException,
edu.ucsb.nceas.utilities.GeneralPropertyException
java.io.IOExceptionedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void persistAllProperties()
throws java.io.IOException,
edu.ucsb.nceas.utilities.GeneralPropertyException
java.io.IOExceptionedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void persistBackupProperties(java.lang.String skinName)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
edu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static boolean areSkinsConfigured()
throws MetacatUtilException
MetacatUtilExceptionpublic static void checkAndSetProperty(javax.servlet.http.HttpServletRequest request,
java.lang.String skinName,
java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
request - that was generated by the userresponse - to send output back to the userpropertyName - the name of the property to be checked and setedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static void checkAndSetProperty(java.lang.String newValue,
java.lang.String skinName,
java.lang.String propertyName)
throws edu.ucsb.nceas.utilities.GeneralPropertyException
newValue - the value that was returned by the formskinname - the skin that we are checkingpropertyName - the name of the property to be checked and setedu.ucsb.nceas.utilities.GeneralPropertyExceptionpublic static boolean bypassConfiguration()
Copyright © 2020 Regents of the University of California. All Rights Reserved.