public static Dynamic.PageTemplate BuildPageTemplate(TComm.PageTemplate tcmPageTemplate, BuildManager manager)
        {
            Dynamic.PageTemplate pt = new Dynamic.PageTemplate();
            pt.Title         = tcmPageTemplate.Title;
            pt.Id            = tcmPageTemplate.Id.ToString();
            pt.FileExtension = tcmPageTemplate.FileExtension;

            if (tcmPageTemplate.Metadata != null && tcmPageTemplate.MetadataSchema != null)
            {
                pt.MetadataFields = new Dynamic.SerializableDictionary <string, Dynamic.Field>();
                TCM.Fields.ItemFields tcmMetadataFields = new TCM.Fields.ItemFields(tcmPageTemplate.Metadata, tcmPageTemplate.MetadataSchema);
                pt.MetadataFields = manager.BuildFields(tcmMetadataFields, 0, false); // never follow links to comopnents from page templates, never resolve binary widht/height
            }
            else
            {
                pt.MetadataFields = null;
            }
            pt.Publication = manager.BuildPublication(tcmPageTemplate.ContextRepository);
            pt.Folder      = manager.BuildOrganizationalItem((TCM.Folder)tcmPageTemplate.OrganizationalItem);
            return(pt);
        }
Ejemplo n.º 2
0
        public static Dynamic.PageTemplate BuildPageTemplate(TComm.PageTemplate tcmPageTemplate, BuildManager manager)
        {
            Dynamic.PageTemplate pt = new Dynamic.PageTemplate();
            pt.Title         = tcmPageTemplate.Title;
            pt.Id            = tcmPageTemplate.Id.ToString();
            pt.FileExtension = tcmPageTemplate.FileExtension;
            pt.RevisionDate  = tcmPageTemplate.RevisionDate;

            if (tcmPageTemplate.Metadata != null && tcmPageTemplate.MetadataSchema != null)
            {
                pt.MetadataFields = new Dynamic.FieldSet();
                TCM.Fields.ItemFields tcmMetadataFields = new TCM.Fields.ItemFields(tcmPageTemplate.Metadata, tcmPageTemplate.MetadataSchema);
                pt.MetadataFields = manager.BuildFields(tcmMetadataFields);
            }
            else
            {
                pt.MetadataFields = null;
            }

            if (!manager.BuildProperties.OmitContextPublications)
            {
                pt.Publication = manager.BuildPublication(tcmPageTemplate.ContextRepository);
            }

            if (!manager.BuildProperties.OmitOwningPublications)
            {
                pt.OwningPublication = manager.BuildPublication(tcmPageTemplate.OwningRepository);
            }

            if (!manager.BuildProperties.OmitFolders)
            {
                pt.Folder = manager.BuildOrganizationalItem((TCM.Folder)tcmPageTemplate.OrganizationalItem);
            }

            return(pt);
        }
Ejemplo n.º 3
0
 public virtual Dynamic.PageTemplate BuildPageTemplate(TComm.PageTemplate tcmPageTemplate)
 {
     return(PageTemplateBuilder.BuildPageTemplate(tcmPageTemplate, this));
 }