Exemple #1
0
 public static ListViewDefinition SettingsView()
 {
     return(new ListViewDefinition
     {
         Title = "All items",
         RowLimit = 25,
         Url = "AllItems.aspx",
         Query = "<OrderBy><FieldRef Name='Created' Ascending='False'/></OrderBy>",
         IsDefault = true,
         TitleResource = new List <ValueForUICulture> {
             new ValueForUICulture {
                 CultureId = 1033, Value = "All items"
             },
             new ValueForUICulture {
                 CultureId = 1049, Value = "Все элементы"
             }
         },
         Fields = new Collection <string>
         {
             BuiltInInternalFieldNames.Edit,
             BuiltInInternalFieldNames.DocIcon,
             BuiltInInternalFieldNames.LinkTitle,
             ArtFields.SpfWebUrl().InternalName,
             BuiltInInternalFieldNames.Editor,
             BuiltInInternalFieldNames.Modified
         }
     });
 }
Exemple #2
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);
        }
Exemple #3
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())
         ;
     }));
 }
Exemple #4
0
        public List <ListItem> FindListChanges(ListItem SettingsListItem)
        {
            var TargetListUrl    = SettingsListItem[BuiltInFieldDefinitions.Title.InternalName].StringValueOrEmpty();
            var TargetListWebUrl = SettingsListItem[ArtFields.SpfWebUrl().InternalName].StringValueOrEmpty();
            var InWeb            = ctx.Site.OpenWeb(TargetListWebUrl);
            var InList           = InWeb.GetList(TargetListUrl);

            var Query = String.Format("<View Scope='RecursiveAll'><Query><Where><Gt><FieldRef Name='Modified' /><Value IncludeTimeValue='TRUE' StorageTZ='TRUE' Type='DateTime'>{0}</Value></Gt></Where></Query></View>",
                                      RunSettings.PreviousRunDate.ToUniversalTime().DateTimeValueOrEmpty());

            var ChangeQuery = new CamlQuery();

            ChangeQuery.ViewXml = Query;
            var ChangedItems = InList.GetItems(ChangeQuery);

            ctx.Load(ChangedItems);
            ctx.ExecuteQuery();

            return(ChangedItems.ToList());
        }