Import and export XML, form definitions and the JSON files of a cartridge are validated while you type, with completion for elements, attributes and keys. The schemas are bundled with the plugin, so validation works offline
hooks.json the name value offers the platform's 334 built-in hook pointsImport and export XML
The plugin registers 57 SFCC schemas, following B2C Commerce 26.10. A file is validated when its root element declares the matching SFCC namespace, the same way Business Manager exports it
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="http://www.demandware.com/xml/impex/catalog/2006-10-31" catalog-id="storefront-catalog">
<category category-id="mens">
<display-name xml:lang="x-default">Mens</display-name>
<online-flag>true</online-flag>
</category>
</catalog>| Area | Schemas |
|---|---|
| Catalog and search | catalog, pricebook, inventory, priceadjustmentlimits, productlist, search, search2, sort, store |
| Marketing | promotion, coupon, couponredemption, sourcecode, abtest, abtestparticipants, slot, giftcertificate, assignment |
| Customers | customer, customergroup, customerlist, customerlist2, customerpaymentinstrument, customeractivedata, customercdnsettings |
| Orders and checkout | order, returnimportfeed, shippingorderupdatefeed, paymentmethod, paymentprocessor, shipping, tax |
| Site and configuration | site, preferences, metadata, customobject, jobs, schedules, services, urlrules, redirecturl, cachesettings, csrfwhitelists, locales, geolocation, sitemapconfiguration, pagemetatag, oauth, feed, channels, commercefeaturestate, eventrouting, storefronts |
| Content | library |
| Cartridge code | form, bmext, dcext |
Each schema is registered for one namespace version, for example catalog/2006-10-31 or jobs/2015-07-01. To read one, right-click a file in B2C Metadata and choose Open Schema
Services, jobs, preferences, custom objects, slots and library files also open in a site archive editor that checks them against their schema and the kind's own rules. Its Jobs editor knows the parameters of the standard job steps of B2C Commerce 26.10 and of your steptypes.json
Form definitions
Form XML in a forms folder, with the namespace http://www.demandware.com/xml/form/2008-04-19, is validated against form.xsd. On top of the schema the plugin adds:
- Completion and navigation for resource keys in
label,description, the*-errorkeys andform-error, taken from yourformsresource bundles, with each key's text shown after it - Completion of form names in the
nameattribute of an<include>, and a gutter icon that opens the copy of the included form in use - Regular expression highlighting and checks in every
regexpattribute
With a license, the form XML also gets usage counts, a typed Structure view, copy icons and checks. These, and how scripts and templates reach forms, for example server.forms.getForm('billing'), are on Forms
Cartridge JSON files
These files get a schema from the plugin, picked by file name, and for api.json also by its rest-apis folder. The schema name shows in the JSON schema widget of the status bar
| File | Schema | Also |
|---|---|---|
hooks.json | Salesforce B2C Hooks | name completes the platform's 334 hook points, labeled by group such as Order Hooks or SCAPI Hooks. script completes script paths and has a gutter icon to the script |
steptypes.json | Salesforce B2C Steptypes | module completes script paths and has a gutter icon to the job step script. function and the chunk keys such as read-function have a gutter icon to the function in that script |
api.json under cartridge/rest-apis/<api> | Salesforce B2C Custom API | endpoint completes the operation IDs of the schema and implementation completes script paths without the extension. schema and implementation have a gutter icon to their file, and a path that names no file turns red. Each endpoint shows its requests as hints, see Custom APIs |
caches.json | Salesforce B2C Caches | Validates the custom cache definitions |
package.json | hooks and caches complete JSON file paths. Each path of an init array completes script paths. All of them get a gutter icon that opens the file |
Cmd+Click (Ctrl+Click) on a script, module, init, hooks or caches value in these files opens the file it names. The hook name in hooks.json, the function keys in steptypes.json and the endpoint, schema and implementation of an api.json navigate too, see Go to Declaration. Completion and the gutter icons need a valid license or trial
{
"hooks": [
{
"name": "dw.order.calculate",
"script": "./scripts/hooks/cart/calculate.js"
}
]
}For a platform hook point the gutter icon next to script reads Navigate to and the function name, and opens the script at that function. For your own hooks it reads Navigate to file. Calls such as HookMgr.callHook('app.payment.processor.basic_credit', ...) resolve to the same hooks.json entries, see SFCC Contracts
Page Designer JSON
Meta definition files of Page Designer get their own schema by folder. Completion of group, type_id and editor types, navigation between components and editors, and typed render scripts are covered in Page Designer
| Folder | Schema |
|---|---|
experience/pages | Salesforce B2C Page Designer - Pages |
experience/components | Salesforce B2C Page Designer - Components |
experience/aspects | Salesforce B2C Page Designer - Aspects |
experience/editors | Salesforce B2C Page Designer - Editors |
Pipeline XML
In the XML source of a pipeline under cartridge/pipelines, start-name-ref, ScriptFile and <template> values link to code, see Go to Declaration. Find Usages on a template lists the pipeline nodes that show it, and renaming or moving the template rewrites their name, except for a dynamic="true" template
Troubleshooting
| Symptom | What to do |
|---|---|
| An XML file isn't validated | Check that the root element declares an SFCC namespace from the table, spelled exactly as Business Manager exports it |
| "URI is not registered" on the namespace | The file uses a namespace version the plugin doesn't register. Use the version from a current Business Manager export |
| A Page Designer file has no schema | The file's path must contain /experience/pages, /experience/components, /experience/aspects or /experience/editors. Linking the cartridge isn't needed |
hooks.json has no hook name completion | The file must be named exactly hooks.json, and your license or trial must be active, see Purchase & License |
No gutter icon next to a script, module or init path | Check that your license or trial is active and that the path starts with ./, ~/, */ or the name of a linked cartridge, and points to a script that exists |
A custom API api.json shows another schema, such as apibuilder.json | The file must sit at cartridge/rest-apis/<api>/api.json. Other api.json files keep the schema the IDE picks |
A schema or implementation in api.json is red | Write the path relative to api.json, and the script without .js or .ds |
| The wrong schema is applied to a JSON file | Pick the schema in the JSON schema widget of the status bar, or check the file name |