Class Settings
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Settings
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for handling settings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Inner class useful just for { @link getStartupSettings } in order to return a Settings that is a mix between a default project setting (languages) and a subset of CoreSystemSettings properties -
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPUSettingsProjectDefault
(String componentID, String projectName) Returns the default PU Settings at project level for the given project.getPUSettingsUserDefault
(String componentID, org.eclipse.rdf4j.model.IRI userIri) Returns the default PU Settings at user level for the given user.getSettings
(String componentID, Scope scope) Returns the settings stored in a given scope for a componentgetSettingsDefault
(String componentID, Scope scope, Scope defaultScope) Returns the default settings stored in a given scope for a componentgetSettingsForProjectAdministration
(String componentID, Scope scope, String projectName, org.eclipse.rdf4j.model.IRI userIri, org.eclipse.rdf4j.model.IRI groupIri) Returns the PROJECT or PROJECT_USER settings of a specific project or project-user pair.getSettingsScopes
(String componentID) Returns the settings scopes supported by a componentReturns settings required at initialization of client applicationvoid
storePUSettingProjectDefault
(String componentID, String projectName, String propertyName, com.fasterxml.jackson.databind.JsonNode propertyValue) Stores the default PU Settings at project level for the given project.void
storePUSettingUserDefault
(String componentID, org.eclipse.rdf4j.model.IRI userIri, String propertyName, com.fasterxml.jackson.databind.JsonNode propertyValue) Stores the default PU Settings at user level for the given user.void
storeSetting
(String componentID, Scope scope, String propertyName, com.fasterxml.jackson.databind.JsonNode propertyValue) Set the value of a property in the settings in a given scope for a componentvoid
storeSettingDefault
(String componentID, Scope scope, Scope defaultScope, String propertyName, com.fasterxml.jackson.databind.JsonNode propertyValue) Stores the default settings property in a given scope for a componentvoid
storeSettingForProjectAdministration
(String componentID, Scope scope, String projectName, org.eclipse.rdf4j.model.IRI userIri, org.eclipse.rdf4j.model.IRI groupIri, String propertyName, com.fasterxml.jackson.databind.JsonNode propertyValue) Stores the PROJECT or PROJECT_USER settings of a specific project or project-user pair.void
storeSettings
(String componentID, Scope scope, com.fasterxml.jackson.databind.node.ObjectNode settings) Stores the settings in a given scope for a componentvoid
storeSettingsDefault
(String componentID, Scope scope, Scope defaultScope, com.fasterxml.jackson.databind.node.ObjectNode settings) Stores the default settings in a given scope for a componentMethods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Settings
public Settings()
-
-
Method Details
-
getSettingManagers
-
getSettingsScopes
@STServiceOperation public Collection<Scope> getSettingsScopes(String componentID) throws NoSuchSettingsManager Returns the settings scopes supported by a component- Parameters:
componentID
-- Returns:
- Throws:
NoSuchSettingsManager
-
getSettings
@PreAuthorize("@auth.isSettingsActionAuthorized(#scope, \'R\')") @STServiceOperation public Settings getSettings(String componentID, Scope scope) throws NoSuchSettingsManager, STPropertyAccessException Returns the settings stored in a given scope for a component- Parameters:
componentID
-- Returns:
- Throws:
NoSuchSettingsManager
STPropertyAccessException
-
getSettingsDefault
@PreAuthorize("@auth.isDefaultSettingsActionAuthorized(#scope, #defaultScope, \'R\')") @STServiceOperation public Settings getSettingsDefault(String componentID, Scope scope, Scope defaultScope) throws NoSuchSettingsManager, STPropertyAccessException Returns the default settings stored in a given scope for a component- Parameters:
componentID
-scope
-defaultScope
-- Returns:
- Throws:
NoSuchSettingsManager
STPropertyAccessException
-
storeSettings
@PreAuthorize("@auth.isSettingsActionAuthorized(#scope, \'U\')") @STServiceOperation(method=POST) public void storeSettings(String componentID, Scope scope, com.fasterxml.jackson.databind.node.ObjectNode settings) throws NoSuchSettingsManager, STPropertyAccessException, IllegalStateException, STPropertyUpdateException, WrongPropertiesException Stores the settings in a given scope for a component- Parameters:
componentID
-scope
-settings
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
IllegalStateException
STPropertyUpdateException
WrongPropertiesException
-
storeSetting
@PreAuthorize("@auth.isSettingsActionAuthorized(#scope, \'U\')") @STServiceOperation(method=POST) public void storeSetting(String componentID, Scope scope, String propertyName, @Optional @JsonSerialized com.fasterxml.jackson.databind.JsonNode propertyValue) throws NoSuchSettingsManager, STPropertyAccessException, IllegalStateException, STPropertyUpdateException, WrongPropertiesException, PropertyNotFoundException, IOException Set the value of a property in the settings in a given scope for a component- Parameters:
componentID
-scope
-propertyName
-propertyValue
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
IllegalStateException
STPropertyUpdateException
WrongPropertiesException
PropertyNotFoundException
IOException
-
storeSettingsDefault
@PreAuthorize("@auth.isDefaultSettingsActionAuthorized(#scope, #defaultScope, \'U\')") @STServiceOperation(method=POST) public void storeSettingsDefault(String componentID, Scope scope, Scope defaultScope, com.fasterxml.jackson.databind.node.ObjectNode settings) throws NoSuchSettingsManager, STPropertyAccessException, IllegalStateException, STPropertyUpdateException, WrongPropertiesException Stores the default settings in a given scope for a component- Parameters:
componentID
-scope
-defaultScope
-settings
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
IllegalStateException
STPropertyUpdateException
WrongPropertiesException
-
storeSettingDefault
@PreAuthorize("@auth.isDefaultSettingsActionAuthorized(#scope, #defaultScope, \'U\')") @STServiceOperation(method=POST) public void storeSettingDefault(String componentID, Scope scope, Scope defaultScope, String propertyName, @Optional @JsonSerialized com.fasterxml.jackson.databind.JsonNode propertyValue) throws NoSuchSettingsManager, STPropertyAccessException, IllegalStateException, STPropertyUpdateException, WrongPropertiesException, PropertyNotFoundException, IOException Stores the default settings property in a given scope for a component- Parameters:
componentID
-scope
-defaultScope
-propertyName
-propertyValue
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
IllegalStateException
STPropertyUpdateException
WrongPropertiesException
PropertyNotFoundException
IOException
-
getSettingsForProjectAdministration
@PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'R\', #projectName)") @STServiceOperation public Settings getSettingsForProjectAdministration(String componentID, Scope scope, String projectName, @Optional org.eclipse.rdf4j.model.IRI userIri, @Optional org.eclipse.rdf4j.model.IRI groupIri) throws NoSuchSettingsManager, STPropertyAccessException, ProjectAccessException, ProjectInexistentException, InvalidProjectNameException, UserException Returns the PROJECT or PROJECT_USER settings of a specific project or project-user pair. Useful for administration purposes (e.g. Admin/PM that want to manage project settings for a project different from ctx_project, or project_user settings for a project-user pair for a different user).- Parameters:
componentID
-scope
-projectName
-userIri
-- Returns:
- Throws:
NoSuchSettingsManager
STPropertyAccessException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
UserException
-
storeSettingForProjectAdministration
@PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'U\', #projectName)") @STServiceOperation(method=POST) public void storeSettingForProjectAdministration(String componentID, Scope scope, String projectName, @Optional org.eclipse.rdf4j.model.IRI userIri, @Optional org.eclipse.rdf4j.model.IRI groupIri, String propertyName, @Optional @JsonSerialized com.fasterxml.jackson.databind.JsonNode propertyValue) throws NoSuchSettingsManager, STPropertyAccessException, ProjectAccessException, ProjectInexistentException, InvalidProjectNameException, UserException, STPropertyUpdateException, PropertyNotFoundException, WrongPropertiesException, IOException Stores the PROJECT or PROJECT_USER settings of a specific project or project-user pair. Useful for administration purposes (e.g. Admin/PM that want to manage project settings for a project different from ctx_project, or project_user settings for a project-user pair for a different user).- Parameters:
componentID
-scope
-projectName
-userIri
-propertyName
-propertyValue
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
UserException
STPropertyUpdateException
PropertyNotFoundException
WrongPropertiesException
IOException
-
getPUSettingsUserDefault
@PreAuthorize("@auth.isAdmin()") @STServiceOperation public Settings getPUSettingsUserDefault(String componentID, org.eclipse.rdf4j.model.IRI userIri) throws NoSuchSettingsManager, STPropertyAccessException, UserException Returns the default PU Settings at user level for the given user. Useful for administration purposes (e.g. Admin that want to manage the default PUSettings for different users). Users that want to get their default can still usegetSettingsDefault(java.lang.String, it.uniroma2.art.semanticturkey.resources.Scope, it.uniroma2.art.semanticturkey.resources.Scope)
.- Parameters:
componentID
-userIri
-- Returns:
- Throws:
NoSuchSettingsManager
STPropertyAccessException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
UserException
-
storePUSettingUserDefault
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void storePUSettingUserDefault(String componentID, org.eclipse.rdf4j.model.IRI userIri, String propertyName, @Optional @JsonSerialized com.fasterxml.jackson.databind.JsonNode propertyValue) throws NoSuchSettingsManager, STPropertyAccessException, UserException, STPropertyUpdateException, PropertyNotFoundException, WrongPropertiesException, IOException Stores the default PU Settings at user level for the given user. Useful for administration purposes (e.g. Admin that want to manage the default PUSettings for different users). Users that want to store their default can still usegetSettingsDefault(java.lang.String, it.uniroma2.art.semanticturkey.resources.Scope, it.uniroma2.art.semanticturkey.resources.Scope)
.- Parameters:
componentID
-userIri
-propertyName
-propertyValue
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
UserException
STPropertyUpdateException
PropertyNotFoundException
WrongPropertiesException
IOException
-
getPUSettingsProjectDefault
@PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'R\', #projectName)") @STServiceOperation public Settings getPUSettingsProjectDefault(String componentID, String projectName) throws NoSuchSettingsManager, STPropertyAccessException, ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Returns the default PU Settings at project level for the given project. Useful for administration purposes (e.g. Admin that want to manage the default PUSettings for different projects). User that wants to manage project where he is PM, can still usegetSettingsDefault(java.lang.String, it.uniroma2.art.semanticturkey.resources.Scope, it.uniroma2.art.semanticturkey.resources.Scope)
- Parameters:
componentID
-projectName
-- Returns:
- Throws:
NoSuchSettingsManager
STPropertyAccessException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
storePUSettingProjectDefault
@PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'U\', #projectName)") @STServiceOperation(method=POST) public void storePUSettingProjectDefault(String componentID, String projectName, String propertyName, @Optional @JsonSerialized com.fasterxml.jackson.databind.JsonNode propertyValue) throws NoSuchSettingsManager, STPropertyAccessException, STPropertyUpdateException, PropertyNotFoundException, WrongPropertiesException, IOException, ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Stores the default PU Settings at project level for the given project. Useful for administration purposes (e.g. Admin that want to manage the default PUSettings for different projects). User that wants to manage project where he is PM, can still usestoreSettingsDefault(java.lang.String, it.uniroma2.art.semanticturkey.resources.Scope, it.uniroma2.art.semanticturkey.resources.Scope, com.fasterxml.jackson.databind.node.ObjectNode)
- Parameters:
componentID
-projectName
-propertyName
-propertyValue
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
STPropertyUpdateException
PropertyNotFoundException
WrongPropertiesException
IOException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
getStartupSettings
@STServiceOperation public Settings.StartupSettings getStartupSettings() throws STPropertyAccessExceptionReturns settings required at initialization of client application- Returns:
- Throws:
STPropertyAccessException
-