Class DefaultLinkedDataGeneratorImpl
java.lang.Object
org.broadleafcommerce.core.web.linkeddata.generator.AbstractLinkedDataGenerator
org.broadleafcommerce.core.web.linkeddata.generator.DefaultLinkedDataGeneratorImpl
- All Implemented Interfaces:
LinkedDataGenerator
@Service("blDefaultLinkedDataGenerator")
public class DefaultLinkedDataGeneratorImpl
extends AbstractLinkedDataGenerator
This generator runs for all pages.
Currently, it only generates breadcrumb structured data.
- Author:
- Jacob Mitash, Nathan Moore (nathanmoore).
-
Field Summary
Fields inherited from class org.broadleafcommerce.core.web.linkeddata.generator.AbstractLinkedDataGenerator
baseUrlResolver, breadcrumbService, DEFAULT_STRUCTURED_CONTENT_CONTEXT, environment, extensionManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.codehaus.jettison.json.JSONObjectaddBreadcrumbData(jakarta.servlet.http.HttpServletRequest request) Generates an object representing the Schema.org BreadcrumbListbooleancanHandle(jakarta.servlet.http.HttpServletRequest request) Determines whether or not this LinkedDataGenerator can handle the incoming request.protected org.codehaus.jettison.json.JSONArraygetLinkedDataJsonInternal(String url, jakarta.servlet.http.HttpServletRequest request, org.codehaus.jettison.json.JSONArray schemaObjects) Methods inherited from class org.broadleafcommerce.core.web.linkeddata.generator.AbstractLinkedDataGenerator
getLinkedDataJSON, getRequestParams, getRequestUri, getSiteBaseUrl, getStructuredDataContext
-
Constructor Details
-
DefaultLinkedDataGeneratorImpl
public DefaultLinkedDataGeneratorImpl()
-
-
Method Details
-
canHandle
public boolean canHandle(jakarta.servlet.http.HttpServletRequest request) Description copied from interface:LinkedDataGeneratorDetermines whether or not this LinkedDataGenerator can handle the incoming request.- Specified by:
canHandlein interfaceLinkedDataGenerator- Specified by:
canHandlein classAbstractLinkedDataGenerator- 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:
getLinkedDataJsonInternalin classAbstractLinkedDataGenerator- Throws:
org.codehaus.jettison.json.JSONException
-
addBreadcrumbData
protected org.codehaus.jettison.json.JSONObject addBreadcrumbData(jakarta.servlet.http.HttpServletRequest request) throws org.codehaus.jettison.json.JSONException Generates an object representing the Schema.org BreadcrumbList- Returns:
- JSON representation of BreadcrumbList from Schema.org
- Throws:
org.codehaus.jettison.json.JSONException
-