Class HighlightGlossaryTerms


  • public class HighlightGlossaryTerms
    extends Object
    Author:
    David Derigent
    • Constructor Detail

      • HighlightGlossaryTerms

        protected HighlightGlossaryTerms()
        default constructor
    • Method Detail

      • searchReplace

        public String searchReplace​(String publicationContent,
                                    String className,
                                    String axisId,
                                    boolean onlyFirst,
                                    String language)
        Search all the term contained in the given glossary and highlight, one or all of the occurrences found in the given text. The regular expression used to retrieve the occurrence works only in HTML code, not in plain text. This code is designed to parse HTML code.
        Parameters:
        publicationContent - the publication text used to perform the highlight operation
        className - the css class name used to "mark" the highlighted term and format his displaying
        axisId - The pdc axis identifier used to load the glossary
        onlyFirst - indicates if all the occurrence of a term must be highlight or only the first
        language - indicates the language use to load information from glossary
        Returns:
        a String which contain given publication with highlight term.