Class SitemapMgr

SitemapMgr is used to access and modify custom sitemap files.

To access custom sitemap files, use methods getCustomSitemapFiles().

To delete custom sitemap files, use methods deleteCustomSitemapFile(SitemapFile), deleteCustomSitemapFiles(String) and deleteCustomSitemapFiles().

To add custom sitemap files, use methods addCustomSitemapFile(String, File). The file will be copied from WebDAV (File represent a file in WebDAV) to the appservers shared file system.

Please note that all provided methods are operating in appservers shared file system. These modifications are visible via "Custom Sitemaps" tab under Merchant Tools => SEO => Sitemaps - Custom Sitemaps in Business Manager. To publish all changes, execute job under Merchant Tools => SEO => Sitemaps => Job.

PropertyDescription
customSitemapFiles: Map (read-only)Reads all existing custom sitemap files from files system of the appservers custom sitemap directory into memory and returns them in a Map containing mappings like
  • Hostname 1 => [SitemapFile hostname1_sitemapfile1, SitemapFile hostname1_sitemapfile2]
  • Hostname 2 => [SitemapFile hostname2_sitemapfile1]

This class does not have a constructor, so you cannot create it directly.

MethodDescription
static addCustomSitemapFile(String, File)Adds the given File to the appservers custom sitemap directory.
static deleteCustomSitemapFile(SitemapFile)Deletes the given custom sitemap file from the appservers shared file system.
static deleteCustomSitemapFiles()Deletes all custom sitemap files for all hostnames from the appservers shared file system.
static deleteCustomSitemapFiles(String)Deletes all custom sitemap files for the given hostname from the appservers shared file system.
static getCustomSitemapFiles()Reads all existing custom sitemap files from files system of the appservers custom sitemap directory into memory and returns them in a Map containing mappings like
  • Hostname 1 => [SitemapFile hostname1_sitemapfile1, SitemapFile hostname1_sitemapfile2]
  • Hostname 2 => [SitemapFile hostname2_sitemapfile1]

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

customSitemapFiles: Map (read-only)

Reads all existing custom sitemap files from files system of the appservers custom sitemap directory into memory and returns them in a Map containing mappings like

  • Hostname 1 =>[SitemapFile hostname1_sitemapfile1, SitemapFile hostname1_sitemapfile2]
  • Hostname 2 =>[SitemapFile hostname2_sitemapfile1]

static addCustomSitemapFile(hostName: String, file: File): void

Adds the given File to the appservers custom sitemap directory. All content of the appservers custom sitemap directory is considered by the system job "Create Sitemap Schedule".

The files are added to the directory which is accessible via "Custom Sitemaps" tab under Merchant Tools => SEO => Sitemaps - Custom Sitemaps in Business Manager. To publish that change, execute job under Merchant Tools => SEO => Sitemaps => Job.

Parameters:

  • hostName - The hostName to copy the File to. The hostName must be configured in sites alias file.
  • file - The File to copy.

Throws:

  • Exception -

static deleteCustomSitemapFile(sitemapFile: SitemapFile): void

Deletes the given custom sitemap file from the appservers shared file system.

The file is deleted from the directory which is accessible via "Custom Sitemaps" tab under Merchant Tools => SEO => Sitemaps - Custom Sitemaps in Business Manager. To publish that change, execute job under Merchant Tools => SEO => Sitemaps => Job.

Parameters:

  • sitemapFile - - The sitemapFile to delete.

static deleteCustomSitemapFiles(): void

Deletes all custom sitemap files for all hostnames from the appservers shared file system.

The files are deleted from the directory which is accessible via "Custom Sitemaps" tab under Merchant Tools => SEO => Sitemaps - Custom Sitemaps in Business Manager. To publish that change, execute job under Merchant Tools => SEO => Sitemaps => Job.


static deleteCustomSitemapFiles(hostName: String): void

Deletes all custom sitemap files for the given hostname from the appservers shared file system.

The files are deleted from the directory which is accessible via "Custom Sitemaps" tab under Merchant Tools => SEO => Sitemaps - Custom Sitemaps in Business Manager. To publish that change, execute job under Merchant Tools => SEO => Sitemaps => Job.

Parameters:

  • hostName - The hostName to delete the custom sitemap files for.

static getCustomSitemapFiles(): Map

Reads all existing custom sitemap files from files system of the appservers custom sitemap directory into memory and returns them in a Map containing mappings like

  • Hostname 1 =>[SitemapFile hostname1_sitemapfile1, SitemapFile hostname1_sitemapfile2]
  • Hostname 2 =>[SitemapFile hostname2_sitemapfile1]

Returns:

  • The created map containing the list of SitemapFiles.