Class ProductLinkedDataGeneratorImpl

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

@Service("blProductLinkedDataGenerator") public class ProductLinkedDataGeneratorImpl extends AbstractLinkedDataGenerator
This generator generates structured data specific to product pages.

See http://schema.org/Product, http://schema.org/Offer, and http://schema.org/AggregateOffer

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

  • Constructor Details

    • ProductLinkedDataGeneratorImpl

      public ProductLinkedDataGeneratorImpl()
  • 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
    • getProduct

      protected Product getProduct(jakarta.servlet.http.HttpServletRequest request)
    • addProductData

      protected org.codehaus.jettison.json.JSONObject addProductData(jakarta.servlet.http.HttpServletRequest request, Product product, String url) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException
    • addImageUrl

      protected void addImageUrl(Product product, org.codehaus.jettison.json.JSONObject productData) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException
    • getImageUrlPrefix

      protected String getImageUrlPrefix()
    • getAssetServerUrlPrefix

      protected String getAssetServerUrlPrefix()
    • addSkus

      protected void addSkus(jakarta.servlet.http.HttpServletRequest request, Product product, org.codehaus.jettison.json.JSONObject productData, String url) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException
    • determineAvailability

      protected String determineAvailability(Sku sku)
    • addReviewData

      protected void addReviewData(jakarta.servlet.http.HttpServletRequest request, Product product, org.codehaus.jettison.json.JSONObject productData) throws org.codehaus.jettison.json.JSONException
      Throws:
      org.codehaus.jettison.json.JSONException