Class ProjectGroupBindingsManager

java.lang.Object
it.uniroma2.art.semanticturkey.user.ProjectGroupBindingsManager

public class ProjectGroupBindingsManager extends Object
  • Constructor Details

    • ProjectGroupBindingsManager

      public ProjectGroupBindingsManager()
  • Method Details

    • loadPGBindings

      public static void loadPGBindings() throws org.eclipse.rdf4j.rio.RDFParseException, org.eclipse.rdf4j.repository.RepositoryException, IOException, ProjectAccessException
      Loads 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

      public static Collection<ProjectGroupBinding> listPGBindings()
      Returns all the project-group bindings
      Returns:
    • getPGBinding

      public static ProjectGroupBinding getPGBinding(UsersGroup group, AbstractProject project)
      Returns the ProjectGroupBinding that binds the given group and project
      Parameters:
      group -
      project -
      Returns:
    • listPGBindingsOfProject

      public static Collection<ProjectGroupBinding> listPGBindingsOfProject(AbstractProject project)
      Returns the ProjectGroupBindings of the given project
      Parameters:
      project -
      Returns:
    • existsPGBindingsOfProject

      public static boolean existsPGBindingsOfProject(AbstractProject project)
      Checks if there is the folder of project-group bindings for the given project
      Parameters:
      project -
      Returns:
    • createPGBindingsOfProject

      public static void createPGBindingsOfProject(AbstractProject project)
      Creates all the project-group bindings folders related to the given project. Useful when a project is created/imported
      Parameters:
      project -
    • deletePGBindingsOfProject

      public static void deletePGBindingsOfProject(String projectName) throws IOException
      When a project is deleted, deletes all the project-group bindings folders related to the given project
      Parameters:
      projectName -
      Throws:
      IOException
    • createPGBindingsOfGroup

      public static void createPGBindingsOfGroup(UsersGroup group) throws ProjectAccessException
      Creates all the project-group bindings folders related to the given group. Useful when a group is created/imported
      Throws:
      ProjectAccessException
      IOException
    • deletePGBindingsOfGroup

      public static void deletePGBindingsOfGroup(UsersGroup group) throws IOException
      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 the or parameter.
      Parameters:
      user -
      project -
      schemes -
      or - if true the method returns true if one of the schemes is owned by the user's group, if false returns true if all the schemes are owned by the user's group
      Returns:
      Throws:
      STPropertyAccessException
    • getProjBindingsFolder

      public static File getProjBindingsFolder(AbstractProject project)
      Returns the folder about the given project under /pg_bindings/
      Parameters:
      project -
      Returns:
    • getProjBindingsFolder

      public static File getProjBindingsFolder(String projectName)
      Returns the folder about the given project under /pg_bindings/
      Parameters:
      projectName -
      Returns:
    • getPGBindingsFolder

      public static File getPGBindingsFolder(AbstractProject project, UsersGroup group)
      Returns the user folders under /pg_bindings// for the given project-group pair
      Parameters:
      project -
      group -
      Returns:
    • getGroupBindingsFolders

      public static Collection<File> getGroupBindingsFolders(UsersGroup group)
      Returns the group folders under all the /pg_bindings// folders
      Returns:
    • getPGBindingFolder

      public static File getPGBindingFolder(AbstractProject project, UsersGroup group)
      Returns (and create if it doesn't exist) a folder for the given project-group binding.
      Parameters:
      project -
      group -
      Returns:
    • getPUBindingsFolder

      public static File getPUBindingsFolder(AbstractProject project, STUser user)
      Returns the user folders under /pu_bindings// for the given project-user pair
      Parameters:
      project -
      user -
      Returns: