Example #1
0
        public void CheckOwningTeamIsAlsoInvolved()
        {
            WBTermCollection <WBTeam> involvedTeams = this.InvolvedTeams;

            if (!involvedTeams.Contains(OwningTeam))
            {
                involvedTeams.Add(OwningTeam);
            }

            // It's a little inefficient but we'll just call the Proerty set:
            this.InvolvedTeams = involvedTeams;
        }
Example #2
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);
        }