Class HomepageLinkedDataGeneratorImpl

java.lang.Object
org.broadleafcommerce.core.web.linkeddata.generator.AbstractLinkedDataGenerator
org.broadleafcommerce.core.web.linkeddata.generator.HomepageLinkedDataGeneratorImpl
All Implemented Interfaces:
LinkedDataGenerator

@Service("blHomepageLinkedDataGenerator") public class HomepageLinkedDataGeneratorImpl extends AbstractLinkedDataGenerator
This generator generates structured data specific for a homepage, namely the search action. The search action allows search engines to recognize the site has a search feature and allows users to search the site directly from the search engine.

See http://schema.org/Organization, http://schema.org/ContactPoint, http://schema.org/WebSite, and http://schema.org/SearchAction

Author:
Jacob Mitash, Nathan Moore (nathanmoore).
  • Constructor Details

    • HomepageLinkedDataGeneratorImpl

      public HomepageLinkedDataGeneratorImpl()
  • Method Details

    • canHandle

      public boolean canHandle(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: LinkedDataGenerator
      Determines whether or not this LinkedDataGenerator can handle the incoming request.
      Specified by:
      canHandle in interface LinkedDataGenerator
      Specified by:
      canHandle in class AbstractLinkedDataGenerator
      Returns:
      whether to handle the destination type
    • getLinkedDataJsonInternal

      protected org.codehaus.jettison.json.JSONArray getLinkedDataJsonInternal(String url, jakarta.servlet.http.HttpServletRequest request, org.codehaus.jettison.json.JSONArray schemaObjects) throws org.codehaus.jettison.json.JSONException
      Specified by:
      getLinkedDataJsonInternal in class AbstractLinkedDataGenerator
      Throws:
      org.codehaus.jettison.json.JSONException
    • addOrganizationData

      protected org.codehaus.jettison.json.JSONObject addOrganizationData(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException
      Generates an object representing the Schema.org organization
      Returns:
      JSON representation of Organization from Schema.org
      Throws:
      org.codehaus.jettison.json.JSONException
    • addContactData

      protected org.codehaus.jettison.json.JSONArray addContactData(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException
    • addWebSiteData

      protected org.codehaus.jettison.json.JSONObject addWebSiteData(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException
      Generates an object representing the Schema.org WebSite
      Returns:
      JSON representation of WebSite from Schema.org
      Throws:
      org.codehaus.jettison.json.JSONException
    • getLogoUrl

      protected String getLogoUrl() throws org.codehaus.jettison.json.JSONException
      Generates an object representing the Schema.org image for the site logo
      Returns:
      JSON representation of Schema.org image for site logo
      Throws:
      org.codehaus.jettison.json.JSONException
    • addSocialMediaData

      protected org.codehaus.jettison.json.JSONArray addSocialMediaData(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException
      Generates a JSON array of the organization's social media sites
      Throws:
      org.codehaus.jettison.json.JSONException
    • addPotentialActions

      protected org.codehaus.jettison.json.JSONObject addPotentialActions(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException
    • siteHasCustomerServiceNumber

      protected boolean siteHasCustomerServiceNumber()
    • siteHasSocialLinks

      protected boolean siteHasSocialLinks()
    • getSiteLogo

      protected String getSiteLogo()
    • getSiteCustomerServiceNumber

      protected String getSiteCustomerServiceNumber()
    • getSiteSocialAccounts

      protected String getSiteSocialAccounts()
    • getSiteSearchUri

      protected String getSiteSearchUri()
    • getSiteName

      protected String getSiteName()