This is a .NET 8 program written to help manage SF ECMS instances that contain large numbers of files. It can:
- Scan, format, and create zipped import packages (containing all required files such as
content.jsonand_meta.jsonfiles).- Unlimited nested subfolders are supported. Your ECMS will create any needed folders based on information in the import ZIP file.
- CMS Titles will default to the file name without extension, and CMS Type will default to either
sfdc_cms__documentorsfdc_cms__imagebased on the file type, buth both can be overridden per-file, or per-folder, by adding a file calledsfcu_overrides.csvin the source root folder. See example 3 for details.
- Scan and analyze formatted folders, such as unzipped exports from an ECMS.
The JSON files are created based on the specification provided by Salesforce here: https://help.salesforce.com/s/articleView?id=sf.cms_import_content_json_enhanced.htm
You configure the program by filling in the sf-ecms-utils-config.json file that comes with the program.
Action- Required:
True - Type:
String - Description: The action you are taking. It can either be "AnalyzeFiles", or "PackageFiles".
- Required:
SourceFiles_FolderPath- Required:
True|False(WhenAction= "AnalyzeFiles", this isFalse. WhenAction= "PackageFiles", this isTrue) - Type:
String - Description: The full windows path of the source folder.
- Required:
PackagedFiles_ZipFilePath- Required:
True|False(WhenAction= "AnalyzeFiles", then eitherPackagedFiles_ZipFilePathorPackagedFiles_FolderPathmust be set. WhenAction= "PackageFiles", then this isFalse) - Type:
String - Description: The full windows path of the output folder.
- Required:
PackagedFiles_FolderPath- Required:
True|False(WhenAction= "AnalyzeFiles", then eitherPackagedFiles_ZipFilePathorPackagedFiles_FolderPathmust be set. WhenAction= "PackageFiles", then this isTrue) - Default:
True - Type: Boolean
- Description: Flag to control whether or not the program makes a ZIP package after it creates the new folder structure and files in the output folder.
- Required:
CreateZipFiles- Required:
False - Default:
False - Type: Boolean
- Description: Flag to control whether or not the program creates a zip file after it finishes creating a packaged folder.
- Required:
ZipFileSplitLevel- Required:
False - Default: 0
- Type: Integer
- Description: Determines which level of nested folders will be zipped. By default,
0will cause the entire "Packaged Files" folder to be zipped into a single "Packaged Files.zip" file.1will cause all folders directly within "Packaged Files" to be zipped. This is useful if a single zip file would be too large for Salesforce to import, or if different subfolders contain files with the same filename, which can cause import errors.
- Required:
You can override the default CMS Title and CMS Type for single files or entire sub-folders by creating a file named sfcu_overrides.csv in the root of the source folder. The structure of the CSV file is as follows:
| CMS Path | CMS Title | CMS Type |
|---|---|---|
| Product Photos | [FILENAME] Product Photo | |
| Datasheets | [FILENAME] Datasheet | |
| Diagrams | [FILENAME] Wiring Diagram | sfdc_cms__document |
| Bulletins | Bulletin | |
| Bulletins/B1622_393193.pdf | Installation Guide |
Unzip and Analyze an Exported Zip File