Class STPropertiesManager
java.lang.Object
it.uniroma2.art.semanticturkey.properties.STPropertiesManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperstatic com.fasterxml.jackson.databind.ObjectMappercreateObjectMapper(ExtensionPointManager exptManager) static FilegetPGBindingPropertyFolder(World world, Project project, UsersGroup group, String pluginID) Returns the folder/pu_bindings/ / /plugins/ / static <T extends STProperties>
TgetPGSettings(Class<T> valueType, World world, Project project, UsersGroup group, String pluginID, boolean explicit) static StringgetPluginsSubfolder(World world) Returns the "plugins" directory suitable for the provided world.static FilegetProjectPropertyFolder(World world, Project project, String pluginID) Returns the folder/projects/ /plugins/ / static <T extends STProperties>
TgetProjectSettings(Class<T> valueType, World world, Project project, String pluginID) Returns the project settings about a plugin.static <T extends STProperties>
TgetProjectSettings(Class<T> valueType, World world, Project project, String pluginID, boolean explicit) Returns the project settings about a plugin.static <T extends STProperties>
TgetProjectSettingsDefault(Class<T> valueType, World world, String pluginID) Returns the value of a default project settings at system levelstatic FilegetProjectSettingsDefaultsFile(World world, String pluginID) Returns the Properties file/system/plugins_ / /project-settings-defaults.props static FilegetProjectSettingsFile(World world, Project project, String pluginID) Returns the Properties file/projects/ /plugins/ /settings.props static FilegetPUBindingPropertyFolder(World world, Project project, STUser user, String pluginID) Returns the folder/pu_bindings/ / /plugins/ / static <T extends STProperties>
TgetPUSettings(Class<T> valueType, World world, Project project, AuthenticatedActor user, String pluginID) Returns the pu_settings about a plugin.static <T extends STProperties>
TgetPUSettings(Class<T> valueType, World world, Project project, AuthenticatedActor user, String pluginID, boolean explicit) static <T extends STProperties>
TgetPUSettingsProjectDefault(Class<T> valueType, World world, Project project, String pluginID) Returns the value of a default pu_settings at project levelstatic <T extends STProperties>
TgetPUSettingsSystemDefault(Class<T> valueType, World world, String pluginID) Returns the value of a default pu_settings at system levelstatic FilegetPUSettingsSystemDefaultsFile(World world, String pluginID) static <T extends STProperties>
TgetPUSettingsUserDefault(Class<T> valueType, World world, AuthenticatedActor user, String pluginID) Returns the value of a default pu_settings at user levelstatic ObjectgetSinglePropertyDefaultFromSettingsOrExpression(STProperties props, Project project, AuthenticatedActor user, ExtensionPointManager exptManager, String prop) static FilegetSystemPropertyFolder(World world, String pluginID) Returns the folder/system/plugins/ / static <T extends STProperties>
TgetSystemSettings(Class<T> valueType, String pluginID) static FilegetSystemSettingsFile(String pluginID) Returns the Properties file/system/plugins/ /settings.props static FilegetUserPropertyFolder(World world, AuthenticatedActor user, String pluginID) Returns the folder/users/ /plugins/ / static <T extends STProperties>
TgetUserSettings(Class<T> valueType, World world, AuthenticatedActor user, String pluginID, boolean explicit) static <T extends STProperties>
TgetUserSettingsDefault(Class<T> valueType, World world, String pluginID) Returns the value of a default user settings at system levelstatic voidloadDefaultsFromSettings(STProperties props, Project project, AuthenticatedActor user) static <T extends STProperties>
TloadSTPropertiesFromObjectNodes(Class<T> valueType, boolean loadObjType, com.fasterxml.jackson.databind.node.ObjectNode... objs) static <T extends STProperties>
TloadSTPropertiesFromObjectNodes(Class<T> valueType, boolean loadObjType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode... objs) static <T extends STProperties>
TloadSTPropertiesFromYAMLFiles(Class<T> valueType, boolean loadObjType, boolean ignoreMissingFiles, ExtensionPointManager exptManager, File... propFiles) static <T extends STProperties>
TloadSTPropertiesFromYAMLFiles(Class<T> valueType, boolean loadObjType, boolean ignoreMissingFiles, File... propFiles) static voidsetPGSettings(STProperties preferences, World world, Project project, UsersGroup group, String pluginID, boolean allowIncompletePropValueSet) Sets the values of pg_setting related to the given project-group-pluginstatic voidsetProjectSettings(STProperties settings, World world, Project project, String pluginID, boolean allowIncompletePropValueSet) Sets the values of project settings related to a plugin.static voidsetProjectSettingsDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) Sets the value of a default project setting at system level.static voidsetPUSettings(STProperties preferences, World world, Project project, STUser user, String pluginID, boolean allowIncompletePropValueSet) Sets the values of pu_setting related to the given project-user-pluginstatic voidsetPUSettingsProjectDefault(STProperties settings, World world, Project project, String pluginID, boolean allowIncompletePropValueSet) Sets the value of a default pu-setting at project level.static voidsetPUSettingsSystemDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) Sets the value of a default pu-setting at system level.static voidsetPUSettingsUserDefault(STProperties settings, World world, AuthenticatedActor user, String pluginID, boolean allowIncompletePropValueSet) Sets the value of a default pu-setting at user level.static voidstatic voidsetSystemSettings(STProperties settings, String pluginID) static voidsetSystemSettings(STProperties settings, String pluginID, boolean allowIncompletePropValueSet) static voidsetUserSettings(STProperties preferences, World world, AuthenticatedActor user, String pluginID, boolean allowIncompletePropValueSet) static voidsetUserSettingsDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) Sets the value of a default user setting at system level.static voidstoreObjectNodeInYAML(com.fasterxml.jackson.databind.node.ObjectNode objectNode, File propertiesFile) static voidstoreSTPropertiesInYAML(STProperties properties, File propertiesFile, boolean storeObjType) static com.fasterxml.jackson.databind.node.ObjectNodestoreSTPropertiesToObjectNode(com.fasterxml.jackson.databind.ObjectMapper mapper, STProperties properties, boolean storeObjType) static com.fasterxml.jackson.databind.node.ObjectNodestoreSTPropertiesToObjectNode(STProperties properties, boolean storeObjType)
-
Field Details
-
PROJECT_SETTINGS_DEFAULTS_FILE_NAME
- See Also:
-
SETTINGS_TYPE_PROPERTY
- See Also:
-
-
Constructor Details
-
STPropertiesManager
public STPropertiesManager()
-
-
Method Details
-
getPUSettings
public static <T extends STProperties> T getPUSettings(Class<T> valueType, World world, Project project, AuthenticatedActor user, String pluginID) throws STPropertyAccessException Returns the pu_settings about a plugin. If the setting has no value for the user, it looks for the value in the following order:- the value for the group of the user (if any)
- the default value at project level
- the default value at user level
- the default value at system level.
- Parameters:
valueType-world-project-user-pluginID-- Throws:
STPropertyAccessException
-
getPUSettings
public static <T extends STProperties> T getPUSettings(Class<T> valueType, World world, Project project, AuthenticatedActor user, String pluginID, boolean explicit) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
setPUSettings
public static void setPUSettings(STProperties preferences, World world, Project project, STUser user, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the values of pu_setting related to the given project-user-plugin- Parameters:
preferences-world-project-user-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
getPGSettings
public static <T extends STProperties> T getPGSettings(Class<T> valueType, World world, Project project, UsersGroup group, String pluginID, boolean explicit) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
setPGSettings
public static void setPGSettings(STProperties preferences, World world, Project project, UsersGroup group, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the values of pg_setting related to the given project-group-plugin- Parameters:
preferences-world-project-group-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
getPUSettingsProjectDefault
public static <T extends STProperties> T getPUSettingsProjectDefault(Class<T> valueType, World world, Project project, String pluginID) throws STPropertyAccessException Returns the value of a default pu_settings at project level- Parameters:
valueType-world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
getPUSettingsUserDefault
public static <T extends STProperties> T getPUSettingsUserDefault(Class<T> valueType, World world, AuthenticatedActor user, String pluginID) throws STPropertyAccessException Returns the value of a default pu_settings at user level- Parameters:
valueType-world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
getPUSettingsSystemDefault
public static <T extends STProperties> T getPUSettingsSystemDefault(Class<T> valueType, World world, String pluginID) throws STPropertyAccessException Returns the value of a default pu_settings at system level- Parameters:
valueType-world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
setPUSettingsProjectDefault
public static void setPUSettingsProjectDefault(STProperties settings, World world, Project project, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the value of a default pu-setting at project level.- Parameters:
settings-world-project-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
setPUSettingsUserDefault
public static void setPUSettingsUserDefault(STProperties settings, World world, AuthenticatedActor user, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the value of a default pu-setting at user level.- Parameters:
settings-world-user-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
setPUSettingsSystemDefault
public static void setPUSettingsSystemDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the value of a default pu-setting at system level.- Parameters:
settings-world-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
getUserSettings
public static <T extends STProperties> T getUserSettings(Class<T> valueType, World world, AuthenticatedActor user, String pluginID, boolean explicit) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
setUserSettings
public static void setUserSettings(STProperties preferences, World world, AuthenticatedActor user, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException - Throws:
STPropertyUpdateException
-
getUserSettingsDefault
public static <T extends STProperties> T getUserSettingsDefault(Class<T> valueType, World world, String pluginID) throws STPropertyAccessException Returns the value of a default user settings at system level- Parameters:
valueType-world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
setUserSettingsDefault
public static void setUserSettingsDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the value of a default user setting at system level.- Parameters:
settings-world-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
getProjectSettings
public static <T extends STProperties> T getProjectSettings(Class<T> valueType, World world, Project project, String pluginID) throws STPropertyAccessException Returns the project settings about a plugin. The returned settings are (in descending order of priority):- the values stored in the project-settings for the plugin
- the default values stored at the system level
- the default value hard-wired in the provided
STPropertiesobject
- Parameters:
valueType-world-project-pluginID-- Throws:
STPropertyAccessException
-
getProjectSettings
public static <T extends STProperties> T getProjectSettings(Class<T> valueType, World world, Project project, String pluginID, boolean explicit) throws STPropertyAccessException Returns the project settings about a plugin. The returned settings are (in descending order of priority):- the values stored in the project-settings for the plugin
- the default values stored at the system level
- the default value hard-wired in the provided
STPropertiesobject
- Parameters:
valueType-world-project-pluginID-explicit-- Throws:
STPropertyAccessException
-
getProjectSettingsDefault
public static <T extends STProperties> T getProjectSettingsDefault(Class<T> valueType, World world, String pluginID) throws STPropertyAccessException Returns the value of a default project settings at system level- Parameters:
valueType-world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
setProjectSettings
public static void setProjectSettings(STProperties settings, World world, Project project, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the values of project settings related to a plugin.- Parameters:
settings-world-project-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
setProjectSettingsDefault
public static void setProjectSettingsDefault(STProperties settings, World world, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException Sets the value of a default project setting at system level.- Parameters:
settings-world-pluginID-allowIncompletePropValueSet-- Throws:
STPropertyUpdateException
-
getSystemSettings
public static <T extends STProperties> T getSystemSettings(Class<T> valueType, String pluginID) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
setSystemSettings
public static void setSystemSettings(STProperties settings, String pluginID) throws STPropertyUpdateException - Throws:
STPropertyUpdateException
-
setSystemSettings
public static void setSystemSettings(STProperties settings, String pluginID, boolean allowIncompletePropValueSet) throws STPropertyUpdateException - Throws:
STPropertyUpdateException
-
getPUSettingsSystemDefaultsFile
-
getProjectSettingsDefaultsFile
Returns the Properties file/system/plugins_ / /project-settings-defaults.props - Parameters:
world-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
getSystemSettingsFile
Returns the Properties file/system/plugins/ /settings.props - Parameters:
pluginID-- Returns:
- Throws:
STPropertyAccessException
-
getProjectSettingsFile
Returns the Properties file/projects/ /plugins/ /settings.props - Parameters:
world-project-pluginID-- Returns:
- Throws:
STPropertyAccessException
-
getSystemPropertyFolder
Returns the folder/system/plugins/ / - Parameters:
pluginID-- Returns:
-
getProjectPropertyFolder
Returns the folder/projects/ /plugins/ / - Parameters:
world-project-pluginID-- Returns:
-
getPluginsSubfolder
Returns the "plugins" directory suitable for the provided world. The directory will be "plugins_", except for the main world in which case it is simply "plugins". - Parameters:
world-- Returns:
-
getUserPropertyFolder
Returns the folder/users/ /plugins/ / - Parameters:
world-user-pluginID-- Returns:
-
getPUBindingPropertyFolder
public static File getPUBindingPropertyFolder(World world, Project project, STUser user, String pluginID) Returns the folder/pu_bindings/ / /plugins/ / - Parameters:
world-project-user-pluginID-- Returns:
-
getPGBindingPropertyFolder
public static File getPGBindingPropertyFolder(World world, Project project, UsersGroup group, String pluginID) Returns the folder/pu_bindings/ / /plugins/ / - Parameters:
world-project-group-pluginID-- Returns:
-
loadDefaultsFromSettings
public static void loadDefaultsFromSettings(STProperties props, Project project, AuthenticatedActor user) throws PropertyNotFoundException - Throws:
PropertyNotFoundException
-
getSinglePropertyDefaultFromSettingsOrExpression
public static Object getSinglePropertyDefaultFromSettingsOrExpression(STProperties props, Project project, AuthenticatedActor user, ExtensionPointManager exptManager, String prop) -
createObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper() -
createObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper(ExtensionPointManager exptManager) -
storeSTPropertiesToObjectNode
public static com.fasterxml.jackson.databind.node.ObjectNode storeSTPropertiesToObjectNode(STProperties properties, boolean storeObjType) -
storeSTPropertiesToObjectNode
public static com.fasterxml.jackson.databind.node.ObjectNode storeSTPropertiesToObjectNode(com.fasterxml.jackson.databind.ObjectMapper mapper, STProperties properties, boolean storeObjType) -
storeSTPropertiesInYAML
public static void storeSTPropertiesInYAML(STProperties properties, File propertiesFile, boolean storeObjType) throws IOException - Throws:
IOException
-
storeObjectNodeInYAML
public static void storeObjectNodeInYAML(com.fasterxml.jackson.databind.node.ObjectNode objectNode, File propertiesFile) throws IOException - Throws:
IOException
-
loadSTPropertiesFromYAMLFiles
public static <T extends STProperties> T loadSTPropertiesFromYAMLFiles(Class<T> valueType, boolean loadObjType, boolean ignoreMissingFiles, File... propFiles) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
loadSTPropertiesFromYAMLFiles
public static <T extends STProperties> T loadSTPropertiesFromYAMLFiles(Class<T> valueType, boolean loadObjType, boolean ignoreMissingFiles, ExtensionPointManager exptManager, File... propFiles) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
loadSTPropertiesFromObjectNodes
public static <T extends STProperties> T loadSTPropertiesFromObjectNodes(Class<T> valueType, boolean loadObjType, com.fasterxml.jackson.databind.node.ObjectNode... objs) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
loadSTPropertiesFromObjectNodes
public static <T extends STProperties> T loadSTPropertiesFromObjectNodes(Class<T> valueType, boolean loadObjType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.fasterxml.jackson.databind.node.ObjectNode... objs) throws STPropertyAccessException - Throws:
STPropertyAccessException
-
setSnakeYAMLCodePointLimit
-