Class BlogUtils


  • public final class BlogUtils
    extends Object
    Utility class for announce plugin
    • Method Detail

      • buildRequetteWithFilter

        public static String buildRequetteWithFilter​(String strSelect,
                                                     List<String> listStrFilter,
                                                     String strOrder)
        Builds a query with filters placed in parameters
        Parameters:
        strSelect - the select of the query
        listStrFilter - the list of filter to add in the query
        strOrder - the order by of the query
        Returns:
        a query
      • addHeaderResponse

        public static void addHeaderResponse​(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             String strFileName)
        write the http header in the response
        Parameters:
        request - the httpServletRequest
        response - the http response
        strFileName - the name of the file who must insert in the response
      • buildBlogSearchFilter

        public static BlogSearchFilter buildBlogSearchFilter​(String searchKeyword,
                                                             String[] searchTagsArray,
                                                             fr.paris.lutece.portal.business.user.AdminUser user,
                                                             Boolean isUnpublished,
                                                             String strDateUpdateBlogAfter,
                                                             String strDateUpdateBlogBefore,
                                                             String userEditor,
                                                             Locale locale)
        Create a Blog search filter with specific values. The unnecessary parameters can be replaced by null values
        Parameters:
        searchKeyword - Keywords to search for in the blog posts
        searchTagsArray - Specific tags to search for
        user - Filter by the user who created the blog
        isUnpublished - Search for blogs currently unpublished. Set to 'null' to retrieve all blogs, whether published or not
        strDateUpdateBlogAfter - Filter by blogs updated after a specific date
        strDateUpdateBlogBefore - Filter by blogs updated before a specific date
        userEditor - Filter by the last user who edited the blog
        locale - The Locale to use for the dates' format
        Returns:
        the BlogSearchFilter objects created with the given parameters
      • buildCustomBlogLink

        public static String buildCustomBlogLink​(String customLinkUrl,
                                                 String customLinkText,
                                                 String customLinkTitle,
                                                 String targetedWindow)
        Create an HTML link to reach the specified URL
        Parameters:
        customLinkUrl - URL of the link
        customlinkText - Text to display in the link
        customLinkTitle - Title of the link
        targetedWindow - Window where the link will be opened ("_self", "_blank", etc.). Opens in new window by default ("_blank")
        Returns:
        the HTML link to the specified url
      • getPlugin

        public static fr.paris.lutece.portal.service.plugin.Plugin getPlugin()
        Gets the plugin
        Returns:
        the plugin
      • removeAccents

        public static String removeAccents​(String text)