public abstract class AbstractJcrCommerceService extends Object implements CommerceService
CommerceService
s 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.
|
List<Promotion> |
getAvailablePromotions(ResourceResolver resourceResolver)
Returns a list of JCR-based promotions (ie, those known to the
PromotionManager ). |
Map<String,Object> |
getContext()
Get the context or an empty map if no context has been set before via
CommerceService.setContext(Map) . |
VendorJcrPlacedOrder |
getPlacedOrder(String orderId,
Locale locale)
Return a vendor record of a placed order for order administration.
|
Promotion |
getPromotion(String path)
Default implementation assumes a JCR-based promotion (in which the path parameter is
truly a path).
|
String |
getServer()
Get the configured commerce server endpoint.
|
Voucher |
getVoucher(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.
|
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.
|
ServiceContext |
serviceContext()
Returns the
ServiceContext of this service. |
void |
setContext(Map<String,Object> context)
Set a context for this service instance and any session retrieved from it.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCountries, 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(Map<String,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 CommerceService
public Map<String,Object> getContext()
CommerceService.setContext(Map)
.getContext
in interface CommerceService
public String getServer()
getServer
in interface CommerceService
public boolean isActivated(Product product) throws CommerceException
isActivated
in interface CommerceService
CommerceException
public Promotion getPromotion(String path) throws CommerceException
getPromotion
in interface CommerceService
null
if not found.CommerceException
public Voucher getVoucher(String path) throws CommerceException
getVoucher
in interface CommerceService
null
if not found.CommerceException
public VendorJcrPlacedOrder getPlacedOrder(String orderId, 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 CommerceService
blueprint
- The catalog blueprint.catalog
- The catalog page created from the blueprint.CommerceException
public 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 CommerceService
blueprint
- 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 CommerceService
productData
- 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.CommerceException
public CommerceResult search(CommerceQuery query) throws CommerceException
search
in interface CommerceService
CommerceException
public List<Promotion> getAvailablePromotions(ResourceResolver resourceResolver) throws CommerceException
PromotionManager
).getAvailablePromotions
in interface CommerceService
resourceResolver
- a Sling ResourceResolver instanceList<Promotion>
containing the promotions.CommerceException
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"