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

    • IN_STOCK

      protected static final String IN_STOCK
      See Also:
    • OUT_OF_STOCK

      protected static final String OUT_OF_STOCK
      See Also:
    • ISO_8601_FORMAT

      protected static final DateFormat ISO_8601_FORMAT
    • ratingService

      protected org.broadleafcommerce.core.rating.service.RatingService ratingService
    • catalogService

      protected org.broadleafcommerce.core.catalog.service.CatalogService catalogService
  • 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 org.broadleafcommerce.core.catalog.domain.Product getProduct(jakarta.servlet.http.HttpServletRequest request)
    • addProductData

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

      protected void addImageUrl(org.broadleafcommerce.core.catalog.domain.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, org.broadleafcommerce.core.catalog.domain.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(org.broadleafcommerce.core.catalog.domain.Sku sku)
    • addReviewData

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