protected void Page_Load(object sender, EventArgs e) { subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(SPContext.Current.Site); subjectTagsTaxonomy.InitialiseTaxonomyControl(SubjectTag, "Subject Tag", false); farm = WBFarm.Local; routings = farm.SubjectTagsRecordsRoutings(subjectTagsTaxonomy); if (!IsPostBack) { RouteIndex.Value = Request.QueryString["RouteIndex"]; int index; if (Int32.TryParse(RouteIndex.Value, out index)) { WBSubjectTagRecordsRoutings routing = routings[index]; if (routing != null) { SubjectTag.Text = routing.SubjectTag.UIControlValue; PublicDocumentsLibrary.Text = routing.PublicDocumentsLibrary; ExtranetDocumentsLibrary.Text = routing.ExtranetDocumentsLibrary; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!WorkBox.CurrentUserIsOwner() && !WorkBox.CurrentUserIsBusinessAdmin() && !WorkBox.CurrentUserIsSystemAdmin()) { ErrorText.Text = "Only owners or admin can invite teams to have access to a work box."; return; } teamsTaxonomy = WBTaxonomy.GetTeams(SPContext.Current.Site); if (!IsPostBack) { WorkBoxTitle.Text = WorkBox.Title; InviteType.SelectedValue = "Involved"; CurrentlySelectedValue.Value = "Involved"; SendInviteEmail.Checked = true; SendAsOne.Checked = true; CCToYou.Checked = true; EmailSubject.Text = WorkBox.Template.InviteInvolvedUserEmailSubject; EmailBody.Text = WorkBox.Template.InviteInvolvedUserEmailBody; OtherEmailSubject.Value = WorkBox.Template.InviteVisitingUserEmailSubject; OtherEmailBody.Value = WorkBox.Template.InviteVisitingUserEmailBody; teamsTaxonomy.InitialiseTaxonomyControl(TeamsToInviteControl, "Teams to invite", true); TeamsToInviteControl.Focus(); DisposeWorkBox(); } }
protected void Page_Load(object sender, EventArgs e) { recordsTypesTaxonomy = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); teamsTaxonomy = WBTaxonomy.GetTeams(recordsTypesTaxonomy); functionalAreaTaxonomy = WBTaxonomy.GetFunctionalAreas(recordsTypesTaxonomy); subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(recordsTypesTaxonomy); SelectedView = VIEW_BY_FUNCTION_THEN_TYPE; if (!IsPostBack) { } RefreshBrowsableTreeView(); ShowResults.AllowSorting = true; ShowResults.Sorting += new GridViewSortEventHandler(ShowResults_Sorting); ShowResults.AllowPaging = true; ShowResults.PageIndexChanging += new GridViewPageEventHandler(ShowResults_PageIndexChanging); ShowResults.PagerSettings.Mode = PagerButtons.Numeric; ShowResults.PagerSettings.Position = PagerPosition.Bottom; ShowResults.PagerSettings.PageButtonCount = 50; ShowResults.PagerSettings.Visible = true; ShowResults.PageSize = 50; // this odd statement is required in order to get the pagination to work with an SPGridView! ShowResults.PagerTemplate = null; }
DataView GetSeriesTagDataSource(WBTerm seriesTagsParentTerm) { WBTaxonomy seriesTagsTaxonomy = seriesTagsParentTerm.Taxonomy; // Create a table to store data for the DropDownList control. DataTable dataTable = new DataTable(); // Define the columns of the table. dataTable.Columns.Add(new DataColumn("SeriesTagTermName", typeof(String))); dataTable.Columns.Add(new DataColumn("SeriesTagTermUIControlValue", typeof(String))); // First add a blank data row: dataTable.Rows.Add(CreateRow("", "", dataTable)); // Then add all of the terms under the parent term: foreach (Term childTerm in seriesTagsParentTerm.Term.Terms) { WBTerm child = new WBTerm(seriesTagsTaxonomy, childTerm); dataTable.Rows.Add(CreateRow(child.Name, child.UIControlValue, dataTable)); } // Create a DataView from the DataTable to act as the data source // for the DropDownList control. DataView dataView = new DataView(dataTable); return(dataView); }
//protected String popupMessage = ""; protected void Page_Load(object sender, EventArgs e) { SPSite site = SPContext.Current.Site; recordsTypes = WBTaxonomy.GetRecordsTypes(site); seriesTags = WBTaxonomy.GetSeriesTags(recordsTypes); functionalAreas = WBTaxonomy.GetFunctionalAreas(recordsTypes); WBUtils.logMessage("Records Types object has been recreated"); functionalAreas.InitialiseTaxonomyControl(DefaultFunctionalArea, "Select Default Functional Area", false, false, this); recordsTypes.InitialiseTaxonomyControl(DefaultRecordsType, "Select Default Publishing Out Records Type", false, false, this); seriesTags.InitialiseTaxonomyControl(DocumentSeriesTagParentTerm, "Select the Series Tag Parent", false, true, this); seriesTags.InitialiseTaxonomyControl(WorkBoxSeriesTagParentTerm, "Select the Series Tag Parent", false, true, this); if (!IsPostBack) { TreeViewTermCollection collection = new TreeViewTermCollection(recordsTypes.TermSet); // Bind the data source to your collection AllRecordsTypesTreeView.DataSource = collection; AllRecordsTypesTreeView.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { WBTaxonomy recordsTypes = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); TreeViewTermCollection collection = new TreeViewTermCollection(); collection.Add(new TreeViewTerm(recordsTypes.TermSet)); PickRecordsTypeTreeView.DataSource = collection; PickRecordsTypeTreeView.DataBind(); ShowResults.AllowSorting = true; ShowResults.Sorting += new GridViewSortEventHandler(ShowResults_Sorting); ShowResults.AllowPaging = true; ShowResults.PageIndexChanging += new GridViewPageEventHandler(ShowResults_PageIndexChanging); ShowResults.PagerSettings.Mode = PagerButtons.Numeric; ShowResults.PagerSettings.Position = PagerPosition.Bottom; ShowResults.PagerSettings.PageButtonCount = 10; ShowResults.PagerSettings.Visible = true; ShowResults.PageSize = 10; // this odd statement is required in order to get the pagination to work with an SPGridView! ShowResults.PagerTemplate = null; }
private string addWorkBoxesForRecordsClasses(WBTaxonomy recordsTypes, TermCollection recordsClassesTerms) { if (recordsClassesTerms.Count == 0) { return(""); } // string finalHtml = "<ul class=\"wbf-my-work-boxes-list wbf-records-classes\">\n"; string finalHtml = ""; foreach (Term recordsClassTerm in recordsClassesTerms) { string html = addWorkBoxesForRecordsClass(recordsTypes, recordsClassTerm.Terms); if (html != "" || ShowAllRecordsTypes) { // html = "<li class=\"wbf-records-class\">\n" + recordsClassTerm.Name + "\n" + html + "</li>\n"; html = "<tr><td colspan=\"5\" class=\"wbf-records-class\">\n" + recordsClassTerm.Name + "</td></tr>\n" + html; finalHtml += html; } } // finalHtml += "</ul>\n"; return(finalHtml); }
void PopulateControls() { if (!IsPostBack) { WBCollection collection = new WBCollection(SPContext.Current); WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); teams.InitialiseTaxonomyControl(SystemAdminTeams, "Select the System Admin Teams", true); SystemAdminTeams.Text = collection.SystemAdminTeams.UIControlValue; teams.InitialiseTaxonomyControl(BusinessAdminTeams, "Select the Business Admin Teams", true); BusinessAdminTeams.Text = collection.BusinessAdminTeams.UIControlValue; NameOfAllWorkBoxesList.Text = collection.ListName; if (collection.EventReceiversAdded) { EventReceiverStatus.Text = "<i>(Event receiver <b>has</b> been added)</i>"; } GenerateUniqueIds.Checked = collection.GenerateUniqueIDs; WorkBoxCollectionUniqueIdPrefix.Text = collection.UniqueIDPrefix; NumberOfDigitsInIds.Text = collection.NumberOfDigitsInIDs.ToString(); InitialIdOffset.Text = collection.InitialIDOffset.ToString(); CanAnyoneCreate.Checked = collection.CanAnyoneCreate; SysadminOpen.Text = collection.OpenPermissionLevelForSystemAdmin; AdminOpen.Text = collection.OpenPermissionLevelForBusinessAdmin; OwnerOpen.Text = collection.OpenPermissionLevelForOwner; InvolvedOpen.Text = collection.OpenPermissionLevelForInvolved; VisitorsOpen.Text = collection.OpenPermissionLevelForVisitors; EveryoneOpen.Text = collection.OpenPermissionLevelForEveryone; SysadminClosed.Text = collection.ClosedPermissionLevelForSystemAdmin; AdminClosed.Text = collection.ClosedPermissionLevelForBusinessAdmin; OwnerClosed.Text = collection.ClosedPermissionLevelForOwner; InvolvedClosed.Text = collection.ClosedPermissionLevelForInvolved; VisitorsClosed.Text = collection.ClosedPermissionLevelForVisitors; EveryoneClosed.Text = collection.ClosedPermissionLevelForEveryone; UseFolderAccessGroupsPattern.Checked = collection.UseFolderAccessGroupsPattern; FolderAccessGroupsPrefix.Text = collection.FolderAccessGroupsPrefix; FolderAccessGroupsFolderNames.Text = collection.FolderAccessGroupsFolderNames; FolderAccessGroupPermissionLevel.Text = collection.FolderAccessGroupPermissionLevel; AllFoldersAccessGroupPermissionLevel.Text = collection.AllFoldersAccessGroupPermissionLevel; NewWorkBoxDialogUrl.Text = collection.UrlForNewWorkBoxDialog; CreateNewWorkBoxText.Text = collection.CreateNewWorkBoxText; teams.InitialiseTaxonomyControl(DefaultOwningTeam, "Select the Default Owning Team", false); DefaultOwningTeam.Text = collection.DefaultOwningTeamUIControlValue; UsesLinkedCalendars.Checked = collection.UsesLinkedCalendars; ReturnUrl.Value = Request.QueryString["ReturnUrl"]; } }
protected void Page_Load(object sender, EventArgs e) { webPart = this.Parent as ViewSeriesPages; string additionalPath = Request.QueryString["AdditionalPath"]; if (additionalPath == null) { additionalPath = ""; } if (webPart.ParentSeriesTag == null || webPart.ParentSeriesTag == "") { PageSeriesTagName.Text = "<i>(Web part not yet configured)</i>"; return; } string fullPath = webPart.ParentSeriesTag + additionalPath; WBTaxonomy seriesTags = WBTaxonomy.GetSeriesTags(SPContext.Current.Site); WBTerm pageSeriesTag = null; Term pageSeriesTagTerm = seriesTags.GetSelectedTermByPath(fullPath); if (pageSeriesTagTerm != null) { pageSeriesTag = new WBTerm(seriesTags, pageSeriesTagTerm); } if (pageSeriesTag == null) { PageSeriesTagName.Text = "<i>(Could not find the series tag with path: " + fullPath + ")</i>"; return; } PageSeriesTagName.Text = pageSeriesTag.Name; PageSeriesTagDescription.Text = pageSeriesTag.Description; string html = "<table cellspacing=\"10\" cellpadding=\"10\" class=\"seriesTags\">"; foreach (Term child in pageSeriesTag.Term.Terms) { if (child.Terms.Count > 0) { html = html + createTableRowForChildSeriesTag(seriesTags, additionalPath, child); } else { html = html + createTableRowForDocument(seriesTags, child); } } html += "</table>"; TableOfChildTerms.Text = html; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WBFarm farm = WBFarm.Local; FarmInstance.DataSource = WBFarm.GetFarmInstances(); FarmInstance.DataBind(); FarmInstance.WBxSafeSetSelectedValue(farm.FarmInstance); ProtectedRecordsLibraryURL.Text = farm.ProtectedRecordsLibraryUrl; PublicRecordsLibraryURL.Text = farm.PublicRecordsLibraryUrl; PublicExtranetRecordsLibraryURL.Text = farm.PublicExtranetRecordsLibraryUrl; TeamSitesSiteCollectionURL.Text = farm.TeamSitesSiteCollectionUrl; WBLogging.Debug("Got here"); WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); if (teams == null) { WBLogging.Debug("teams was null"); } WBTeam systemAdminTeam = farm.SystemAdminTeam(teams); if (systemAdminTeam != null) { SystemAdminTeam.Text = systemAdminTeam.FullPath; } else { WBLogging.Debug("systemAdminTeam was null"); SystemAdminTeam.Text = ""; } // SystemAdminTeam.Text = farm.SystemAdminTeamGUIDString; OpenWorkBoxesCachedDetailsListURL.Text = farm.OpenWorkBoxesCachedDetailsListUrl; RecordsManagersGroupName.Text = farm.RecordsManagersGroupName; RecordsSystemAdminGroupName.Text = farm.RecordsSystemAdminGroupName; TimerJobsManagementSiteURL.Text = farm.TimerJobsManagementSiteUrl; TimerJobsServerName.Text = farm.TimerJobsServerName; AllWorkBoxCollections.Text = farm.AllWorkBoxCollectionsPropertyValue; TermStoreName.Text = farm.TermStoreName; TermStoreGroupName.Text = farm.TermStoreGroupName; DocumentContentTypeName.Text = farm.WorkBoxDocumentContentTypeName; RecordContentTypeName.Text = farm.WorkBoxRecordContentTypeName; SendErrorReportsTo.Text = farm.SendErrorReportEmailsTo; } }
protected void Page_Load(object sender, EventArgs e) { WBFarm farm = WBFarm.Local; WBTaxonomy subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(SPContext.Current.Site); WBSubjectTagsRecordsRoutings routings = farm.SubjectTagsRecordsRoutings(subjectTagsTaxonomy); if (!String.IsNullOrEmpty(Request.QueryString["RemoveIndex"])) { int index; if (Int32.TryParse(Request.QueryString["RemoveIndex"], out index)) { routings.RemoveAtIndex(index); // Now save the new routing information: SPContext.Current.Web.AllowUnsafeUpdates = true; farm.SubjectTagsRecordsRoutingsString = routings.ToString(); farm.Update(); SPContext.Current.Web.AllowUnsafeUpdates = false; SPUtility.Redirect("/_admin/WorkBoxFramework/RecordsManagementAdmin.aspx", SPRedirectFlags.Static, Context); return; } } if (!IsPostBack) { PublicDocumentEmailAlertsTo.Text = farm.PublicDocumentEmailAlertsTo; PublicWebsiteTeamEmail.Text = farm.PublicWebsiteTeamEmail; } String html = "<table cellpadding='6'>\n"; html += "<tr><th>Subject Tag</th><th>Public Library</th><th>Extranet Library</th></tr>\n\n"; if (routings.Count > 0) { int index = 0; foreach (WBSubjectTagRecordsRoutings routing in routings) { html += "<tr><td>" + routing.SubjectTag.FullPath + "</td><td>" + routing.PublicDocumentsLibrary + "</td><td>" + routing.ExtranetDocumentsLibrary + "</td><td>" + "<a href='#' onclick='WorkBoxFramework_callDialog(\"/_admin/WorkBoxFramework/EditSubjectTagRouting.aspx?RouteIndex=" + index + "\");'>edit</a></td><td>" + "<a href='#' onclick='if (window.confirm(\"Are you sure you want to remove routing?\")) { location.href = \"/_admin/WorkBoxFramework/RecordsManagementAdmin.aspx?RemoveIndex=" + index + "\"; }'>remove</a></td></tr>\n\n"; index++; } } else { html += "<tr><td colspan='5'><i>No subject tag routings</i></td></tr>\n\n"; } html += "<tr><td colspan='5'><a href='#' onclick='WorkBoxFramework_callDialog(\"/_admin/WorkBoxFramework/EditSubjectTagRouting.aspx\");'>Add another subject tag routing rule</a></td></tr>\n\n"; SubjectTagsRecordsRoutings.Text = html; }
protected void okButton_OnClick(object sender, EventArgs e) { WBFarm farm = WBFarm.Local; farm.FarmInstance = FarmInstance.SelectedValue; farm.ProtectedRecordsLibraryUrl = ProtectedRecordsLibraryURL.Text; farm.PublicRecordsLibraryUrl = PublicRecordsLibraryURL.Text; farm.PublicExtranetRecordsLibraryUrl = PublicExtranetRecordsLibraryURL.Text; farm.TeamSitesSiteCollectionUrl = TeamSitesSiteCollectionURL.Text; //farm.SystemAdminTeamGUIDString = SystemAdminTeam.Text; if (!String.IsNullOrEmpty(SystemAdminTeam.Text)) { WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); WBTeam systemAdminTeam = teams.GetSelectedTeam(SystemAdminTeam.Text); if (systemAdminTeam != null) { farm.SystemAdminTeamGUIDString = systemAdminTeam.Id.ToString(); } else { farm.SystemAdminTeamGUIDString = ""; } } else { farm.SystemAdminTeamGUIDString = ""; } farm.OpenWorkBoxesCachedDetailsListUrl = OpenWorkBoxesCachedDetailsListURL.Text; farm.RecordsManagersGroupName = RecordsManagersGroupName.Text; farm.RecordsSystemAdminGroupName = RecordsSystemAdminGroupName.Text; farm.TimerJobsManagementSiteUrl = TimerJobsManagementSiteURL.Text; farm.TimerJobsServerName = TimerJobsServerName.Text; farm.AllWorkBoxCollectionsPropertyValue = AllWorkBoxCollections.Text; farm.TermStoreName = TermStoreName.Text; farm.TermStoreGroupName = TermStoreGroupName.Text; farm.WorkBoxDocumentContentTypeName = DocumentContentTypeName.Text; farm.WorkBoxRecordContentTypeName = RecordContentTypeName.Text; farm.SendErrorReportEmailsTo = SendErrorReportsTo.Text; farm.Update(); SPUtility.Redirect("/applications.aspx", SPRedirectFlags.Static, Context); }
private void PopulateListView(WBTaxonomy teams, TermCollection terms) { Literal literal = new Literal(); string html = ""; // tempStyling(); html += addChildTeamsFromTerms(teams, terms); literal.Text = html; this.Controls.Add(literal); }
/// <summary> /// Updates and existing subject tag /// </summary> void UpdateTag() { // It appears that a TaxonomySession will always run as the current user, even if elevated. // See: http://scle.me/1skLGCY var currentSiteGuid = SPContext.Current.Site.ID; var oldContext = HttpContext.Current; HttpContext.Current = null; SPSecurity.RunWithElevatedPrivileges(() => { using (SPSite elevatedSite = new SPSite(currentSiteGuid)) { WBTaxonomy wbTax = WBTaxonomy.GetSubjectTags(elevatedSite); Term rootSubjectTagTerm = wbTax.GetSelectedTermByPath(_path); WBSubjectTag subjectTag = null; if (rootSubjectTagTerm != null) { subjectTag = new WBSubjectTag(wbTax, rootSubjectTagTerm); if (subjectTag == null) { return; } } // Page content subjectTag.PageContent = htmlDescription.Html; // Internal Contact SPUser pickedUser = ppInternalContact.WBxGetSingleResolvedUser(elevatedSite.RootWeb); if (pickedUser != null) { subjectTag.InternalContactLoginName = pickedUser.LoginName; } else { subjectTag.InternalContactLoginName = string.Empty; } // External Contact subjectTag.ExternalContact = htmlExternalContact.Html; // Tag Name subjectTag.Name = txtEdit_CurrentTagName.Text; subjectTag.Update(); } }); HttpContext.Current = oldContext; }
protected void Page_Load(object sender, EventArgs e) { recordsTypeTaxonomy = WBTaxonomy.GetRecordsTypes(WorkBox.Site); recordsTypeTaxonomy.InitialiseTaxonomyControl(RecordsTypeField, WorkBox.COLUMN_NAME__RECORDS_TYPE, false); if (!IsPostBack) { RecordsTypeField.Text = Request.QueryString["recordsTypeUIControlValue"]; } }
protected void Page_Load(object sender, EventArgs e) { SPWeb web = SPContext.Current.Web; SPSite site = SPContext.Current.Site; WBTaxonomy recordsTypesTaxonomy = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); string teamGUIDString = ""; Team = WBTeam.GetFromTeamSite(SPContext.Current); if (Team == null) { NotSetupText = "(<i>This site doesn't appear to be a team site so this web part wont work here.</i>)"; return; } teamGUIDString = WBExtensions.WBxToString(Team.Id); string recordsTypesListUrl = Team.RecordsTypesListUrl; /* * For the moment this web part is just going to list all of the available records types so the following code is not needed * * if (recordsTypesListUrl == null || recordsTypesListUrl == "") * { * //recordsTypesListUrl = web.Url + "/Lists/Configure%20Teams%20Records%20Classes"; * NotSetupText = "(<i>The team has no records types list setup yet.</i>)"; * return; * } */ string selectedRecordsTypeGUID = Request.QueryString["recordsTypeGUID"]; try { foreach (Term term in recordsTypesTaxonomy.TermSet.Terms) { WBRecordsType recordsClass = new WBRecordsType(recordsTypesTaxonomy, term); TreeNode node = createNodes(recordsClass); RecordsTypeTreeView.Nodes.Add(node); RecordsTypeTreeView.CollapseAll(); expandByRecordsTypeGUID(RecordsTypeTreeView.Nodes, selectedRecordsTypeGUID); } } catch (Exception exception) { WBUtils.logMessage("The error message was: " + exception.Message); } }
private bool PopulateTreeView(TreeNodeCollection nodes, WBTaxonomy teams, TermCollection terms) { Dictionary <String, TreeNode> allNodes = new Dictionary <String, TreeNode>(); bool containsTeamForMe = false; foreach (Term term in terms) { WBTeam team = new WBTeam(teams, term); if (term.IsAvailableForTagging) { bool isTeamMember = IsSelectedUserTeamMember(team); TreeNode teamTreeNode = new TreeNode(); teamTreeNode.Text = team.Name; teamTreeNode.Value = team.Id.ToString(); if (isTeamMember) { displayingAnyTeams = true; teamTreeNode.NavigateUrl = team.TeamSiteUrl; teamTreeNode.ImageUrl = "/_layouts/images/WorkBoxFramework/team-16.png"; } if (AlwaysProvideLink) { teamTreeNode.NavigateUrl = team.TeamSiteUrl; } if (PopulateTreeView(teamTreeNode.ChildNodes, teams, term.Terms) || ShowAllTeams || isTeamMember) { containsTeamForMe = true; allNodes.Add(team.Name, teamTreeNode); } } } List <String> names = new List <String>(allNodes.Keys); names.Sort(); foreach (String name in names) { nodes.Add(allNodes[name]); } return(containsTeamForMe); }
protected override void CreateChildControls() { WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); String selectedUserLoginName = Page.Request.QueryString["LoginName"]; if (!String.IsNullOrEmpty(selectedUserLoginName)) { selectedUser = SPContext.Current.Web.WBxEnsureUserOrNull(selectedUserLoginName); } TermCollection terms = teams.TermSet.Terms; if (ParentTeamsTerm != null && ParentTeamsTerm != "") { Term parentTerm = teams.GetSelectedTermByPath(ParentTeamsTerm); terms = parentTerm.Terms; } SPTreeView treeView = new SPTreeView(); TreeNodeStyle nodeStyle = new TreeNodeStyle(); treeView.NodeStyle.HorizontalPadding = new Unit(3); treeView.NodeStyle.CssClass = "wbf-team-tree-node"; this.Controls.Clear(); this.Controls.Add(treeView); if (UseTreeView) { treeView.ShowLines = true; treeView.Nodes.Clear(); PopulateTreeView(treeView.Nodes, teams, terms); } else { PopulateListView(teams, terms); } if (!displayingAnyTeams) { Literal noTeamsLiteral = new Literal(); noTeamsLiteral.Text = "<i>(You are not a member of such a team site yet. Contact the SharePoint champion in your area for more information)</i>"; this.Controls.Add(noTeamsLiteral); } }
protected void Page_Load(object sender, EventArgs e) { string csv = ""; WBTaxonomy recordsTypes = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); foreach (Term classTerm in recordsTypes.TermSet.Terms) { WBRecordsType recordsClass = new WBRecordsType(recordsTypes, classTerm); csv += AddRecordsType(recordsClass); } CSVOutput.Text = csv; }
private string createTableRowForChildSeriesTag(WBTaxonomy seriesTags, String additionalPath, Term child) { string currentURL = Request.Url.ToString(); int startIndex = currentURL.IndexOf("?"); if (startIndex > 0) { currentURL = currentURL.Substring(0, startIndex); } string childURL = currentURL + "?AdditionalPath=" + additionalPath + "/" + child.Name; string html = "<tr class=\"seriesTags\"><td class=\"seriesTags\"><a href=\"" + childURL + "\">" + child.Name + "</a></td></tr>"; return(html); }
protected void Page_Load(object sender, EventArgs e) { //SPSite site = SPContext.Current.Site; _subjectTags = WBTaxonomy.GetSubjectTags(SPContext.Current.Site); if (!IsPostBack) { TreeViewTermCollection collection = new TreeViewTermCollection(_subjectTags.TermSet); // Bind the data source to your collection tvAllSubjectTags.DataSource = collection; tvAllSubjectTags.DataBind(); var teamsTax = WBTaxonomy.GetTeams(SPContext.Current.Site); teamsTax.InitialiseTaxonomyControl(taxTeams, "Select team with permissions to edit this term and create children", true, false, this); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { WBFarm farm = WBFarm.Local; if (!String.IsNullOrEmpty(farm.TermStoreName)) { try { WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); if (teams == null) { WBLogging.Debug("teams was null"); } WBTeam systemAdminTeam = farm.SystemAdminTeam(teams); if (systemAdminTeam != null) { AdminTeamSiteURL.Text = systemAdminTeam.TeamSiteUrl; } } catch (Exception exception) { WBLogging.Generic.HighLevel("Couldn't find the current admin team site URL: " + exception.Message); } } TimerJobsServerName.Text = farm.TimerJobsServerName; TermStoreName.Text = farm.TermStoreName; TermStoreGroupName.Text = farm.TermStoreGroupName; DocumentContentTypeName.Text = farm.WorkBoxDocumentContentTypeName; RecordContentTypeName.Text = farm.WorkBoxRecordContentTypeName; if (!String.IsNullOrEmpty(farm.TimerJobsManagementSiteUrl)) { DoInitialConfigStep.Text = "Check Configuration"; } } }
private string createTableRowForDocument(WBTaxonomy seriesTags, Term docSeriesTerm) { WBQuery query = new WBQuery(); WBTerm docSeriesTag = new WBTerm(seriesTags, docSeriesTerm); query.AddEqualsFilter(WBColumn.SeriesTag, docSeriesTag); query.OrderBy(WBColumn.DeclaredRecord, false); query.AddViewColumn(WBColumn.Name); query.AddViewColumn(WBColumn.EncodedAbsoluteURL); query.AddViewColumn(WBColumn.DeclaredRecord); WBFarm farm = WBFarm.Local; SPListItem document = null; using (SPSite site = new SPSite(farm.ProtectedRecordsLibraryUrl)) { using (SPWeb web = site.OpenWeb()) { SPList recordsLibrary = web.GetList(farm.ProtectedRecordsLibraryUrl); SPListItemCollection items = recordsLibrary.WBxGetItems(site, query); if (items.Count > 0) { document = items[0]; } } } string docURL = "#"; string docName = "Did not find a docuemnt for this series tag"; if (document != null) { docURL = document.WBxGetAsString(WBColumn.EncodedAbsoluteURL); docName = document.WBxGetAsString(WBColumn.Name); } string html = "<tr class=\"seriesTags\"><td><img src=\"/_layouts/images/icdocx.png\"/></td><td class=\"seriesTags\"><a href=\"" + docURL + "\">" + docSeriesTag.Name + "</a></td><td>(" + docName + ")</td></tr>"; return(html); }
protected override void CreateChildControls() { Literal literal = new Literal(); string html = "<table class=\"wbf-my-work-boxes-list\"> \n"; // html += tempStyling(); WBTaxonomy recordsTypes = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); TermCollection recordsClassesTerms = recordsTypes.TermSet.Terms; html += addWorkBoxesForRecordsClasses(recordsTypes, recordsClassesTerms); html += "</table> \n"; literal.Text = html; this.Controls.Add(literal); }
protected void Page_Load(object sender, EventArgs e) { WBRecordsType recordsType = WorkBox.RecordsType; if (recordsType.WorkBoxReferenceIDRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN) { showReferenceID = true; } if (recordsType.WorkBoxReferenceDateRequirement != WBRecordsType.METADATA_REQUIREMENT__HIDDEN) { showReferenceDate = true; } if (!IsPostBack) { WorkBoxTitle.Text = WorkBox.Title; OwningTeam.Text = WorkBox.OwningTeam.Name; FunctionalArea.Text = WorkBox.FunctionalArea(WBTaxonomy.GetFunctionalAreas(WorkBox.RecordsTypes)).Names(); RecordsType.Text = recordsType.FullPath; WorkBoxTemplate.Text = WorkBox.Template.Title; WorkBoxStatus.Text = WorkBox.Status; WorkBoxURL.Text = WorkBox.Url; WorkBoxShortTitle.Text = WorkBox.ShortTitle; WorkBoxPrettyTitle.Text = WorkBox.Web.Title; if (showReferenceID) { ReferenceID.Text = WorkBox.ReferenceID; } if (showReferenceDate) { if (WorkBox.ReferenceDateHasValue) { ReferenceDate.Text = WorkBox.ReferenceDate.ToShortDateString(); } } WBAction editAction = WorkBox.GetAction(WBAction.ACTION_KEY__EDIT_PROPERTIES); EditButton.Enabled = editAction.IsEnabled; } }
protected void Page_Load(object sender, EventArgs e) { webPart = this.Parent as ViewTeamsPublishedDocuments; recordsTypesTaxonomy = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); teamsTaxonomy = WBTaxonomy.GetTeams(recordsTypesTaxonomy); functionalAreaTaxonomy = WBTaxonomy.GetFunctionalAreas(recordsTypesTaxonomy); subjectTagsTaxonomy = WBTaxonomy.GetSubjectTags(recordsTypesTaxonomy); //RefreshBrowsableTreeView(); ShowResults.AllowSorting = true; ShowResults.Sorting += new GridViewSortEventHandler(ShowResults_Sorting); ShowResults.AllowPaging = true; ShowResults.PageIndexChanging += new GridViewPageEventHandler(ShowResults_PageIndexChanging); ShowResults.PagerSettings.Mode = PagerButtons.Numeric; ShowResults.PagerSettings.Position = PagerPosition.Bottom; ShowResults.PagerSettings.PageButtonCount = 50; ShowResults.PagerSettings.Visible = true; ShowResults.PageSize = 50; // this odd statement is required in order to get the pagination to work with an SPGridView! ShowResults.PagerTemplate = null; if (!IsPostBack) { // ViewSelector.DataSource = LibraryViews; // ViewSelector.DataBind(); //ProtectiveZoneFilterOptions = WBRecordsType.getProtectiveZones(); // ProtectiveZoneFilterOptions.Insert(0, ""); // FilterByProtectiveZone.DataSource = ProtectiveZoneFilterOptions; // FilterByProtectiveZone.DataBind(); SelectedView = VIEW_BY_FUNCTION_THEN_TYPE; RefreshBoundData(); } }
protected void Page_Load(object sender, EventArgs e) { WBRecordsType recordsType = WorkBox.RecordsType; if (recordsType.WorkBoxReferenceIDRequirement == WBRecordsType.METADATA_REQUIREMENT__HIDDEN) { showReferenceID = false; } if (recordsType.WorkBoxReferenceDateRequirement == WBRecordsType.METADATA_REQUIREMENT__HIDDEN) { showReferenceDate = false; } if (!IsPostBack) { WorkBoxTitle.Text = WorkBox.Title; OwningTeam.Text = WorkBox.OwningTeam.Name; FunctionalArea.Text = WorkBox.FunctionalArea(WBTaxonomy.GetFunctionalAreas(WorkBox.RecordsTypes)).Names(); RecordsType.Text = recordsType.FullPath; WorkBoxTemplate.Text = WorkBox.Template.Title; WorkBoxStatus.Text = WorkBox.Status; WorkBoxURL.Text = WorkBox.Url; WorkBoxShortTitle.Text = WorkBox.ShortTitle; WorkBoxPrettyTitle.Text = WorkBox.Web.Title; WorkBoxShortTitle.Focus(); if (showReferenceID) { ReferenceID.Text = WorkBox.ReferenceID; } if (showReferenceDate) { if (WorkBox.ReferenceDateHasValue) { ReferenceDate.SelectedDate = WorkBox.ReferenceDate; } } } }
protected void Page_Load(object sender, EventArgs e) { SPSite site = SPContext.Current.Site; teams = WBTaxonomy.GetTeams(site); functionalAreas = WBTaxonomy.GetFunctionalAreas(teams); functionalAreas.InitialiseTaxonomyControl(TeamFunctionalAreas, "Select Functional Area(s)", true, false, this); if (!IsPostBack) { TreeViewTermCollection collection = new TreeViewTermCollection(); collection.Add(new TreeViewTerm(teams.TermSet)); // Bind the data source to your collection AllTeamsTreeView.DataSource = collection; AllTeamsTreeView.DataBind(); } }
/* Added by Steve Clements to support Add / Edit tag functionality */ /// <summary> /// Setup the properties for the add / edit buttons /// </summary> void SetupAddEditButtons(WBSubjectTag tag) { canEditOrCreate = false; if (tag == null) { return; } WBTaxonomy teamsTax = WBTaxonomy.GetTeams(SPContext.Current.Site); if (tag.TeamsWithPermissionToEdit(teamsTax).WBxContainsCurrentUserAsTeamMember()) { canEditOrCreate = true; // properties on the button var mmspath = String.Concat(webPart.RootSubjectTag, Request.QueryString["AdditionalPath"] ?? String.Empty); btnNewSubjectTag.Attributes.Add("data-mmspath", mmspath); btnEditSubjectTag.Attributes.Add("data-mmspath", mmspath); } }
protected override void CreateChildControls() { WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site); team = WBTeam.GetFromTeamSite(teams, SPContext.Current); Literal literal = new Literal(); string html = ""; //html += tempStyling(); WBTaxonomy recordsTypes = WBTaxonomy.GetRecordsTypes(SPContext.Current.Site); TermCollection recordsClassesTerms = recordsTypes.TermSet.Terms; html += addWorkBoxesForRecordsClasses(recordsTypes, recordsClassesTerms); literal.Text = html; this.Controls.Add(literal); }