Class EditExtractionClientSideElement

All Implemented Interfaces:
ClientSideElement, LogEnabled, PluginAware, Configurable, Serviceable

This client site element manages a button to create an extraction definition file
  • Field Details

    • ROLE

      public static final String ROLE
      The Avalon role name
  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Overrides:
      service in class StaticFileImportsClientSideElement
      Throws:
      ServiceException
    • createExtraction

      public Map<String,Object> createExtraction(String relativeDefinitionFilePath, String language) throws Exception
      Creates an extraction definition file.
      Parameters:
      relativeDefinitionFilePath - The path of the extraction definition file to create. This path has to be relative to the base definition directory.
      language - the language used to create the description
      Returns:
      Map containing success boolean and the created extraction informations, or error codes if one occurs
      Throws:
      Exception - if an error occurs
    • addDescription

      public Map<String,Object> addDescription(String definitionFileName, String descriptionId) throws Exception
      Adds a description to an extraction.
      Parameters:
      definitionFileName - The extraction definition file name
      descriptionId - the identifier of the description
      Returns:
      Map containing success boolean and error codes if one occurs
      Throws:
      Exception - if an error occurs
    • changeVisibility

      public Map<String,Object> changeVisibility(String definitionFileName, String visibilityStr) throws Exception
      Changes the visibility of an extraction
      Parameters:
      definitionFileName - The extraction definition file name
      visibilityStr - The new visibility
      Returns:
      Map containing success boolean and error codes if one occurs
      Throws:
      Exception - if an error occurs
    • addGrantedUsers

      public Map<String,Object> addGrantedUsers(String definitionFileName, String profileId, List<Map<String,String>> users) throws Exception
      Assign rights to the given users on the given extraction
      Parameters:
      definitionFileName - The extraction definition file name
      profileId - The profile id
      users - The users to grant
      Returns:
      A result map
      Throws:
      Exception - if an error occurs
    • addGrantedGroups

      public Map<String,Object> addGrantedGroups(String definitionFileName, String profileId, List<Map<String,String>> groups) throws Exception
      Assign rights to the given groups on the given extraction
      Parameters:
      definitionFileName - The extraction definition file name
      profileId - The profile id
      groups - The groups to grant
      Returns:
      A result map
      Throws:
      Exception - if an error occurs
    • removeAssignment

      public Map<String,Object> removeAssignment(String definitionFileName, String profileId, List<Map<String,String>> users, List<Map<String,String>> groups) throws Exception
      Remove rights to the given users on the given query
      Parameters:
      definitionFileName - The extraction definition file name
      profileId - The profile id
      users - The users to remove
      groups - The groups to remove
      Returns:
      A result map
      Throws:
      Exception - if an error occurs
    • renameExtraction

      public Map<String,Object> renameExtraction(String relativeOldFilePath, String newFileName) throws Exception
      Renames an extraction definition file.
      Parameters:
      relativeOldFilePath - The extraction definition old file path, relative to the base definitions directory
      newFileName - The extraction definition new file name
      Returns:
      Map containing success boolean and error codes if one occurs
      Throws:
      Exception - if an error occurs
    • deleteExtraction

      public boolean deleteExtraction(String definitionFileName) throws Exception
      Deletes an extraction definition file.
      Parameters:
      definitionFileName - The extraction definition file to delete
      Returns:
      true if extraction deletion succeed, false otherwise
      Throws:
      Exception - if an error occurs