Interface TranslationService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addTranslation​(java.lang.String lang, java.util.HashSet<LocalizedText> translations, java.util.Optional<Language> languageOptional)
      This method creates all relationships between database entities.
      java.util.Optional<Language> createLanguage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> langAsMap)
      This method creates a database entity.
      LocalizedText createTranslation​(LocalizedText translation)
      This method creates a database entity.
      java.util.Optional<LocalizedText> createTranslation​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> translationAsMap)
      This method creates a database entity.
      java.util.List<Language> findLanguages()
      This method returns database entities as list.
      java.util.List<LocalizedText> findTranslations()
      This method returns database entities as list.
      java.util.List<LocalizedText> findTranslationsByLangCode​(java.lang.String lang)
      This method returns database entity.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getAlphabetForActiveLanguage​(java.lang.String isUpp)
      Return alphabets of active language code
      java.lang.String getLangFromContext()
      This method returns data as text from context.
      java.util.Map<java.lang.String,​java.lang.String> getTranslatedTimeDuration​(java.lang.String date)
      This method returns data as map.
      java.util.Map<java.lang.String,​java.lang.String> getTranslation​(java.lang.String id, java.lang.String repositoryName)
      This method returns data as map.
      java.util.HashSet<LocalizedText> getTranslations​(java.lang.String langEn, java.lang.String langDe)
      This method returns data as set.
      java.util.Map<java.lang.String,​java.lang.String> getTranslationsByLangCode​(java.lang.String lang)
      This method returns data as map.
      void removeLanguageAndClean​(java.lang.String langId)
      This method removes a database entity and clean all relationships from another entities.
      void removeLanguagesByIds​(java.util.ArrayList<java.lang.String> languageIds)
      This method removes a list of database entities.
      void removeTranslationAndClean​(java.lang.String translationId)
      This method removes a database entity and clean all relationships from another entities.
      void removeTranslationsByIds​(java.util.ArrayList<java.lang.String> translationIds)
      This method removes a list of database entities.
      java.util.Optional<LocalizedText> saveArticle​(java.lang.String text, java.lang.String articleId)
      This method saves a database entity.
      java.util.Optional<Language> saveLanguage​(Language language)
      This method saves a database entity.
      java.util.Optional<Language> saveLanguage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> langAsMap)
      This method save an updates of database entity.
      java.util.Optional<LocalizedText> saveTranslation​(LocalizedText translation)
      This method saves a database entity.
      java.util.Optional<LocalizedText> saveTranslation​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> translationAsMap)
      This method save an updates of database entity.
      java.util.List<Language> searchLanguages​(java.lang.String query, java.lang.String offset, java.lang.String limit)
      This method does search requests and returns data as list.
      java.util.List<LocalizedText> searchTranslations​(java.lang.String query, java.lang.String offset, java.lang.String limit)
      This method does search requests and returns data as list.
    • Method Detail

      • searchTranslations

        java.util.List<LocalizedText> searchTranslations​(java.lang.String query,
                                                         java.lang.String offset,
                                                         java.lang.String limit)
        This method does search requests and returns data as list.
        Parameters:
        query - search query
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        database entities as list
      • findTranslations

        java.util.List<LocalizedText> findTranslations()
        This method returns database entities as list.
        Returns:
        database entities as list
      • findTranslationsByLangCode

        java.util.List<LocalizedText> findTranslationsByLangCode​(java.lang.String lang)
        This method returns database entity.
        Parameters:
        lang - for filter and return database entity
        Returns:
        database entity
      • getTranslationsByLangCode

        java.util.Map<java.lang.String,​java.lang.String> getTranslationsByLangCode​(java.lang.String lang)
        This method returns data as map.
        Parameters:
        lang - field for filter and return data
        Returns:
        data as map
      • getLangFromContext

        java.lang.String getLangFromContext()
        This method returns data as text from context.
        Returns:
        data as text
      • getTranslatedTimeDuration

        java.util.Map<java.lang.String,​java.lang.String> getTranslatedTimeDuration​(java.lang.String date)
        This method returns data as map.
        Parameters:
        date - field for translated
        Returns:
        data as map
      • getTranslation

        java.util.Map<java.lang.String,​java.lang.String> getTranslation​(java.lang.String id,
                                                                              java.lang.String repositoryName)
        This method returns data as map.
        Parameters:
        id - identification for database entity, which will be revers on map
        repositoryName - repository name from where will be returned data
        Returns:
        data as map
      • searchLanguages

        java.util.List<Language> searchLanguages​(java.lang.String query,
                                                 java.lang.String offset,
                                                 java.lang.String limit)
        This method does search requests and returns data as list.
        Parameters:
        query - search query
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        database entities as list
      • findLanguages

        java.util.List<Language> findLanguages()
        This method returns database entities as list.
        Returns:
        database entities as list
      • createTranslation

        java.util.Optional<LocalizedText> createTranslation​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> translationAsMap)
        This method creates a database entity.
        Parameters:
        translationAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • createTranslation

        LocalizedText createTranslation​(LocalizedText translation)
        This method creates a database entity.
        Parameters:
        translation - database entity
        Returns:
        database entity
      • createLanguage

        java.util.Optional<Language> createLanguage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> langAsMap)
        This method creates a database entity.
        Parameters:
        langAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • saveTranslation

        java.util.Optional<LocalizedText> saveTranslation​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> translationAsMap)
        This method save an updates of database entity.
        Parameters:
        translationAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • saveArticle

        java.util.Optional<LocalizedText> saveArticle​(java.lang.String text,
                                                      java.lang.String articleId)
        This method saves a database entity.
        Parameters:
        text - data which will be added in database entity
        articleId - identification for database entity which will be saved or updated
        Returns:
        optional value to externally interaction
      • saveTranslation

        java.util.Optional<LocalizedText> saveTranslation​(LocalizedText translation)
        This method saves a database entity.
        Parameters:
        translation - database entity
        Returns:
        optional value to externally interaction
      • saveLanguage

        java.util.Optional<Language> saveLanguage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> langAsMap)
        This method save an updates of database entity.
        Parameters:
        langAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • saveLanguage

        java.util.Optional<Language> saveLanguage​(Language language)
        This method saves a database entity.
        Parameters:
        language - database entity
        Returns:
        optional value to externally interaction
      • removeTranslationAndClean

        void removeTranslationAndClean​(java.lang.String translationId)
        This method removes a database entity and clean all relationships from another entities.
        Parameters:
        translationId - identification for database entity which will be removed
      • removeTranslationsByIds

        void removeTranslationsByIds​(java.util.ArrayList<java.lang.String> translationIds)
        This method removes a list of database entities.
        Parameters:
        translationIds - the list of database entities which will be removed
      • removeLanguageAndClean

        void removeLanguageAndClean​(java.lang.String langId)
        This method removes a database entity and clean all relationships from another entities.
        Parameters:
        langId - identification for database entity which will be removed
      • removeLanguagesByIds

        void removeLanguagesByIds​(java.util.ArrayList<java.lang.String> languageIds)
        This method removes a list of database entities.
        Parameters:
        languageIds - the list of database entities which will be removed
      • getTranslations

        java.util.HashSet<LocalizedText> getTranslations​(java.lang.String langEn,
                                                         java.lang.String langDe)
        This method returns data as set.
        Parameters:
        langEn - the lang of database entities which will be retrieved
        langDe - the lang of database entities which will be retrieved
        Returns:
        database entities as list
      • addTranslation

        void addTranslation​(java.lang.String lang,
                            java.util.HashSet<LocalizedText> translations,
                            java.util.Optional<Language> languageOptional)
        This method creates all relationships between database entities.
        Parameters:
        lang - the lang of database entities which will be updated
        translations - the list of database entities where will be added other database entity
        languageOptional - the lang of database entities which will be added in list of other database entities
      • getAlphabetForActiveLanguage

        java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getAlphabetForActiveLanguage​(java.lang.String isUpp)
        Return alphabets of active language code
        Parameters:
        isUpp - flag to convert alphabet to uppercase
        Returns:
        list with characters