Beispiel #1
0
        public SPListItemCollection GetLiveVersionsUpTo(String recordSeriesID, String recordID)
        {
            WBQuery query = new WBQuery();

            if (String.IsNullOrEmpty(recordSeriesID) || recordSeriesID == recordID)
            {
                query.AddFilter(WBColumn.LiveOrArchived, WBQueryClause.Comparators.Equals, WBColumn.LIVE_OR_ARCHIVED__LIVE);
                query.AddFilter(WBColumn.RecordID, WBQueryClause.Comparators.Equals, recordID);
            }
            else
            {
                query.AddFilter(WBColumn.RecordSeriesID, WBQueryClause.Comparators.Equals, recordSeriesID);
                query.AddFilter(WBColumn.LiveOrArchived, WBQueryClause.Comparators.Equals, WBColumn.LIVE_OR_ARCHIVED__LIVE);
                query.AddFilter(WBColumn.RecordID, WBQueryClause.Comparators.LessThanEquals, recordID);
            }

            query.OrderByDescending(WBColumn.RecordID);

            return(List.WBxGetItems(Site, query));
        }
Beispiel #2
0
        internal WBQuery GetQueryForNewlyPublishedPublicDocsThatNeedEmailAlert()
        {
            WBQuery query = new WBQuery();

            query.AddEqualsFilter(WBColumn.LiveOrArchived, WBColumn.LIVE_OR_ARCHIVED__LIVE);
            query.AddEqualsFilter(WBColumn.ProtectiveZone, WBRecordsType.PROTECTIVE_ZONE__PUBLIC);
            query.AddEqualsFilter(WBColumn.RecordSeriesStatus, WBColumn.RECORD_SERIES_STATUS__LATEST);
            query.AddIsNullFilter(WBColumn.SentNewlyPublishedAlert);
            query.AddFilter(WBColumn.DatePublished, WBQueryClause.Comparators.GreaterThan, DateTime.Now.AddDays(-_daysToIncludeNewlyPublishedPublicDocsInEmailAlerts));
            query.RecursiveAll = true;

            return(query);
        }
Beispiel #3
0
        internal WBQuery GetQueryForTeamsPublicRecordsToArchiveInFutureWeek(WBTeam team, int weekInFuture, bool limitToJustOneWeek)
        {
            WBQuery query = new WBQuery();

            if (team != null)
            {
                query.AddEqualsFilter(WBColumn.OwningTeam, team);
            }
            query.AddEqualsFilter(WBColumn.LiveOrArchived, WBColumn.LIVE_OR_ARCHIVED__LIVE);
            query.AddEqualsFilter(WBColumn.ProtectiveZone, WBRecordsType.PROTECTIVE_ZONE__PUBLIC);
            query.AddEqualsFilter(WBColumn.RecordSeriesStatus, WBColumn.RECORD_SERIES_STATUS__LATEST);

            query.OrderByAscending(WBColumn.ReviewDate);

            if (limitToJustOneWeek && weekInFuture > 1)
            {
                query.AddFilter(WBColumn.ReviewDate, WBQueryClause.Comparators.GreaterThanEquals, DateTime.Now.AddDays((-_weeksBetweenReviewDateAndAutoArchival + weekInFuture - 1) * 7));
            }

            query.AddFilter(WBColumn.ReviewDate, WBQueryClause.Comparators.LessThan, DateTime.Now.AddDays((-_weeksBetweenReviewDateAndAutoArchival + weekInFuture) * 7));
            query.RecursiveAll = true;

            return(query);
        }
Beispiel #4
0
        private WBTermCollection <WBSubjectTag> AddAdditionalSubjectTags(SPSite controlSite, WBTermCollection <WBSubjectTag> subjectTags, String sourceID)
        {
            WBLogging.Migration.Verbose("Adding additional subject tags for item with Source ID = " + sourceID);
            WBQuery query = new WBQuery();

            query.AddFilter(WBColumn.SourceID, WBQueryClause.Comparators.Equals, sourceID);

            SPListItemCollection items = MigrationSubjectsList.WBxGetItems(controlSite, query);

            if (items.Count > 0)
            {
                WBTaxonomy subjectTagsTaxonomy = subjectTags.Taxonomy;

                subjectTags = new WBTermCollection <WBSubjectTag>(subjectTags);

                foreach (SPListItem item in items)
                {
                    String paths = WBUtils.NormalisePaths(item.WBxGetAsString(WBColumn.SubjectTagsPaths));

                    string[] pathsArray = paths.Split(';');
                    foreach (String path in pathsArray)
                    {
                        Term subjectTerm = subjectTagsTaxonomy.GetOrCreateSelectedTermByPath(path);
                        if (subjectTerm != null)
                        {
                            WBLogging.Migration.Verbose("Adding additional subject: " + path);

                            subjectTags.Add(new WBSubjectTag(subjectTagsTaxonomy, subjectTerm));
                        }
                        else
                        {
                            WBLogging.Migration.Unexpected("Could not find or create subject: " + path);
                        }
                    }
                }
            }

//            WBLogging.Migration.Verbose("At this point the subjectTags = " + subjectTags);

            return(subjectTags);
        }