Class Projects
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Projects
- All Implemented Interfaces:
NewerNewStyleService
,STService
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessAllProjects
(ProjectConsumer consumer, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, boolean onlyProjectsAtStartup) void
accessProject
(ProjectConsumer consumer, String projectName, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel) void
batchModifyRepostoryAccessCredentials
(String projectName, String serverURL, boolean matchUsername, String currentUsername, String newUsername, String newPassword) Modifies the access credentials of (possibly) many repositories at once.void
cloneProject
(String projectName, String newProjectName) saves projectprojectName
tonewProject
Returns an empty form for SHACL settings upon project creation.void
Create the Lucene index for the facets in ALL projectsprotected void
void
createProject
(ProjectConsumer consumer, String projectName, org.eclipse.rdf4j.model.IRI model, org.eclipse.rdf4j.model.IRI lexicalizationModel, String baseURI, String defaultNamespace, boolean historyEnabled, boolean validationEnabled, boolean blacklistingEnabled, RepositoryAccess repositoryAccess, String coreRepoID, PluginSpecification coreRepoSailConfigurerSpecification, String coreBackendType, String supportRepoID, PluginSpecification supportRepoSailConfigurerSpecification, String supportBackendType, PluginSpecification uriGeneratorSpecification, PluginSpecification renderingEngineSpecification, List<Pair<RDFResourceRole, String>> resourceMetadataAssociations, String preloadedDataFileName, org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat, TransitiveImportMethodAllowance transitiveImportAllowance, String leftDataset, String rightDataset, boolean shaclEnabled, SHACLSettings shaclSettings, boolean trivialInferenceEnabled, boolean openAtStartup, ProjectACL.AccessLevel universalAccess, org.eclipse.rdf4j.model.Literal label, boolean undoEnabled, EmailApplicationContext appCtx) void
void
deleteProject
(String projectName) void
disconnectFromAllProjects
(ProjectConsumer consumer) void
disconnectFromProject
(ProjectConsumer consumer, String projectName) void
exportProject
(jakarta.servlet.http.HttpServletResponse oRes, String projectName) com.fasterxml.jackson.databind.JsonNode
getAccessStatus
(String projectName) com.fasterxml.jackson.databind.JsonNode
Returns the access statuses for every project-consumer combination.protected org.apache.commons.lang3.tuple.Pair<String,
STProperties> getBoundComponentConfiguration
(Project project, String factoryIdProp, String configFilename) Returns the backend type of the context repositoryReturns the schema of custom project facetsgetFacetsAndValue
(boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) getFacetsAndValueWithCount
(boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) com.fasterxml.jackson.databind.JsonNode
getLastConnectionInfo
(String projectName) returns the last connection info (user, timestamp, sessionId) of the given project.getOpenAtStartup
(String projectName) getProjectFacets
(String projectName) Returns the facets of a projectReturns an uninitialized form for project facets.getProjectInfo
(ProjectConsumer consumer, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, String projectName) Returns informationgetProjectInfoHelper
(ProjectConsumer consumer, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, boolean userDependent, boolean onlyOpen, AbstractProject absProj) Returns metadata about a project.getProjectPropertyFileContent
(String projectName) this service returns a list name-value for all the property of a given project.getProjectPropertyMap
(String projectName) this service returns a list name-value for all the property of a given project.getQueryTimeoutValue
(String projectName) Tells the current value of the query timeout, in seconds.org.apache.commons.lang3.tuple.Pair<String,
STProperties> getRenderingEngineConfiguration
(String projectName) Returns the rendering engine associated with a project together with its (optional) configurationgetRepositories
(String projectName, boolean excludeLocal) Returns the repositories associated with a (closed) project.org.apache.commons.lang3.tuple.Pair<String,
STProperties> getURIGeneratorConfiguration
(String projectName) Returns the uri generator associated with a project together with its (optional) configurationvoid
importProject
(org.springframework.web.multipart.MultipartFile importPackage, String newProjectName) isChangeTrackerSetUp
(String projectName) Tells whether the change tracker is set up for a closed project.isProjectExisting
(String projectName, boolean includeClosed) isQueryEvaluationExceptionForTimeoutEnabled
(String projectName) Tells whether http://www.ontotext.com/config/graphdb#throw-QueryEvaluationException-on-timeout is true or falseisSHACLValidationEnabled
(String projectName) Tells whether SHACL validation on commit is enabled in a closed project.isTrivialInferenceEnabled
(String projectName) Tells whether trivial inference is enabled in a closed project.isUndoEnabled
(String projectName) Tells whether undo is enabled in a closed project.listProjects
(ProjectConsumer consumer, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) listProjectsPerRole
(ProjectConsumer consumer, String role, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, boolean userDependent, boolean onlyOpen) Returns the projects where there is at least a user with the given rolevoid
modifyRepositoryAccessCredentials
(String projectName, String repositoryID, String newUsername, String newPassword) Modifies the access credentials of a repository associated with a given (closed) project.preloadDataFromCatalog
(String connectorId, String datasetId) Preloads data from a catalog.preloadDataFromFile
(org.springframework.web.multipart.MultipartFile preloadedData, org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat) Preloads data contained provided in the request body.preloadDataFromURL
(URL preloadedDataURL, org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat) Preloads data from URL.projectExists
(String projectName) void
recreateFacetIndexForProject
(String projectName) Create the Lucene index for the facets in ALL projectsretrieveProjects
(String bagOf, boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) retrive the list of the projects, grouped by the value of a specific facetvoid
saveProjectPropertyFileContent
(String projectName, String content) searchAndRetriveFacets
(Map<String, List<String>> facetToValueListMap, boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) searchAndRetriveProjects
(String bagOf, Map<String, List<String>> facetToValueListMap, boolean userDependent, boolean onlyOpen, List<ProjectVisibility> visibilityFilter) void
setBlacklistingEnabled
(String projectName, boolean blacklistingEnabled) Enables/disables blacklisting in a closed project with validation already enabledvoid
setCustomProjectFacetsSchema
(com.fasterxml.jackson.databind.node.ObjectNode facetsSchema) Sets the schema of custom project facetsvoid
setOpenAtStartup
(String projectName, boolean openAtStartup) Enables/Disables the possibility to automatically open a project when SemanticTurkey is executedvoid
setProjectFacets
(String projectName, com.fasterxml.jackson.databind.node.ObjectNode facets) Sets the facets of a projectvoid
setProjectLabels
(String projectName, Map<String, String> labels) void
setProjectProperty
(String projectName, String propName, String propValue) This service sets the value of a property of the current project.void
setQueryTimeout
(String projectName, int timeoutInSeconds) Sets the query timeout.void
setReadOnly
(String projectName, boolean readOnly) void
setSHACLValidationEnabled
(String projectName, boolean shaclValidationEnabled) Sets whether SHACL validation on commit is enabled in a closed projectvoid
setTrivialInferenceEnabled
(String projectName, boolean trivialInferenceEnabled) Sets whether Trivial Inference is enabled in a closed projectvoid
setUndoEnabled
(String projectName, boolean undoEnabled) Sets whether undo is enabled in a closed project.void
setVisibility
(String projectName, ProjectVisibility visibility) void
updateAccessLevel
(String consumerName, ProjectACL.AccessLevel accessLevel) Update the AccessLevel of the current projectvoid
updateLockLevel
(ProjectACL.LockLevel lockLevel) Updates the lock level of the accessed projectvoid
updateProjectAccessLevel
(String projectName, String consumerName, ProjectACL.AccessLevel accessLevel) void
updateProjectLockLevel
(String projectName, ProjectACL.LockLevel lockLevel) Updates the lock level of the project with the givenprojectName
void
updateRenderingEngineConfiguration
(String projectName, PluginSpecification renderingEngineSpecification) Updates the configuration of the rendering engine associated with a projectvoid
updateUniversalAccessLevel
(ProjectACL.AccessLevel accessLevel) Update the universal (for every consumer) AccessLevel of the current projectvoid
updateUniversalProjectAccessLevel
(String projectName, ProjectACL.AccessLevel accessLevel) Update the universal (for every consumer) AccessLevel of the given projectvoid
updateURIGeneratorConfiguration
(String projectName, PluginSpecification uriGeneratorSpecification) Updates the configuration of the uri generator associated with a projectMethods 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
-
Projects
public Projects()
-
-
Method Details
-
getContextRepositoryBackend
Returns the backend type of the context repository- Returns:
-
createProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isSuperUser(false)") public void createProject(ProjectConsumer consumer, String projectName, org.eclipse.rdf4j.model.IRI model, org.eclipse.rdf4j.model.IRI lexicalizationModel, String baseURI, @Optional String defaultNamespace, boolean historyEnabled, boolean validationEnabled, @Optional(defaultValue="false") boolean blacklistingEnabled, RepositoryAccess repositoryAccess, String coreRepoID, @Optional(defaultValue="{\"factoryId\" : \"it.uniroma2.art.semanticturkey.extension.impl.repositoryimplconfigurer.predefined.PredefinedRepositoryConfigurer\", \"configuration\" : {\"@type\" : \"it.uniroma2.art.semanticturkey.extension.impl.repositoryimplconfigurer.predefined.RDF4JNativeSailConfiguration\"}}") PluginSpecification coreRepoSailConfigurerSpecification, @Optional String coreBackendType, String supportRepoID, @Optional(defaultValue="{\"factoryId\" : \"it.uniroma2.art.semanticturkey.extension.impl.repositoryimplconfigurer.predefined.PredefinedRepositoryConfigurer\", \"configuration\" : {\"@type\" : \"it.uniroma2.art.semanticturkey.extension.impl.repositoryimplconfigurer.predefined.RDF4JNativeSailConfiguration\"}}") PluginSpecification supportRepoSailConfigurerSpecification, @Optional String supportBackendType, @Optional(defaultValue="{\"factoryId\" : \"it.uniroma2.art.semanticturkey.extension.impl.urigen.template.NativeTemplateBasedURIGenerator\", \"configuration\" : {\"@type\" : \"it.uniroma2.art.semanticturkey.extension.impl.urigen.template.NativeTemplateBasedURIGeneratorConfiguration\"}}") PluginSpecification uriGeneratorSpecification, @Optional PluginSpecification renderingEngineSpecification, @Optional @JsonSerialized List<Pair<RDFResourceRole, String>> resourceMetadataAssociations, @Optional String preloadedDataFileName, @Optional org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat, @Optional TransitiveImportMethodAllowance transitiveImportAllowance, @Optional String leftDataset, @Optional String rightDataset, @Optional boolean shaclEnabled, @Optional @JsonSerialized SHACLSettings shaclSettings, @Optional boolean trivialInferenceEnabled, @Optional(defaultValue="false") boolean openAtStartup, @Optional ProjectACL.AccessLevel universalAccess, @Optional org.eclipse.rdf4j.model.Literal label, @Optional(defaultValue="false") boolean undoEnabled, @Optional EmailApplicationContext appCtx) throws ProjectInconsistentException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ForbiddenProjectAccessException, DuplicatedResourceException, ProjectCreationException, ClassNotFoundException, WrongPropertiesException, RBACException, UnsupportedModelException, UnsupportedLexicalizationModelException, InvalidConfigurationException, STPropertyAccessException, IOException, ReservedPropertyUpdateException, ProjectUpdateException, STPropertyUpdateException, NoSuchConfigurationManager, PropertyNotFoundException, ProjectBindingException- Throws:
ProjectInconsistentException
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ForbiddenProjectAccessException
DuplicatedResourceException
ProjectCreationException
ClassNotFoundException
WrongPropertiesException
RBACException
UnsupportedModelException
UnsupportedLexicalizationModelException
InvalidConfigurationException
STPropertyAccessException
IOException
ReservedPropertyUpdateException
ProjectUpdateException
STPropertyUpdateException
NoSuchConfigurationManager
PropertyNotFoundException
ProjectBindingException
-
createEmptySHACLSettingsForm
@STServiceOperation @PreAuthorize("@auth.isSuperUser(false)") public SHACLSettings createEmptySHACLSettingsForm()Returns an empty form for SHACL settings upon project creation.- Returns:
-
projectExists
@STServiceOperation public Boolean projectExists(String projectName) throws InvalidProjectNameException - Throws:
InvalidProjectNameException
-
listProjects
@STServiceOperation public List<ProjectInfo> listProjects(@Optional(defaultValue="SYSTEM") ProjectConsumer consumer, @Optional(defaultValue="R") ProjectACL.AccessLevel requestedAccessLevel, @Optional(defaultValue="NO") ProjectACL.LockLevel requestedLockLevel, @Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws ProjectAccessException, PropertyNotFoundException, IOException, InvalidProjectNameException - Parameters:
consumer
-requestedAccessLevel
-requestedLockLevel
-userDependent
- if true, returns only the projects accessible by the logged user (the user has a role assigned in it)onlyOpen
- if true, return only the open projects- Returns:
- Throws:
ProjectAccessException
PropertyNotFoundException
IOException
InvalidProjectNameException
-
createFacetIndexIfNeeded
protected void createFacetIndexIfNeeded() throws ProjectAccessException, PropertyNotFoundException, IOException, InvalidProjectNameException -
listProjectsPerRole
@STServiceOperation public List<ProjectInfo> listProjectsPerRole(@Optional(defaultValue="SYSTEM") ProjectConsumer consumer, String role, @Optional(defaultValue="R") ProjectACL.AccessLevel requestedAccessLevel, @Optional(defaultValue="NO") ProjectACL.LockLevel requestedLockLevel, @Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen) throws ProjectAccessException Returns the projects where there is at least a user with the given role- Parameters:
consumer
-role
-requestedAccessLevel
-requestedLockLevel
-onlyOpen
-- Returns:
- Throws:
ProjectAccessException
-
isProjectExisting
@STServiceOperation public Boolean isProjectExisting(String projectName, @Optional(defaultValue="true") boolean includeClosed) -
getProjectInfo
@STServiceOperation public ProjectInfo getProjectInfo(@Optional(defaultValue="SYSTEM") ProjectConsumer consumer, @Optional(defaultValue="R") ProjectACL.AccessLevel requestedAccessLevel, @Optional(defaultValue="NO") ProjectACL.LockLevel requestedLockLevel, String projectName) throws IllegalStateException, ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Returns information- Parameters:
consumer
-requestedAccessLevel
-requestedLockLevel
-projectName
-- Returns:
- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
IllegalStateException
-
getProjectInfoHelper
public ProjectInfo getProjectInfoHelper(ProjectConsumer consumer, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel, boolean userDependent, boolean onlyOpen, AbstractProject absProj) Returns metadata about a project. If eitheruserDependent
oronlyOpen
istrue
, then this operation might returnnull
.- Parameters:
consumer
-requestedAccessLevel
-requestedLockLevel
-userDependent
- if true, returns only the projects accessible by the logged user (the user has a role assigned in it)onlyOpen
- if true, return only the open projectsabsProj
-- Returns:
- Throws:
ProjectAccessException
-
getAccessStatusMap
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'R\')") public com.fasterxml.jackson.databind.JsonNode getAccessStatusMap() throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessExceptionReturns the access statuses for every project-consumer combination. Returns a response with a set ofproject
elements containingconsumer
elements and alock
element. Eachproject
element has a single attribute: itsname
. Theconsumer
elements have the following attributes:name
: consumer's nameavailableACLLevel
: ACL given from the project to the consumeracquiredACLLevel
: The access level with which the consumer accesses the project (only specified if the project is accessed by the consumer)
lock
element has the following attributes:availableLockLevel
: lock level exposed by the projectlockingConsumer
: name of the consumer that locks the project. Specified only if
there is a consumer locking the current project.
acquiredLockLevel
: lock level which with a consumer is locking the project (optional as the previous
-
getAccessStatus
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'R\')") public com.fasterxml.jackson.databind.JsonNode getAccessStatus(String projectName) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException -
updateAccessLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'U\')") public void updateAccessLevel(String consumerName, @Optional ProjectACL.AccessLevel accessLevel) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException Update the AccessLevel of the current project- Parameters:
consumerName
-accessLevel
- if not provided revoke any access level assigned from the project to the consumer- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
ReservedPropertyUpdateException
-
updateProjectAccessLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void updateProjectAccessLevel(String projectName, String consumerName, @Optional ProjectACL.AccessLevel accessLevel) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException - Parameters:
projectName
-consumerName
-accessLevel
- if not provided revoke any access level assigned from the project to the consumer- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
ReservedPropertyUpdateException
-
updateUniversalAccessLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'U\')") public void updateUniversalAccessLevel(@Optional ProjectACL.AccessLevel accessLevel) throws ProjectUpdateException, ReservedPropertyUpdateException Update the universal (for every consumer) AccessLevel of the current project- Parameters:
accessLevel
- if not provided revoke any universal access level assigned from the project- Throws:
ProjectUpdateException
ReservedPropertyUpdateException
-
updateUniversalProjectAccessLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void updateUniversalProjectAccessLevel(String projectName, @Optional ProjectACL.AccessLevel accessLevel) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException Update the universal (for every consumer) AccessLevel of the given project- Parameters:
projectName
-accessLevel
- if not provided revoke any universal access level assigned from the project- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
ReservedPropertyUpdateException
-
updateLockLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'U\')") public void updateLockLevel(ProjectACL.LockLevel lockLevel) throws ProjectUpdateException, ReservedPropertyUpdateException Updates the lock level of the accessed project- Parameters:
lockLevel
-- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
ReservedPropertyUpdateException
-
updateProjectLockLevel
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void updateProjectLockLevel(String projectName, ProjectACL.LockLevel lockLevel) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException Updates the lock level of the project with the givenprojectName
- Parameters:
projectName
-lockLevel
-- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
ReservedPropertyUpdateException
-
setProjectLabels
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'U\', #projectName)") public void setProjectLabels(String projectName, Map<String, String> labels) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException -
getLastConnectionInfo
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public com.fasterxml.jackson.databind.JsonNode getLastConnectionInfo(String projectName) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException returns the last connection info (user, timestamp, sessionId) of the given project. This service requires admin capabilities since it is a cross-project service. Moreover, it wouldn't make sense for a PM to retrieve this info because, given that a user has a PM role only after he accesses the project, it would always return the same PM-user as last connected- Parameters:
projectName
-- Returns:
- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
-
deleteProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void deleteProject(String projectName) throws ProjectDeletionException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException, InvalidProjectNameException, ProjectInexistentException, IOException -
deleteAllFacetsIndexes
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void deleteAllFacetsIndexes() -
accessProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void accessProject(ProjectConsumer consumer, String projectName, ProjectACL.AccessLevel requestedAccessLevel, ProjectACL.LockLevel requestedLockLevel) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ForbiddenProjectAccessException - Parameters:
consumer
-projectName
-requestedAccessLevel
-requestedLockLevel
-- Throws:
ForbiddenProjectAccessException
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
IOException
ProjectBindingException
RBACException
-
accessAllProjects
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public Map<String,ExceptionDAO> accessAllProjects(@Optional(defaultValue="SYSTEM") ProjectConsumer consumer, @Optional(defaultValue="RW") ProjectACL.AccessLevel requestedAccessLevel, @Optional(defaultValue="R") ProjectACL.LockLevel requestedLockLevel, @Optional(defaultValue="false") boolean onlyProjectsAtStartup) throws ProjectAccessException - Throws:
ProjectAccessException
-
disconnectFromAllProjects
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void disconnectFromAllProjects(@Optional(defaultValue="SYSTEM") ProjectConsumer consumer) throws ProjectAccessException - Throws:
ProjectAccessException
-
disconnectFromProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void disconnectFromProject(ProjectConsumer consumer, String projectName) - Parameters:
consumer
-projectName
-
-
cloneProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void cloneProject(String projectName, String newProjectName) throws InvalidProjectNameException, DuplicatedResourceException, IOException, ProjectInexistentException, ProjectAccessException saves projectprojectName
tonewProject
- Parameters:
projectName
-- Throws:
ProjectInexistentException
IOException
DuplicatedResourceException
InvalidProjectNameException
ProjectAccessException
-
exportProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void exportProject(jakarta.servlet.http.HttpServletResponse oRes, @RequestParam("projectName") String projectName) throws IOException, ProjectAccessException - Throws:
IOException
ProjectAccessException
-
importProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void importProject(org.springframework.web.multipart.MultipartFile importPackage, String newProjectName) throws IOException, ProjectCreationException, DuplicatedResourceException, ProjectUpdateException, InvalidProjectNameException - Parameters:
importPackage
-newProjectName
-- Throws:
InvalidProjectNameException
ProjectUpdateException
ProjectInconsistentException
DuplicatedResourceException
ProjectCreationException
IOException
ProjectBindingException
ProjectAccessException
ProjectInexistentException
-
getProjectPropertyMap
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'pm(project)\', \'R\')") public Collection<ProjectPropertyInfo> getProjectPropertyMap(String projectName) throws InvalidProjectNameException, ProjectInexistentException, IOException this service returns a list name-value for all the property of a given project. Returns a response with elements calledpropertyTag
with attributespropNameAttr
for property name and- Parameters:
projectName
- (optional)the project queried for properties- Returns:
- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
IOException
-
getProjectPropertyFileContent
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public String getProjectPropertyFileContent(String projectName) throws InvalidProjectNameException, ProjectInexistentException, IOException this service returns a list name-value for all the property of a given project. Returns a response with elements calledpropertyTag
with attributespropNameAttr
for property name and- Parameters:
projectName
- (optional)the project queried for properties- Returns:
- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
IOException
-
saveProjectPropertyFileContent
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void saveProjectPropertyFileContent(String projectName, String content) throws InvalidProjectNameException, ProjectInexistentException, IOException -
setProjectProperty
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'U\', #projectName)") public void setProjectProperty(String projectName, String propName, @Optional String propValue) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException, ReservedPropertyUpdateException This service sets the value of a property of the current project.- Parameters:
propName
-propValue
-- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
ReservedPropertyUpdateException
ProjectUpdateException
-
setProjectFacets
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorizedInProject(\'pm(project)\', \'U\', #projectName)") public void setProjectFacets(String projectName, com.fasterxml.jackson.databind.node.ObjectNode facets) throws IllegalStateException, NoSuchSettingsManager, STPropertyUpdateException, WrongPropertiesException, STPropertyAccessException, ProjectAccessException, InvalidProjectNameException, ProjectInexistentException, IOException, PropertyNotFoundException Sets the facets of a project -
getProjectFacets
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public ProjectFacets getProjectFacets(String projectName) throws IllegalStateException, STPropertyAccessException, NoSuchSettingsManager, ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Returns the facets of a project- Parameters:
projectName
-- Throws:
NoSuchSettingsManager
STPropertyAccessException
IllegalStateException
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
getProjectFacetsForm
@STServiceOperation public ProjectFacets getProjectFacetsForm() throws IllegalStateException, STPropertyAccessExceptionReturns an uninitialized form for project facets. Differently fromgetProjectFacets(String)
, this operation doesn't accept a project name as argument nor does it look at the current project -
getCustomProjectFacetsSchema
@STServiceOperation public STPropertiesSchema getCustomProjectFacetsSchema() throws IllegalStateException, STPropertyAccessException, NoSuchSettingsManagerReturns the schema of custom project facets -
setCustomProjectFacetsSchema
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setCustomProjectFacetsSchema(com.fasterxml.jackson.databind.node.ObjectNode facetsSchema) throws IllegalStateException, NoSuchSettingsManager, STPropertyUpdateException, WrongPropertiesException, STPropertyAccessException Sets the schema of custom project facets- Parameters:
facetsSchema
-- Throws:
IllegalStateException
NoSuchSettingsManager
STPropertyUpdateException
WrongPropertiesException
STPropertyAccessException
-
getRepositories
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Collection<RepositorySummary> getRepositories(String projectName, @Optional(defaultValue="false") boolean excludeLocal) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException Returns the repositories associated with a (closed) project. Optionally, it is possible to skip local repositories.- Parameters:
projectName
-excludeLocal
-- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
modifyRepositoryAccessCredentials
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void modifyRepositoryAccessCredentials(String projectName, String repositoryID, @Optional String newUsername, @Optional String newPassword) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Modifies the access credentials of a repository associated with a given (closed) project. The new username and password are optional: if they are not given, they are considerednull
, thus indicating an unprotected repository.- Parameters:
projectName
-repositoryID
-newUsername
-newPassword
-- Throws:
ProjectAccessException
InvalidProjectNameException
ProjectInexistentException
-
batchModifyRepostoryAccessCredentials
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void batchModifyRepostoryAccessCredentials(String projectName, String serverURL, @Optional(defaultValue="false") boolean matchUsername, @Optional String currentUsername, @Optional String newUsername, @Optional String newPassword) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Modifies the access credentials of (possibly) many repositories at once. The repositories shall match the providedserverURL
andcurrentUsername
(only ifmatchUsername
istrue
). When username matching is active, anull
value forcurrentUsername
indicates repositories with no associated username.- Parameters:
projectName
-serverURL
-matchUsername
-currentUsername
-newUsername
-newPassword
-- Throws:
ProjectAccessException
InvalidProjectNameException
ProjectInexistentException
-
preloadDataFromFile
@STServiceOperation(method=POST) @PreAuthorize("@auth.isSuperUser(false)") public PreloadedDataSummary preloadDataFromFile(org.springframework.web.multipart.MultipartFile preloadedData, org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat) throws IOException, org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException, it.uniroma2.art.lime.profiler.ProfilerException, it.uniroma2.art.maple.orchestration.AssessmentException, STPropertyAccessException Preloads data contained provided in the request body.- Parameters:
preloadedData
-preloadedDataFormat
-- Returns:
- Throws:
IOException
it.uniroma2.art.lime.profiler.ProfilerException
org.eclipse.rdf4j.repository.RepositoryException
org.eclipse.rdf4j.rio.RDFParseException
it.uniroma2.art.maple.orchestration.AssessmentException
STPropertyAccessException
-
preloadDataFromURL
@STServiceOperation(method=POST) @PreAuthorize("@auth.isSuperUser(false)") public PreloadedDataSummary preloadDataFromURL(URL preloadedDataURL, @Optional org.eclipse.rdf4j.rio.RDFFormat preloadedDataFormat) throws IOException, org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException, it.uniroma2.art.lime.profiler.ProfilerException, it.uniroma2.art.maple.orchestration.AssessmentException, STPropertyAccessException Preloads data from URL.- Parameters:
preloadedDataURL
-preloadedDataFormat
-- Returns:
- Throws:
IOException
FileNotFoundException
it.uniroma2.art.lime.profiler.ProfilerException
org.eclipse.rdf4j.repository.RepositoryException
org.eclipse.rdf4j.rio.RDFParseException
it.uniroma2.art.maple.orchestration.AssessmentException
STPropertyAccessException
-
preloadDataFromCatalog
@STServiceOperation(method=POST) @PreAuthorize("@auth.isSuperUser(false)") public PreloadedDataSummary preloadDataFromCatalog(String connectorId, String datasetId) throws IOException, org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException, it.uniroma2.art.lime.profiler.ProfilerException, it.uniroma2.art.maple.orchestration.AssessmentException, STPropertyAccessException Preloads data from a catalog.- Parameters:
connectorId
-datasetId
-- Returns:
- Throws:
IOException
it.uniroma2.art.lime.profiler.ProfilerException
org.eclipse.rdf4j.repository.RepositoryException
org.eclipse.rdf4j.rio.RDFParseException
it.uniroma2.art.maple.orchestration.AssessmentException
STPropertyAccessException
-
getFacetsAndValue
@STServiceOperation public Map<String,List<String>> getFacetsAndValue(@Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws IOException, ProjectAccessException - Throws:
IOException
ProjectAccessException
-
getFacetsAndValueWithCount
@STServiceOperation public Map<String,Map<String, getFacetsAndValueWithCountInteger>> (@Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws IOException, ProjectAccessException - Throws:
IOException
ProjectAccessException
-
createFacetIndex
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void createFacetIndex() throws PropertyNotFoundException, InvalidProjectNameException, ProjectAccessException, IOExceptionCreate the Lucene index for the facets in ALL projects -
recreateFacetIndexForProject
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void recreateFacetIndexForProject(String projectName) throws PropertyNotFoundException, InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, IOException Create the Lucene index for the facets in ALL projects -
retrieveProjects
@STServiceOperation(method=POST) public Map<String,List<ProjectInfo>> retrieveProjects(String bagOf, @Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws IOException, InvalidProjectNameException, ProjectAccessException, PropertyNotFoundException retrive the list of the projects, grouped by the value of a specific facet- Parameters:
bagOf
- the name of the facet that will be used to group the returning projectsuserDependent
-onlyOpen
-- Returns:
- Throws:
IOException
InvalidProjectNameException
ProjectAccessException
PropertyNotFoundException
-
searchAndRetriveProjects
@STServiceOperation(method=POST) public Map<String,List<ProjectInfo>> searchAndRetriveProjects(@Optional String bagOf, Map<String, List<String>> facetToValueListMap, @Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws ProjectAccessException, InvalidProjectNameException, IOException, PropertyNotFoundException -
searchAndRetriveFacets
@STServiceOperation(method=POST) public Map<String,Map<String, searchAndRetriveFacetsInteger>> (Map<String, List<String>> facetToValueListMap, @Optional(defaultValue="false") boolean userDependent, @Optional(defaultValue="false") boolean onlyOpen, @Optional(defaultValue="") List<ProjectVisibility> visibilityFilter) throws ProjectAccessException, InvalidProjectNameException, IOException, PropertyNotFoundException -
setBlacklistingEnabled
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setBlacklistingEnabled(String projectName, boolean blacklistingEnabled) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Enables/disables blacklisting in a closed project with validation already enabled- Parameters:
projectName
-blacklistingEnabled
-- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
setSHACLValidationEnabled
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setSHACLValidationEnabled(String projectName, boolean shaclValidationEnabled) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Sets whether SHACL validation on commit is enabled in a closed project- Parameters:
projectName
-shaclValidationEnabled
-- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
isSHACLValidationEnabled
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean isSHACLValidationEnabled(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells whether SHACL validation on commit is enabled in a closed project.- Parameters:
projectName
-- Returns:
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
setQueryTimeout
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setQueryTimeout(String projectName, int timeoutInSeconds) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Sets the query timeout. If the passed value is greater than zero, also the "Throw exception on query timeout" is set to true (false is the passed value is 0 or less)- Parameters:
projectName
- the name of the projecttimeoutInSeconds
- the number of second to set for the timeout (a value of 0 or less it means that the is no timeout)- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
getQueryTimeoutValue
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Integer getQueryTimeoutValue(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells the current value of the query timeout, in seconds.- Parameters:
projectName
- the name of the project- Returns:
- the current value of the query timeout, in seconds
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
isQueryEvaluationExceptionForTimeoutEnabled
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean isQueryEvaluationExceptionForTimeoutEnabled(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells whether http://www.ontotext.com/config/graphdb#throw-QueryEvaluationException-on-timeout is true or false- Parameters:
projectName
- the name of the project- Returns:
- the value of the property http://www.ontotext.com/config/graphdb#throw-QueryEvaluationException-on-timeout
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
setUndoEnabled
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setUndoEnabled(String projectName, boolean undoEnabled) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Sets whether undo is enabled in a closed project. Undo can be enabled on projects with history or validation and in any project in which the change tracker happens to be set up (seeisChangeTrackerSetUp(String)
- Parameters:
projectName
-undoEnabled
-- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
isUndoEnabled
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean isUndoEnabled(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells whether undo is enabled in a closed project.- Parameters:
projectName
-- Returns:
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
setTrivialInferenceEnabled
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setTrivialInferenceEnabled(String projectName, boolean trivialInferenceEnabled) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Sets whether Trivial Inference is enabled in a closed project- Parameters:
projectName
-trivialInferenceEnabled
-- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
isTrivialInferenceEnabled
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean isTrivialInferenceEnabled(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells whether trivial inference is enabled in a closed project.- Parameters:
projectName
-- Returns:
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
setReadOnly
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setReadOnly(String projectName, boolean readOnly) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException, ProjectUpdateException -
setVisibility
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setVisibility(String projectName, ProjectVisibility visibility) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException, ProjectUpdateException -
isChangeTrackerSetUp
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean isChangeTrackerSetUp(String projectName) throws ProjectAccessException, ProjectInexistentException, InvalidProjectNameException Tells whether the change tracker is set up for a closed project.- Parameters:
projectName
-- Returns:
- Throws:
ProjectAccessException
ProjectInexistentException
InvalidProjectNameException
-
setOpenAtStartup
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAdmin()") public void setOpenAtStartup(String projectName, boolean openAtStartup) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException, ProjectUpdateException Enables/Disables the possibility to automatically open a project when SemanticTurkey is executed- Parameters:
projectName
-openAtStartup
-- Throws:
InvalidProjectNameException
ProjectInexistentException
ProjectAccessException
ProjectUpdateException
-
getOpenAtStartup
@STServiceOperation @PreAuthorize("@auth.isAdmin()") public Boolean getOpenAtStartup(String projectName) throws InvalidProjectNameException, ProjectInexistentException, ProjectAccessException -
getRenderingEngineConfiguration
@PreAuthorize("@auth.isAdmin()") @STServiceOperation public org.apache.commons.lang3.tuple.Pair<String,STProperties> getRenderingEngineConfiguration(String projectName) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Returns the rendering engine associated with a project together with its (optional) configuration- Parameters:
projectName
-- Returns:
- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
updateRenderingEngineConfiguration
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void updateRenderingEngineConfiguration(String projectName, PluginSpecification renderingEngineSpecification) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Updates the configuration of the rendering engine associated with a project- Parameters:
projectName
-renderingEngineSpecification
-- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
getURIGeneratorConfiguration
@PreAuthorize("@auth.isAdmin()") @STServiceOperation public org.apache.commons.lang3.tuple.Pair<String,STProperties> getURIGeneratorConfiguration(String projectName) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Returns the uri generator associated with a project together with its (optional) configuration- Parameters:
projectName
-- Returns:
- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
updateURIGeneratorConfiguration
@PreAuthorize("@auth.isAdmin()") @STServiceOperation(method=POST) public void updateURIGeneratorConfiguration(String projectName, PluginSpecification uriGeneratorSpecification) throws ProjectAccessException, InvalidProjectNameException, ProjectInexistentException Updates the configuration of the uri generator associated with a project- Parameters:
projectName
-uriGeneratorSpecification
-- Throws:
ProjectInexistentException
InvalidProjectNameException
ProjectAccessException
-
getBoundComponentConfiguration
protected org.apache.commons.lang3.tuple.Pair<String,STProperties> getBoundComponentConfiguration(Project project, String factoryIdProp, String configFilename) throws RuntimeException - Throws:
RuntimeException
-
listSearchProjectsGroups
@STServiceOperation public List<ProjectsSearchGroup> listSearchProjectsGroups() throws InvalidProjectNameException, STPropertyAccessException, NoSuchSettingsManager, STPropertyUpdateException
-