Bloom.Book.BookCopyrightAndLicense.GetMetadataWithDefaultCopyrightAndLicense C# (CSharp) Method

GetMetadataWithDefaultCopyrightAndLicense() private static method

private static GetMetadataWithDefaultCopyrightAndLicense ( string brandingNameOrPath ) : SIL.Windows.Forms.ClearShare.Metadata
brandingNameOrPath string
return SIL.Windows.Forms.ClearShare.Metadata
        private static Metadata GetMetadataWithDefaultCopyrightAndLicense(string brandingNameOrPath)
        {
            var metadata = new Metadata();
            Logger.WriteEvent("For BL-3166 Investigation: GetMetadata() setting to default license");
            metadata.License = new CreativeCommonsLicense(true, true, CreativeCommonsLicense.DerivativeRules.Derivatives);

            //OK, that's all we need, the rest is blank. That is, unless we are we are working with a brand
            //that has declared some defaults in a settings.json file:
            var settings = BrandingApi.GetSettings(brandingNameOrPath);
            if(settings != null)
            {
                if(!string.IsNullOrEmpty(settings.CopyrightNotice))
                {
                    metadata.CopyrightNotice = settings.CopyrightNotice;
                }
                if(!string.IsNullOrEmpty(settings.LicenseUrl))
                {
                    metadata.License = CreativeCommonsLicense.FromLicenseUrl(settings.LicenseUrl);
                }
                if(!string.IsNullOrEmpty(settings.LicenseUrl))
                {
                    metadata.License.RightsStatement = settings.LicenseRightsStatement;
                }
            }
            return metadata;
        }