Example #1
0
        public static void FillApplytoFile()
        {
            var SettingsArr = new string[]
            {
                "var SPF = SPF || {};",
                "SPF.AT = SPF.AT || {};",

                "SPF.AT.WebFieldName = \"" + ArtFields.SpfWebUrl().InternalName + "\";",
                "SPF.AT.SettingsList = \"" + ArtLists.CustomAutoTitleList().CustomUrl + "\";",

                "SPF.AT.ListsSettingsCtId = \"" + ArtContentTypes.CustomAutoTitleCT().GetContentTypeId() + "\";"
            };

            GenerateJavascriptFile(Path.Combine(ArtConsts.SystemPath, ArtConsts.ApplyToPath), SettingsArr);
        }
Example #2
0
 public static SiteModelNode DeployModel()
 {
     return(SPMeta2Model.NewSiteModel(site =>
     {
         site
         .AddField(ArtFields.SpfWebUrl())
         .AddContentType(ArtContentTypes.CustomAutoTitleCT(), contentType =>
         {
             contentType
             .AddContentTypeFieldLink(ArtFields.SpfWebUrl())
             ;
         })
         .AddRootWeb(new RootWebDefinition(), RootWeb =>
         {
             RootWeb
             .AddList(ArtLists.CustomAutoTitleList(), SpfList =>
             {
                 SpfList
                 .AddContentTypeLink(ArtContentTypes.CustomAutoTitleCT())
                 .AddUniqueContentTypeOrder(new UniqueContentTypeOrderDefinition
                 {
                     ContentTypes = new List <ContentTypeLinkValue>
                     {
                         new ContentTypeLinkValue {
                             ContentTypeName = ArtContentTypes.CustomAutoTitleCT().Name
                         }
                     }
                 })
                 .AddListView(ArtViews.SettingsView());
             })
             .AddHostList(BuiltInListDefinitions.Catalogs.MasterPage, list =>
             {
                 var FolderPath = Path.Combine(ArtConsts.SystemPath, ArtConsts.Assets);
                 if (Directory.Exists(FolderPath))
                 {
                     Extentions.FillApplytoFile();
                     ModuleFileUtils.LoadModuleFilesFromLocalFolder(list, FolderPath);
                 }
             })
             ;
         })
         .AddUserCustomAction(ArtActions.ListSettings())
         .AddUserCustomAction(ArtActions.FolderSettings())
         ;
     }));
 }