| name | sap-commerce-cloud |
| description | Provides comprehensive SAP Commerce Cloud (formerly Hybris) development guidance including type system modeling, service layer architecture, ImpEx data management, FlexibleSearch queries, OCC API customization, Composable Storefront (Spartacus/Angular), B2C/B2B accelerator patterns, WCMS content management, CCv2 cloud deployment, SAP BTP/Kyma integration, CronJobs, business processes, Solr search, promotions, caching, SmartEdit, Backoffice configuration, and testing patterns. Use when the user asks about "SAP Commerce Cloud", "SAP Commerce", "Hybris", "create SAP Commerce extensions", "define item types in items.xml", "write ImpEx scripts", "implement facades/services/DAOs", "customize OCC REST APIs", "work with FlexibleSearch queries", "customize B2C or B2B accelerators", "SAP Commerce B2B", "configure Spring beans", "create CronJobs or scheduled tasks", "define business processes or order flows", "configure Solr search or indexing", "set up promotions or coupons", "configure caching", "customize Backoffice", "SAP Commerce WCMS", "SAP Commerce CMS", "SAP Commerce integration", "integrate Composable Storefront or Spartacus", "customize Angular CMS components in Spartacus", "deploy to CCv2 or SAP Commerce Cloud public cloud", "configure manifest.json for CCv2", "integrate SAP BTP or Kyma with SAP Commerce", "customize SmartEdit", "write unit or integration tests for SAP Commerce", or asks about troubleshooting SAP Commerce issues. |
SAP Commerce Development
Overview
SAP Commerce Cloud (formerly Hybris) is an enterprise e-commerce platform built on Java and Spring. This skill provides guidance for extension development, type system modeling, service layer implementation, data management, API customization, accelerator patterns, Composable Storefront (Spartacus/Angular) integration, CCv2 cloud deployment, SAP BTP/Kyma integration, SmartEdit customization, and testing patterns for both Cloud (CCv2) and On-Premise deployments.
Modern Storefront Note: The JSP-based Accelerator storefront (Spring Web Flow, JSP/JSTL) is the legacy approach. The modern recommended storefront is Composable Storefront (formerly Spartacus) — an Angular/TypeScript Single Page Application that communicates with the backend exclusively via OCC REST APIs. New projects should use Composable Storefront. See composable-storefront.md.
Core Architecture
Type System
Data modeling via items.xml defines item types, attributes, relations, and enumerations. Types are compiled into Java classes during build. See type-system.md for syntax and patterns.
Extensions
Modular architecture where functionality lives in extensions. Each extension has extensioninfo.xml for metadata, items.xml for types, and *-spring.xml for beans. See extension-development.md.
Service Layer
Four-layer architecture: Facade (API for controllers) → Service (business logic) → DAO (data access) → Model (generated from types). See service-layer-architecture.md.
Data Management
ImpEx: Scripting language for data import/export. See impex-guide.md.
FlexibleSearch: SQL-like query language for items. See flexiblesearch-reference.md.
OCC API
RESTful web services exposing commerce functionality. Controllers use DataMapper for DTO conversion. See occ-api-development.md.
Accelerators (Legacy JSP Storefront)
Pre-built JSP/Spring MVC storefronts: B2C (retail) and B2B (enterprise with approval workflows). Legacy approach — new projects should use Composable Storefront or a headless approach. See accelerator-customization.md.
Composable Storefront (Spartacus)
Angular/TypeScript SPA that replaces JSP accelerators. Communicates exclusively via OCC APIs. Supports PWA, SSR, and feature libraries for B2C/B2B. See composable-storefront.md.
Headless Commerce
SAP Commerce Cloud as a headless backend — OCC APIs consumed by any frontend (React, Vue, mobile apps, etc.). The backend serves product, catalog, cart, order, and user data via REST. Composable Storefront is SAP's reference headless frontend, but custom frontends are supported.
CCv2 Cloud Deployment
SAP Commerce Cloud v2 (CCv2) is the managed cloud offering. Deployment is driven by manifest.json defining extensions, aspects (storefront/api/backoffice), and properties. See ccv2-deployment.md.
SAP BTP Integration
SAP Business Technology Platform integration via API Registry module and SAP BTP Extensions Integration Module (Kyma runtime). Allows microservices/serverless functions to react to Commerce events. See sap-btp-integration.md.
CronJobs & Task Engine
Scheduled and asynchronous job execution. Define AbstractJobPerformable implementations, configure via ServicelayerJob + CronJob + Trigger in ImpEx. See cronjob-task-engine.md.
Business Processes
Stateful workflows for order processing, returns, approvals, and custom flows. XML process definitions with action beans (AbstractSimpleDecisionAction, AbstractAction), wait states, and event triggers. See business-process.md.
Solr Search
Product search and faceted navigation powered by Apache Solr. Configure indexed types, properties, value providers, and boost rules. See solr-search-configuration.md.
Promotions & Rule Engine
Drools-based promotion rules with conditions and actions. Supports order/product/customer promotions, coupons, and custom actions. See promotions-rule-engine.md.
Caching
Multi-layered caching: platform region caches (entity, query, typesystem), Spring @Cacheable, and cluster-aware invalidation. See caching-guide.md.
Backoffice
Administration UI customization via cockpitng: widget configuration, custom editors, search/list views, wizards, and deep links. See backoffice-configuration.md.
Common Workflows
Create a Custom Extension
- Generate structure with
ant extgen or use template from assets/extension-structure/
- Configure
extensioninfo.xml with dependencies
- Define types in
items.xml
- Configure beans in
*-spring.xml
- Add to
localextensions.xml
- Build:
ant clean all
Reference: extension-development.md | Template: assets/extension-structure/
Define Custom Item Types
- Create or modify
*-items.xml in extension
- Define itemtype with attributes, relations
- Build to generate model classes
- Use in services/DAOs
Reference: type-system.md | Templates: assets/item-type-definition/
Implement Service Layer
- Create DTO class for data transfer
- Create DAO interface and implementation with FlexibleSearch
- Create Service interface and implementation with business logic
- Create Facade interface and implementation for external API
- Configure beans in
*-spring.xml
Reference: service-layer-architecture.md | Templates: assets/service-layer/
Import Data with ImpEx
- Create
.impex file with header and data rows
- Use INSERT_UPDATE for create/modify operations
- Define macros for reusable values
- Import via HAC or
ant importImpex
Reference: impex-guide.md | Templates: assets/impex-scripts/
Query with FlexibleSearch
SELECT {pk} FROM {Product} WHERE {code} = ?code
SELECT {p.pk} FROM {Product AS p JOIN Category AS c ON {p.supercategories} = {c.pk}} WHERE {c.code} = ?category
Reference: flexiblesearch-reference.md | Examples: assets/flexiblesearch-queries/
Customize OCC API
- Create controller with
@Controller and @RequestMapping
- Create WsDTO for response data
- Create populator for model-to-DTO conversion
- Register in
*-web-spring.xml
Reference: occ-api-development.md | Templates: assets/occ-customization/
Extend Accelerator Checkout
- Create custom checkout step implementing
CheckoutStep
- Configure in checkout flow XML
- Create JSP for step UI
- Register beans in
*-spring.xml
Reference: accelerator-customization.md | Templates: assets/checkout-customization/
Create a Scheduled Job (CronJob)
- Implement
AbstractJobPerformable<CronJobModel> with perform() method
- Register Spring bean with
parent="abstractJobPerformable"
- Create
ServicelayerJob, CronJob, and Trigger via ImpEx
- Test via HAC > Platform > CronJobs
Reference: cronjob-task-engine.md | Templates: assets/cronjob/
Define a Business Process
- Create process definition XML in
resources/processes/
- Implement action beans extending
AbstractSimpleDecisionAction
- Register action beans in Spring with
parent="abstractAction"
- Register process definition via
ProcessDefinitionResource Spring bean
- Start process via
BusinessProcessService.createProcess() and startProcess()
Reference: business-process.md | Templates: assets/business-process/
Configure Solr Product Search
- Set up
SolrFacetSearchConfig with server, languages, currencies, catalog versions
- Define
SolrIndexedType for Product
- Configure
SolrIndexedProperty entries (searchable, facet, sortable)
- Set up indexer CronJobs (full nightly, incremental every 5 min)
- Test search via HAC > Platform > Solr
Reference: solr-search-configuration.md | Templates: assets/solr-configuration/
Set Up Promotions
- Create
PromotionGroup for your store
- Define
PromotionSourceRule with conditions and actions
- Configure coupons (
SingleCodeCoupon / MultiCodeCoupon) if needed
- Publish rules to activate them
- Test in Backoffice > Marketing > Promotion Rules
Reference: promotions-rule-engine.md | Templates: assets/promotions/
Integrate Composable Storefront (Spartacus)
- Set up OCC endpoints and CORS on the Commerce backend
- Scaffold Angular app:
ng add @spartacus/schematics@latest --base-url <OCC_URL> --base-site=<SITE_ID> --ssr
- Configure
SpartacusConfigurationModule with provideConfig
- Customize CMS components via
cmsComponents mapping in provideConfig
- Override services by providing custom service classes in feature modules
Reference: composable-storefront.md | Templates: assets/composable-storefront/
Deploy to CCv2
- Configure
manifest.json at repository root with commerceSuiteVersion, extensions, aspects
- Set environment properties in CCv2 Cloud Portal or property files
- Push to connected repository to trigger build
- Promote build through environments (dev → staging → production)
Reference: ccv2-deployment.md
Integrate SAP BTP / Kyma
- Configure API Registry module to expose Commerce APIs and events
- Connect Kyma runtime via SAP BTP Extensions Integration Module
- Implement microservices/lambdas to react to Commerce events
- Use API Registry for webhook-based outbound communication
Reference: sap-btp-integration.md
Write Tests for Custom Extension
- Annotate unit tests with
@UnitTest, integration tests with @IntegrationTest
- Unit tests: use Mockito mocks, no Spring context, place in
testsrc/
- Integration tests: extend
ServicelayerTest or ServicelayerTransactionalTest
- OCC API integration tests: use REST Assured or MockMvc against a running OCC endpoint
- Load test data via
importCsv("/myext/test/testdata.impex", "utf-8")
- Run locally:
ant unittests -Dtestclasses.extensions=myextension
- Configure CCv2 test run in
manifest.json under "tests"
Reference: testing-guide.md
Quick Reference
Resources
scripts/
Utility scripts for common tasks:
generate-extension.sh - Scaffold new extension structure
validate-impex.sh - Validate ImpEx syntax before import
query-items.sh - Execute FlexibleSearch queries via HAC
references/
Detailed guides for each topic area. Load as needed for in-depth information.
assets/
Production-quality code templates ready to copy and customize. Organized by domain (service-layer, impex-scripts, etc.).