Interface IProjectTranslationStorage

All Superinterfaces:
IManagedService
All Known Implementing Classes:
ProjectTranslationStorage

public interface IProjectTranslationStorage extends IManagedService
The service provides an access to a storage of translations in context of projects.
  • Method Details

    • getTranslations

      List<IProjectTranslation> getTranslations(IExpression expression)
      Returns all translations that have been found by the given query expression.
      Parameters:
      expression - the expression to find translation
      Returns:
      all found translations by the given expression
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • getTranslations

      IPage<IProjectTranslation> getTranslations(IExpression expression, IPageable pageRequest)
      Returns a page of translations found by the given query expression and with restriction provided in the IPageable object.
      Parameters:
      expression - the expression to find translations
      pageRequest - the request that specifies which page to load
      Returns:
      a page of translations
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • getGroupedTranslations

      Returns translations grouped by translated value and which found by the query expression.
      Parameters:
      expression - the expression to find translations
      Returns:
      a translations grouped by translated value
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • addTranslation

      void addTranslation(IProjectTranslation translation)
      Adds a new translation to the storage.
      Parameters:
      translation - the translation to be added
      Throws:
      HistoryDataBaseException - if there is any storage error (including the case when this translation already exists) or the given expression is not correct
    • deleteTranslations

      void deleteTranslations(IExpression expression, Predicate<? super IProjectTranslation> filter)
      Removes translations from the storage which found by the query expression and filtered by the predicated.
      Parameters:
      expression - the query expression for searching translations to remove
      filter - the predicate to filter translations which shouldn't be removed. It removes the translation only if this filter returns true.
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • deleteTranslations

      void deleteTranslations(IExpression expression)
      Removes all translations that found by the query expression.
      Parameters:
      expression - the query expression for searching translations to remove
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • deleteByProject

      void deleteByProject(String projectName)
      Removes all translations from the storage for the given project.
      Parameters:
      projectName - the name of project for which the translations to remove
      Throws:
      HistoryDataBaseException - if there is any storage error or the given expression is not correct
    • getLanguages

      List<String> getLanguages()
      Returns the list of all registered translation languages for all projects.
      Returns:
      the list of translation languages.