Exemplo n.º 1
0
 public void SetDataSourceModule(int tabId, int moduleId, ModuleInfo getModule, TemplateManifest template, string data)
 {
     TabId                   = tabId;
     ModuleId                = moduleId;
     Module                  = getModule;
     OtherModuleTemplate     = template;
     OtherModuleSettingsJson = data;
 }
Exemplo n.º 2
0
        internal static bool QueryAvailable(this TemplateManifest template)
        {
            var schemaFileUri = new FileUri(template.ManifestFolderUri.UrlFolder, "query-schema.json");

            if (schemaFileUri.FileExists)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        internal static bool DataNeeded(this TemplateManifest template)
        {
            var schemaFileUri = new FileUri(template.ManifestFolderUri.UrlFolder, "schema.json");

            if (schemaFileUri.FileExists)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        internal static bool SettingsNeeded(this TemplateManifest template)
        {
            var schemaFileUri = new FileUri(template.ManifestFolderUri.UrlFolder, template.Key.ShortKey + "-schema.json");

            if (schemaFileUri.FileExists)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        public RenderInfo(TemplateManifest template, bool isOtherModule)
        {
            SettingsJson = "";
            DataJson     = "";
            OutputString = "";
            Template     = null;
            Files        = null;

            Template      = template;
            IsOtherModule = isOtherModule;
        }
Exemplo n.º 6
0
        internal static bool DataNeeded(this TemplateManifest template)
        {
            string prefix        = (string.IsNullOrEmpty(template.Collection) || template.Collection == "Items") ? "" : template.Collection + "-";
            var    schemaFileUri = new FileUri(template.ManifestFolderUri.UrlFolder, prefix + "schema.json");

            if (schemaFileUri.FileExists)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 7
0
        internal static Manifest GetManifest(TemplateKey templateKey, out TemplateManifest templateManifest)
        {
            templateManifest = null;
            if (templateKey == null)
            {
                return(null);
            }

            Manifest manifest;

            if (templateKey.Extention == "manifest")
            {
                manifest = GetFileManifest(templateKey.TemplateDir);
                //todo downgrade template directories that stop using manifests
            }
            else
            {
                //todo upgrade template directories that start using manifests
                //manifest = GetFileManifest(templateKey.TemplateDir);
                //if (manifest == null)
                //    manifest = GetVirtualManifest(templateKey);
                //else if (manifest.Templates == null)
                manifest = GetVirtualManifest(templateKey);
            }

            if (manifest != null && manifest.HasTemplates)
            {
                //store some info into the Manifest object and its templates for backlink reference
                manifest.ManifestDir = templateKey.TemplateDir;
                foreach (KeyValuePair <string, TemplateManifest> keyValuePair in manifest.Templates)
                {
                    keyValuePair.Value.SetSource(templateKey);
                }
                //get the requested template by Key
                templateManifest = manifest.GetTemplateManifest(templateKey);
            }
            return(manifest);
        }
Exemplo n.º 8
0
 internal static FileUri MainTemplateUri(this TemplateManifest templateUri)
 {
     return(templateUri == null || templateUri.Main == null ? null : new FileUri(templateUri.ManifestFolderUri, templateUri.Main.Template));
 }
Exemplo n.º 9
0
 internal static FileUri DetailTemplateUri(this TemplateManifest templateUri)
 {
     return(templateUri?.Detail == null ? null : new FileUri(templateUri.ManifestFolderUri, templateUri.Detail.Template));
 }