.. include:: /../common/authors.txt
Resource Mappings¶
In an Omnia extension, every resource files need to be mapped with a unique ID. The resource mappings are defined with an attribute-based pattern like other entities in Omnia like feature, jobs and SharePoint artifacts.
The resource mappings aslo help create an logical hierachy or grouping of resources, which can be used to distribute the resources to different Omnia features. If your extension is small (less than 50 resource files) you should put all resource mappings into one file, otherwise you should split it into multiple files by feature area.
In the resource mappings you can also specify different properties and metadata.
Sections:
Folders mapping¶
[TenantResourceFolderMapping(id: "EE2FFD07-D5B6-4964-BD46-09472229F49C", name: "Scripts")]
public class Scripts
{
// Other folders or files mapping code in here
}
Generic files mapping¶
[TenantResourceFileMapping(id: "DC37115E-9ED7-4017-BCA1-449C67D8EBC0",
sourceRelativePath: "/TenantResources/Scripts/Core/sample.core.js")]
public string SampleCoreJs { get; set; }
Site templates mapping¶
[TenantResourceFileMapping(id: "AA5A09DA-CA8D-4289-9EF2-D05AE99E4AB2",
sourceRelativePath: "/TenantResources/SiteTemplates/sampletemplate.json",
Category = BuiltInCategories.SiteProvisioning.SiteTemplate)]
public string SampleTemplate { get; set; }
Localization files mapping¶
[TenantResourceFileMapping(id: "766F18D7-1E6B-486D-912B-C12D6683B28A",
sourceRelativePath: "/TenantResources/Localization/sample.loc.json")]
public string SampleLocalization { get; set; }
[TenantResourceFileMapping(id: "0CD92A43-9065-49DC-83EB-054123445A9E",
sourceRelativePath: "/TenantResources/Localization/sample.loc.sv-se.json")]
public string SampleLocalizationSvSe { get; set; }