Interface SocialBookmark


public interface SocialBookmark
Provides a specialized interface to define a social bookmark.

Every OSGi service registered with this interface is available in the social bookmarks configuration menu. When registering an implementation, the property social.bookmarks.type must be set to a unique key identifying the sharing service (e.g., facebook). If two services share the same value for this property, the one with the highest service ranking is used.

  • Method Summary

    Modifier and Type
    Method
    Description
    getName(Locale locale)
    Returns the social bookmark's name.
    getPostURL(String title, String url)
    Returns the URL that users are redirected to when clicking the social bookmark.
    void
    render(String target, String title, String url, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
    Renders the social bookmark's content.
  • Method Details

    • getName

      String getName(Locale locale)
      Returns the social bookmark's name. This name is displayed in settings, tooltips, etc.
      Parameters:
      locale - the requested locale of the message
      Returns:
      the social bookmark's name
    • getPostURL

      String getPostURL(String title, String url)
      Returns the URL that users are redirected to when clicking the social bookmark.
      Parameters:
      title - the title of the content being shared
      url - the URL of the content being shared (e.g., the current page)
      Returns:
      the URL that users are redirected to when clicking the social bookmark
    • render

      void render(String target, String title, String url, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException, javax.servlet.ServletException
      Renders the social bookmark's content. This method is called when using the inline display style.

      This typically renders a link to the sharing URL with a custom icon or image. However, if the sharing platform provides code to display the bookmark, it can also be rendered from this method.

      Parameters:
      target - the desired target for the link (e.g., _blank)
      title - the title of the content being shared
      url - the URL of the content being shared (e.g., the current page)
      httpServletRequest - the servlet request
      httpServletResponse - the servlet response
      Throws:
      IOException - if an IO exception occurred
      javax.servlet.ServletException - if a servlet exception occurred