Skip to Content

B2C Metadata

Browse your project's site archive XML by organization and site, see what each file defines with its usages in code, search it and open IDs from scripts

B2C Metadata lists the site archive XML files of your project in one tool window: metadata, catalogs, price books, libraries, preferences, jobs, services, slots and the other import files. Each file sits under the organization or the site it belongs to, with its size and its archive, and opens into what it defines: services, jobs, preferences, and in metadata each type with its custom attributes, groups and system attributes

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

Open the tool window

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

Click B2C Metadata on the right tool window bar, after B2C Entry Points. You can also open it from:

  • Navigate › B2C Metadata
  • Tools › Salesforce B2C Commerce › B2C Metadata
  • The Show in B2C Metadata link in the summary of the Metadata Editor

The menu items show up once a cartridge is linked and focus the search field. The window looks for files while it opens, so it first reads Looking for site archive XML...

The header

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

The search and the scope beside it fill the row over the tree. The buttons sit on the tool window's title bar, and Refresh in its ⋮ menu

ControlWhat it does
SearchSearch metadata, catalogs, preferences, jobs, services filters the tree
ScopeAll, Organization, All Sites, or one site under Sites. The project keeps your choice
Show Metadata Usage The first icon on the title bar. Opens Metadata Usage: which cartridges, files and sites use each type and attribute. To start from one row, right-click it and choose Show in Metadata Usage
Group by Type Lists the kinds of files first, each with its sites
Unused in code Keeps only the entries that no script or template names, see Unused in code
Select Opened File Selects the file of the editor you are in
Expand All, Collapse AllThe tree's branches
RefreshIn the ⋮ menu. Looks for site archive XML again

The footer counts what you see: 9 files in 2 archives, 2 of 9 files while a scope narrows the tree, or 2 matches while you search

Organization and sites

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

Organization holds the data at the top of the site archives: metadata, catalogs, price books, shared libraries, jobs, services and global preferences. Sites holds each site's data: preferences, content slots, promotions and customer groups. Each file row shows its name, its size and its archive in grey. The size is coloured from green for the project's smallest files to red for its largest. Hover a group or a file for what it holds

The plugin decides the owner from the file, so exports that don't follow the archive layout still land in the right place:

FileBelongs to
Anything under sites/<site>/That site
A site file in an export folder named for a site, such as AcmeUS/preferences.xml or us/jobs.xmlThat site
A custom objectThe storage-scope of its type in your metadata, site or organization
A library under libraries/<id> or with a library-idThe organization, as a shared library
Preferences outside a site folderSite or organization, from the preference IDs it sets
A site file in no folder that names a siteSites, marked no site folder

Group by Type

Group by Type lists the kinds instead, such as Metadata, Custom Objects or Preferences, each with its sites and then its organization files. The setting is shared with the META node of the B2C project view

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

What each file holds

Each file opens into what it defines, in file order, as the Site Archive tab of Search Everywhere finds it: services, profiles and credentials, jobs, preferences, custom objects, slot configurations, and library content and folders. Each row shows the ID, then its kind in grey, such as Service or Job

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

Types in metadata

A metadata file lists the custom object types it defines and the system objects it extends, each as Custom object type or System object. A type opens into the lists the Metadata Editor shows for it:

ListHolds
Custom Attributes The custom attributes the file defines for the type, each with its name, its type and its usages in code
Groups The attribute groups the file defines for the type, each with its name and the attributes it lists
Attributes The system attributes the file changes for the type. A custom object type's key comes first, marked Key

A list shows only when the file has something for it, and a type with nothing to list doesn't open. Hover a list for what it holds

Usages

An entry that code names, such as a service, a job or a custom object type, shows how many places use it, as its Code Vision count in the XML does. A custom attribute, and the key of a custom object type, counts its reads in scripts and templates as the Metadata Editor does. Click the count to list the places, or right-click the row and choose Show Usages. The counts follow your edits

Usage counts of custom attributes need an active license or trial, as in the Metadata Editor

Unused in code

Unused in code in the header keeps only the entries that no script or template names, such as a service nothing creates or a custom object type nothing reads

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

The footer counts them, such as 2 unused. A system object is never listed, since code doesn't name it by its ID. The check is a text search, so an ID that code builds at run time is not found

Type a file name, a kind or a path: objecttype finds both metadata files, and catalog finds the catalogs. The search also finds the IDs of entries, custom attributes, system attributes and groups, such as acme.http or acmeAccountId, and opens the rows that hold them. Names match as in Search Everywhere, and the matched part is highlighted

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view
  • Down selects the first file and moves to the tree
  • Enter in the search opens the first file
  • A group found by its own ID lists all its attributes, and a group found through one of its attributes lists that attribute
  • Typing in the tree goes back to the search
  • The tree shows up to 500 files, then N more, refine the search
  • A search with no file reads Nothing matches "promo", and a scope with none No files in AcmeUS

Open, schema and paths

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

Double-click a file or press Enter to open it. Files open in the Metadata Editor: metadata, services, jobs, preferences, custom objects, slots and libraries. An entry, a group or an attribute opens its file on that row, such as the attribute selected in the Metadata Editor. Right-click one for Open in Editor, Show Usages and Copy ID. Right-click a file for:

ItemDoes
OpenOpens the file
Open Schema (services.xsd)Opens the bundled schema of the kind, when it has one
Reveal in Project ViewSelects the file in the Project tool window
Copy PathThe full path
Copy Path from Content RootThe path inside the project, such as metadata/site_us/services.xml
Copy NamespaceThe file's XML namespace

META in the B2C project view

The B2C project view shows the same files under META , beside the site's root, where External Libraries sits. It has the same groups, counts and sizes, follows Group by Type, and selects the file you open, such as META › Sites › AcmeUS › Preferences › preferences.xml. META shows up with the first site archive file

B2C Metadata lists every site archive XML file of the project under Organization and Sites, with its size and archive. Narrow it to one site, list the kinds first with Group by Type, open a file into what it defines with its usages in code, keep only what no code names, search by name, kind or path and open a file with Enter, copy its path or namespace, and find the same tree under META in the B2C project view

New site archive files

Right-click a folder and choose New › Site Archive File. The kind the folder holds comes first, and the file opens in its editor with its namespace and an empty root, ready for the first row. A name left as a kind's name follows the kind you pick

Right-click a folder and choose New › Site Archive File for an empty file that imports without errors:

KindFileRoot
Servicesservices.xmlservices
Jobsjobs.xmljobs
Site preferencespreferences.xmlpreferences
Custom objectscustom-objects.xmlcustom-objects
Content slotsslots.xmlslot-configurations
Content librarylibrary.xmllibrary

The folder puts its kind first: sites/RefArch offers preferences, libraries/SharedLibrary a library with library-id="SharedLibrary", custom-objects custom objects. The other kinds stay in the list, and Up / Down in the name field moves through them. A name left as one of the kinds' names follows the kind you pick, so preferences with Content slots makes slots.xml. The file opens in its editor, ready for the first row. For metadata, use New › Metadata File, see Metadata Editor

Site Archive in Search Everywhere

The Site Archive tab of Search Everywhere finds what the files define: services, profiles and credentials, jobs, preferences, custom objects, slot configurations, and library contents and folders. Enter opens the file in its editor with that row selected

The Site Archive tab of Search Everywhere finds what the site archive files define by ID, with the kind and the file of each row. Custom objects carry their type and slot configurations their slot and context. The funnel hides kinds, and Enter opens the file in its editor with the row selected

IDs in scripts

Service, credential, preference and custom object IDs in scripts link to the XML that defines them. Cmd+Click / Ctrl+Click opens the file in its editor with that row selected, or on the ID in the XML while the file shows its Text tab. Completion lists the IDs of the project with the file each one comes from

Cmd+Click on the ID in createService or ServiceRegistry.get opens services.xml on the Services Editor tab with the service selected, and setCredentialID completes the credentials with the file each comes from. With the file on its Text tab, the jump lands on the ID in the XML. An ID that only Business Manager defines stays plain, with no error
ScriptGoes to
LocalServiceRegistry.createService('acme.http.orders', ...), ServiceRegistry.get('acme.http.orders')<service service-id="acme.http.orders"> in services.xml
svc.setCredentialID('acme.http.cred')<service-credential>
Site.getCurrent().getCustomPreferenceValue('apiTimeout')<preference preference-id="apiTimeout">, every instance type, and the attribute in the metadata
CustomObjectMgr.getCustomObject('PaymentCountry', 'AT')The <custom-object> of that type and key

An ID with a target is underlined. A service, credential or custom object the project doesn't define, such as a service set up only in Business Manager, stays plain and is no error. A preference ID that no site preference in your metadata defines is an error, see Undefined preferences

Fast on big archives

The window doesn't build an XML tree. It reads each file up to its root element, so a catalog of hundreds of megabytes costs what a small file does, and it keeps what it read across restarts. Folders named cartridge and node_modules, and dot folders, are skipped. A change to a file updates the tree within a moment, unsaved edits included

B2C Metadata reads each file only up to its root element and keeps what it read, so after a restart the whole tree is back as soon as indexing ends, the 412 MB catalog included. A file shows within a moment of getting a root element, before it is saved, and XML in dot folders, cartridge folders and node_modules stays out

The IDE indexes no file above 2.5 MB. Intellij SFCC reads those files itself, one element at a time, so large catalogs, price books, inventory lists, libraries, slot configurations and metadata open into their entries and count usages as small files do. Scripts, forms and log links go to what they define, and B2C Doctor and the B2C MCP tools read them

Troubleshooting

ProblemFix
No site archive XML in this projectAdd the import files to the project as .xml, such as meta/system-objecttype-extensions.xml. Files inside cartridges and node_modules aren't listed
Waiting for indexing to finish...The window fills when indexing ends
A site file is under no site folderMove it to sites/<site>/, or to a folder named for the site
No B2C Metadata menu itemLink a cartridge first, see Cartridges

On this page