@ConsumerType public abstract class AbstractJcrCommerceService extends java.lang.Object implements CommerceService
CommerceServices on top of the JCR repository.
See GeoCommerceServiceImpl for an example.| Modifier and Type | Field and Description |
|---|---|
AbstractJcrCommerceServiceFactory.Services |
services
Deprecated.
use the
serviceContext field instead. |
| Constructor and Description |
|---|
AbstractJcrCommerceService(AbstractJcrCommerceServiceFactory.Services services)
Deprecated.
since 5.6.1; use
AbstractJcrCommerceService(ServiceContext) instead. |
| Modifier and Type | Method and Description |
|---|---|
void |
catalogRolloutHook(Page blueprint,
Page catalog)
Called during catalog creation or update to allow the commerce implementation to perform
implementation-specific actions.
|
java.lang.Object[] |
deserializeCartEntryData(java.lang.String str)
Creates cart entry data from a String created with
serializeCartEntryData(String, int, org.apache.sling.api.resource.ValueMap). |
java.util.List<PaymentMethod> |
getAvailablePaymentMethods()
Returns a list of available payment methods.
|
java.util.List<Promotion> |
getAvailablePromotions(ResourceResolver resourceResolver)
Returns a list of JCR-based promotions (ie, those known to the
PromotionManager). |
java.util.List<ShippingMethod> |
getAvailableShippingMethods()
Returns a list of available shipping methods.
|
java.util.Map<java.lang.String,java.lang.Object> |
getContext()
Get the context or an empty map if no context has been set before via
CommerceService.setContext(Map). |
VendorJcrPlacedOrder |
getPlacedOrder(java.lang.String orderId,
java.util.Locale locale)
Return a vendor record of a placed order for order administration.
|
ProductCollection |
getProductCollection(java.lang.String path)
Default implementation assumes a JCR-based product collection (in which the path parameter is
truly a path).
|
Promotion |
getPromotion(java.lang.String path)
Default implementation assumes a JCR-based promotion (in which the path parameter is
truly a path).
|
java.lang.String |
getServer()
Get the configured commerce server endpoint.
|
Voucher |
getVoucher(java.lang.String path)
Default implementation assumes a JCR-based voucher (in which the path parameter is
truly a path).
|
boolean |
isActivated(Product product)
Check for public availability of a product.
|
DefaultJcrCartEntry |
newCartEntryImpl(int index,
Product product,
int quantity)
Instantiates a new cart entry.
|
void |
productRolloutHook(Product productData,
Page productPage,
Product productReference)
Called during catalog creation or update to allow the commerce implementation to perform
implementation-specific actions.
|
CommerceResult |
search(CommerceQuery query)
Perform a search.
|
void |
sectionRolloutHook(Page blueprint,
Page section)
Called during catalog creation or update to allow the commerce implementation to perform
implementation-specific actions.
|
java.lang.String |
serializeCartEntryData(java.lang.String productPath,
int quantity,
ValueMap properties)
Converts the cart entry data to a
String of the form "productPath;quantity;property1_name=property1_value\fproperty2_name=property2_value\f...". |
ServiceContext |
serviceContext()
Returns the
ServiceContext of this service. |
void |
setContext(java.util.Map<java.lang.String,java.lang.Object> context)
Set a context for this service instance and any session retrieved from it.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCountries, getCreditCardTypes, getOrderPredicates, getProduct, isAvailable, login@Deprecated public AbstractJcrCommerceServiceFactory.Services services
serviceContext field instead.@Deprecated public AbstractJcrCommerceService(AbstractJcrCommerceServiceFactory.Services services)
AbstractJcrCommerceService(ServiceContext) instead.public ServiceContext serviceContext()
ServiceContext of this service.public void setContext(java.util.Map<java.lang.String,java.lang.Object> context)
Note that the context is not persisted across requests and needs to be set again when creating a new service instance.
setContext in interface CommerceServicepublic java.util.Map<java.lang.String,java.lang.Object> getContext()
CommerceService.setContext(Map).getContext in interface CommerceServicepublic java.lang.String getServer()
getServer in interface CommerceServicepublic boolean isActivated(Product product) throws CommerceException
isActivated in interface CommerceServiceCommerceExceptionpublic Promotion getPromotion(java.lang.String path) throws CommerceException
getPromotion in interface CommerceServicenull if not found.CommerceExceptionpublic Voucher getVoucher(java.lang.String path) throws CommerceException
getVoucher in interface CommerceServicenull if not found.CommerceExceptionpublic ProductCollection getProductCollection(java.lang.String path) throws CommerceException
getProductCollection in interface CommerceServicenull if not found.CommerceExceptionpublic VendorJcrPlacedOrder getPlacedOrder(java.lang.String orderId, java.util.Locale locale)
public void catalogRolloutHook(Page blueprint, Page catalog) throws CommerceException
The catalogRolloutHook is called after the root catalog page is created
or updated.
Note: if changes are made, the appropriate lastModified dates should be updated.
catalogRolloutHook in interface CommerceServiceblueprint - The catalog blueprint.catalog - The catalog page created from the blueprint.CommerceExceptionpublic void sectionRolloutHook(Page blueprint, Page section)
The sectionRolloutHook is called after each section page is created or
updated.
Note: if changes are made, the appropriate lastModified dates should be updated.
sectionRolloutHook in interface CommerceServiceblueprint - The catalog section blueprint.section - The section page created from the blueprint.public void productRolloutHook(Product productData, Page productPage, Product productReference) throws CommerceException
The productRolloutHook is called after each product page is created or
updated.
Note: if changes are made, the appropriate lastModified dates should be updated.
productRolloutHook in interface CommerceServiceproductData - The productData for which the product page was created.productPage - The product page created from the section blueprint's product template.productReference - The product reference on the created/updated page.CommerceExceptionpublic CommerceResult search(CommerceQuery query) throws CommerceException
search in interface CommerceServicequery - The query representing the search parametersCommerceResult representing the search resultsCommerceExceptionpublic java.util.List<Promotion> getAvailablePromotions(ResourceResolver resourceResolver) throws CommerceException
PromotionManager).getAvailablePromotions in interface CommerceServiceresourceResolver - a Sling ResourceResolver instanceList<Promotion> containing the promotions.CommerceExceptionpublic java.util.List<ShippingMethod> getAvailableShippingMethods() throws CommerceException
NB: not in the public interface. All public access should be through
CommerceSession.getAvailableShippingMethods().
Implementations which support session- or order-specific shipping methods should implement
AbstractJcrCommerceSession.getAvailableShippingMethods() instead.
This implementation picks up the shipping methods from the JCR repository. Override to specify a more-specific path or a particular ShippingMethod implementation.
CommerceExceptionpublic java.util.List<PaymentMethod> getAvailablePaymentMethods() throws CommerceException
NB: not in the public interface. All public access should be through
CommerceSession.getAvailablePaymentMethods().
Implementations which support session- or order-specific shipping methods should implement
AbstractJcrCommerceSession.getAvailablePaymentMethods() instead.
This implementation picks up the payment methods from the JCR repository. Override to specify a more-specific path or a particular PaymentMethod implementation.
CommerceExceptionpublic DefaultJcrCartEntry newCartEntryImpl(int index, Product product, int quantity)
DefaultJcrCartEntry.index - The index of the entry with the current cart or PlacedOrder.product - The product the new entry represents.quantity - The quantity.public java.lang.String serializeCartEntryData(java.lang.String productPath,
int quantity,
ValueMap properties)
String of the form "productPath;quantity;property1_name=property1_value\fproperty2_name=property2_value\f...".productPath - the path of the product of the cart entryquantity - the number of products in the cart entryproperties - other cart entry propertiespublic java.lang.Object[] deserializeCartEntryData(java.lang.String str)
throws CommerceException
serializeCartEntryData(String, int, org.apache.sling.api.resource.ValueMap).str - the serialized cart entry dataMap<String, Object> holding the
other properties of the cart entry at index 2.CommerceExceptionCopyright © 2010 - 2023 Adobe. All Rights Reserved