Class ProjectGroupBindingsManager
java.lang.Object
it.uniroma2.art.semanticturkey.user.ProjectGroupBindingsManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addSchemesToPGBinding
(UsersGroup group, AbstractProject project, Collection<org.eclipse.rdf4j.model.IRI> schemes) Adds schemes to the binding between the given project-group pairstatic void
addSchemeToPGBinding
(UsersGroup group, AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) Adds role to the binding between the given project-group pairstatic void
Creates all the project-group bindings folders related to the given group.static void
createPGBindingsOfProject
(AbstractProject project) Creates all the project-group bindings folders related to the given project.static void
When a group is deleted, deletes all the project-group bindings folders related to the given groupstatic void
deletePGBindingsOfProject
(String projectName) When a project is deleted, deletes all the project-group bindings folders related to the given projectstatic boolean
existsPGBindingsOfProject
(AbstractProject project) Checks if there is the folder of project-group bindings for the given projectstatic Collection<File>
Returns the group folders under all the/pg_bindings/ / folders static ProjectGroupBinding
getPGBinding
(UsersGroup group, AbstractProject project) Returns the ProjectGroupBinding that binds the given group and projectstatic File
getPGBindingFolder
(AbstractProject project, UsersGroup group) Returns (and create if it doesn't exist) a folder for the given project-group binding.static File
getPGBindingsFolder
(AbstractProject project, UsersGroup group) Returns the user folders under/pg_bindings/ / for the given project-group pair static File
getProjBindingsFolder
(AbstractProject project) Returns the folder about the given project under/pg_bindings/ static File
getProjBindingsFolder
(String projectName) Returns the folder about the given project under/pg_bindings/ static File
getPUBindingsFolder
(AbstractProject project, STUser user) Returns the user folders under/pu_bindings/ / for the given project-user pair static boolean
hasUserOwnershipOfSchemes
(STUser user, Project project, List<org.eclipse.rdf4j.model.IRI> schemes, boolean or) Returns true if user belongs to a group that has ownership on the given schemes.static Collection<ProjectGroupBinding>
Returns all the project-group bindingsstatic Collection<ProjectGroupBinding>
listPGBindingsOfProject
(AbstractProject project) Returns the ProjectGroupBindings of the given projectstatic void
Loads all the bindings into the repository Protected since the load should be done just once by AccessControlManager during its initializationstatic void
removeAllSchemesFromPGBinding
(UsersGroup group, AbstractProject project) Remove all the schemes assigned to a group in a projectstatic void
removeSchemeFromPGBinding
(UsersGroup group, AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) Removes a scheme from the binding between the given project-group pairstatic void
removeSchemeFromPGBindings
(AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) Removes a scheme from all the bindings of the given project (useful in case a group is deleted)
-
Constructor Details
-
ProjectGroupBindingsManager
public ProjectGroupBindingsManager()
-
-
Method Details
-
loadPGBindings
public static void loadPGBindings() throws org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException, IOException, ProjectAccessExceptionLoads all the bindings into the repository Protected since the load should be done just once by AccessControlManager during its initialization- Throws:
IOException
org.eclipse.rdf4j.repository.RepositoryException
org.eclipse.rdf4j.rio.RDFParseException
ProjectAccessException
-
listPGBindings
Returns all the project-group bindings- Returns:
-
getPGBinding
Returns the ProjectGroupBinding that binds the given group and project- Parameters:
group
-project
-- Returns:
-
listPGBindingsOfProject
Returns the ProjectGroupBindings of the given project- Parameters:
project
-- Returns:
-
existsPGBindingsOfProject
Checks if there is the folder of project-group bindings for the given project- Parameters:
project
-- Returns:
-
createPGBindingsOfProject
Creates all the project-group bindings folders related to the given project. Useful when a project is created/imported- Parameters:
project
-
-
deletePGBindingsOfProject
When a project is deleted, deletes all the project-group bindings folders related to the given project- Parameters:
projectName
-- Throws:
IOException
-
createPGBindingsOfGroup
Creates all the project-group bindings folders related to the given group. Useful when a group is created/imported- Throws:
ProjectAccessException
IOException
-
deletePGBindingsOfGroup
When a group is deleted, deletes all the project-group bindings folders related to the given group- Parameters:
group
-- Throws:
IOException
-
addSchemesToPGBinding
public static void addSchemesToPGBinding(UsersGroup group, AbstractProject project, Collection<org.eclipse.rdf4j.model.IRI> schemes) throws ProjectBindingException Adds schemes to the binding between the given project-group pair- Parameters:
group
-project
-schemes
-- Throws:
ProjectBindingException
-
addSchemeToPGBinding
public static void addSchemeToPGBinding(UsersGroup group, AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) throws ProjectBindingException Adds role to the binding between the given project-group pair- Parameters:
group
-project
-scheme
-- Throws:
ProjectBindingException
-
removeSchemeFromPGBinding
public static void removeSchemeFromPGBinding(UsersGroup group, AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) throws ProjectBindingException Removes a scheme from the binding between the given project-group pair- Parameters:
group
-project
-scheme
-- Throws:
ProjectBindingException
-
removeAllSchemesFromPGBinding
public static void removeAllSchemesFromPGBinding(UsersGroup group, AbstractProject project) throws ProjectBindingException Remove all the schemes assigned to a group in a project- Parameters:
group
-project
-- Throws:
ProjectBindingException
-
removeSchemeFromPGBindings
public static void removeSchemeFromPGBindings(AbstractProject project, org.eclipse.rdf4j.model.IRI scheme) throws ProjectBindingException Removes a scheme from all the bindings of the given project (useful in case a group is deleted)- Parameters:
project
-scheme
-- Throws:
ProjectBindingException
-
hasUserOwnershipOfSchemes
public static boolean hasUserOwnershipOfSchemes(STUser user, Project project, List<org.eclipse.rdf4j.model.IRI> schemes, boolean or) Returns true if user belongs to a group that has ownership on the given schemes. This method evaluates the ownership of the scheme in OR or in AND according to theor
parameter.- Parameters:
user
-project
-schemes
-or
- iftrue
the method returns true if one of the schemes is owned by the user's group, iffalse
returns true if all the schemes are owned by the user's group- Returns:
- Throws:
STPropertyAccessException
-
getProjBindingsFolder
Returns the folder about the given project under/pg_bindings/ - Parameters:
project
-- Returns:
-
getProjBindingsFolder
Returns the folder about the given project under/pg_bindings/ - Parameters:
projectName
-- Returns:
-
getPGBindingsFolder
Returns the user folders under/pg_bindings/ / for the given project-group pair - Parameters:
project
-group
-- Returns:
-
getGroupBindingsFolders
Returns the group folders under all the/pg_bindings/ / folders - Returns:
-
getPGBindingFolder
Returns (and create if it doesn't exist) a folder for the given project-group binding.- Parameters:
project
-group
-- Returns:
-
getPUBindingsFolder
Returns the user folders under/pu_bindings/ / for the given project-user pair - Parameters:
project
-user
-- Returns:
-