protected void UploadPicture_OnClick(object sender, EventArgs e) { if (String.IsNullOrEmpty(FileToLoad.Text)) { return; } try { SPSite _site = SPContext.Current.Site; SPServiceContext _serviceContext = SPServiceContext.GetContext(_site); UserProfileManager _profileManager = new UserProfileManager(_serviceContext); UserProfile profile = _profileManager.GetUserProfile(true); string filename = FileToLoad.Text; if (File.Exists(filename)) { FileStream fileStream = File.OpenRead(filename); BinaryReader reader = new BinaryReader(fileStream); int length = (int)new FileInfo(filename).Length; byte[] byteArray = reader.ReadBytes(length); // profile. } } catch (Exception error) { WBLogging.Debug("An error occurred: " + error.Message); } }
protected void ShowResults_Sorting(object sender, GridViewSortEventArgs e) { WBLogging.Debug("In gridView_Sorting with e.SortExpression = " + e.SortExpression); string sortExpression = e.SortExpression; ViewState["SortExpression"] = sortExpression; sortColumn = WBColumn.GetKnownColumnByInternalName(sortExpression); if (GridViewSortDirection == SortDirection.Ascending) { GridViewSortDirection = SortDirection.Descending; ascending = false; WBLogging.Debug("In gridView_Sorting setting to descending"); } else { GridViewSortDirection = SortDirection.Ascending; ascending = true; WBLogging.Debug("In gridView_Sorting setting to ascending"); } // If we're re-sorting the data let's start back on page 0: ShowResults.PageIndex = 0; RefreshBoundData(); }
protected void publishAllButton_OnClick(object sender, EventArgs e) { WBLogging.Debug("In publishAllButton_OnClick()"); process.PublishMode = WBPublishingProcess.PUBLISH_MODE__ALL_TOGETHER; MaybeGoToNextPage(); }
protected void Page_Load(object sender, EventArgs e) { SelectedWorkBoxes.AllowSorting = true; SelectedWorkBoxes.Sorting += new GridViewSortEventHandler(SelectedWorkBoxes_Sorting); SelectedWorkBoxes.AllowPaging = true; SelectedWorkBoxes.PageIndexChanging += new GridViewPageEventHandler(SelectedWorkBoxes_PageIndexChanging); SelectedWorkBoxes.PagerSettings.Mode = PagerButtons.Numeric; SelectedWorkBoxes.PagerSettings.Position = PagerPosition.Bottom; SelectedWorkBoxes.PagerSettings.PageButtonCount = 10; SelectedWorkBoxes.PagerSettings.Visible = true; SelectedWorkBoxes.PageSize = 10; // this odd statement is required in order to get the pagination to work with an SPGridView! SelectedWorkBoxes.PagerTemplate = null; if (!IsPostBack) { SelectedRecordsTypeGUID = Request.QueryString["recordsTypeGUID"]; WBLogging.Debug("Not in post back so setting guid value to be: " + SelectedRecordsTypeGUID); RefreshBoundData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String allDetails = Request.QueryString["CurrentDetails"]; string[] details = allDetails.Split(','); if (details.Length != 5) { WBLogging.Debug("The details sent to this page have the wrong structure: " + allDetails); ErrorMessage.Text = "There was a problem with the data sent to this page: " + allDetails; return; } EditWidth.Text = WBUtils.PutBackDelimiterCharacters(details[0]); EditHeight.Text = WBUtils.PutBackDelimiterCharacters(details[1]); BlockButtonsDetails.Value = WBUtils.PutBackDelimiterCharacters(details[2]); HiddenCSSExtraClass.Value = WBUtils.PutBackDelimiterCharacters(details[3]); HiddenCSSExtraStyles.Value = WBUtils.PutBackDelimiterCharacters(details[4]); } CSSExtraClass = HiddenCSSExtraClass.Value; CSSExtraStyles = HiddenCSSExtraStyles.Value; CreateTable(!IsPostBack); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "UpdatePreivewBlockButtons", "WBF_checkPreviewButtonHeights();", true); }
static void RegisterLoggingService(SPFeatureReceiverProperties properties) { // SPFarm farm = properties.Feature.Parent as SPFarm; SPFarm farm = SPFarm.Local; if (farm != null) { WBLogging service = WBLogging.Local; if (service == null) { service = new WBLogging(); service.Update(); if (service.Status != SPObjectStatus.Online) { service.Provision(); } } } else { WBUtils.logMessage("Farm was null!!"); } }
private void CaptureTable() { // We're also just going to check that the width and height values have 'px' at the end: if (!EditWidth.Text.Contains("px")) { EditWidth.Text = EditWidth.Text + "px"; } if (!EditHeight.Text.Contains("px")) { EditHeight.Text = EditHeight.Text + "px"; } // Table table = (Table)EditBlockButtonsTable.WBxFindNestedControlByID("table-of-button-details"); List <String> blockButtonsDetailsList = new List <String>(); int index = 0; foreach (TableRow row in allRows) { WBLogging.Debug("Looking at row " + index + " and row is currently: " + row); CaptureTableRow(index, row, blockButtonsDetailsList); index++; } BlockButtonsDetails.Value = String.Join("^", blockButtonsDetailsList.ToArray()); }
protected void Page_Load(object sender, EventArgs e) { manager = new WBRecordsManager(SPContext.Current.Web.CurrentUser.LoginName); masterLibraryHasVersions = manager.Libraries.ProtectedMasterLibrary.List.EnableVersioning; if (WorkBox.IsWebAWorkBox(SPContext.Current.Web)) { workBox = new WorkBox(SPContext.Current); team = workBox.OwningTeam; } else { team = WBTeam.GetFromTeamSite(SPContext.Current); } if (!IsPostBack && team != null) { WBQuery query = manager.GetQueryForTeamsPublicRecordsToReview(team); WBLogging.Debug("The query is: " + query.JustCAMLQuery(manager.Libraries.ProtectedMasterLibrary.Site)); SPListItemCollection items = manager.Libraries.ProtectedMasterLibrary.List.WBxGetItems(manager.Libraries.ProtectedMasterLibrary.Site, query); RenderFoundRecords(items); } }
protected void DocumentsForSubject_Sorting(object sender, GridViewSortEventArgs e) { WBLogging.Debug("In DocumentsForSubject_Sorting with e.SortExpression = " + e.SortExpression); SortExpression = e.SortExpression; sortColumn = WBColumn.GetKnownColumnByInternalName(SortExpression); if (GridViewSortDirection == SortDirection.Ascending) { GridViewSortDirection = SortDirection.Descending; ascending = false; WBLogging.Debug("In gridView_Sorting setting to descending"); } else { GridViewSortDirection = SortDirection.Ascending; ascending = true; WBLogging.Debug("In gridView_Sorting setting to ascending"); } // If we're re-sorting the data let's start back on page 0: DocumentsForSubject.PageIndex = 0; RefreshBoundDocumentsList(); }
protected void PublishNextDocument(object sender, EventArgs e) { WBLogging.Debug("Attempting to publishg the next document " + process.CurrentItemID); process = manager.PublishDocument(process); WBLogging.Debug("Published the document"); DocumentPublishingProgress.WBxUpdateTask(process.LastTaskFeedback); PublishingProcessJSON.Text = WBUtils.SerializeToCompressedJSONForURI(process); WBLogging.Debug("Serialized to: " + PublishingProcessJSON.Text); if (process.HasMoreDocumentsToPublish && process.PublishMode == WBPublishingProcess.PUBLISH_MODE__ALL_TOGETHER) { Image image = (Image)DocumentPublishingProgress.WBxFindNestedControlByID(DocumentPublishingProgress.WBxMakeControlID(process.CurrentItemID, "image")); image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TriggerNextStepFunction", "WorkBoxFramework_triggerPublishNextDocument();", true); } else { if (process.HasMoreDocumentsToPublish) { WBLogging.Debug("Trying to set button text to Publish next doc"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Publish Next Document');", true); } else { WBLogging.Debug("Trying to set button text to done"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Done');", true); } } }
protected void publishButton_OnClick(object sender, EventArgs e) { WBLogging.Debug("In publishButton_OnClick()"); Hashtable metadataProblems = CheckMetadataOK(); if (metadataProblems.Count > 0) { PublishingApprovedByError.Text = metadataProblems["PublishingApprovedBy"].WBxToString(); CheckListError.Text = metadataProblems["CheckList"].WBxToString(); WBLogging.Debug("In publishButton_OnClick(): Page render required - not publishing at this point"); ReRenderPage(); } else { List <SPUser> approvedBy = PublishingApprovedBy.WBxGetMultiResolvedUsers(SPContext.Current.Web); process.AddExtraMetadata(WBColumn.PublishingApprovedBy, approvedBy.WBxToString()); process.AddExtraMetadata(WBColumn.PublishingApprovalChecklist, CheckBoxesCodes.Value); WBLogging.Debug("In publishButton_OnClick(): No page render required - so moving to GoToPublishPage"); GoToPublishPage(); } }
private String stripDownDetailsForEditing(String details) { WBLogging.Debug("Stripping down details from: " + details); string[] parts = details.Split(','); String docDetails = WBUtils.PutBackDelimiterCharacters(parts[2]); if (!String.IsNullOrEmpty(docDetails) && docDetails.Contains("|")) { string[] documentDetails = docDetails.Split(';'); List <String> newDocumentDetails = new List <String>(); foreach (String oneDocDetails in documentDetails) { string[] oneDocParts = oneDocDetails.Split('|'); newDocumentDetails.Add(oneDocParts[0] + "|" + oneDocParts[1]); } parts[2] = WBUtils.ReplaceDelimiterCharacters(String.Join(";", newDocumentDetails.ToArray())); } return(String.Join(",", parts)); }
protected void LibraryLocations_TreeNodePopulate(object sender, TreeNodeEventArgs e) { WBLogging.Debug("Call to LibraryLocations_TreeNodePopulate"); String viewMode = process.IsReplaceActionToCreateNewSeries ? "New" : "Replace"; manager.PopulateTreeNode(treeState, e.Node, viewMode); }
protected void selectButton_OnClick(object sender, EventArgs e) { String postBackValue = WBUtils.SerializeToCompressedJSONForURI(process); WBLogging.Debug("About to post back with: " + postBackValue); ReturnJSONFromDialogOK(postBackValue); }
void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { WBLogging.Debug("In gridView_PageIndexChanging - not sure if there's anything that needs to be done!"); gridView.PageIndex = e.NewPageIndex; checkSortState(); }
void DocumentsForSubject_PageIndexChanging(object sender, GridViewPageEventArgs e) { WBLogging.Debug("In DocumentsForSubject_PageIndexChanging - not sure if there's anything that needs to be done!"); DocumentsForSubject.PageIndex = e.NewPageIndex; checkSortState(); RefreshBoundDocumentsList(); }
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; } }
void ShowResults_PageIndexChanging(object sender, GridViewPageEventArgs e) { WBLogging.Debug("In gridView_PageIndexChanging - not sure if there's anything that needs to be done!"); ShowResults.PageIndex = e.NewPageIndex; checkSortState(); RefreshBoundData(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WBRecordsManager manager = new WBRecordsManager(SPContext.Current.Web.CurrentUser.LoginName)) { AllRecordIDsToArchive.Value = Request.QueryString["AllRecordIDsToArchive"]; ReasonToArchiveRecords.Value = Request.QueryString["ReasonToArchiveRecords"]; recordIDs = AllRecordIDsToArchive.Value.Split(','); foreach (String recordID in recordIDs) { WBDocument record = manager.Libraries.ProtectedMasterLibrary.GetDocumentByID(recordID); allFilenamesToArchive.Add(record.Name); } AllRecordFilenamesToArchive.Value = String.Join(",", allFilenamesToArchive.ToArray()); WBLogging.Debug("AllRecordIDsToArchive.Value = " + AllRecordIDsToArchive.Value); WBLogging.Debug("AllRecordFilenamesToArchive.Value = " + AllRecordFilenamesToArchive.Value); indexOfNextRecordToArchive = 0; NextRecordToArchive.Text = "" + indexOfNextRecordToArchive; } } else { indexOfNextRecordToArchive = NextRecordToArchive.Text.WBxToInt(); recordIDs = AllRecordIDsToArchive.Value.Split(','); } WBLogging.Debug("recordIDs.Length = " + recordIDs.Length); if (indexOfNextRecordToArchive < recordIDs.Length) { String[] filenames = AllRecordFilenamesToArchive.Value.Split(','); WBLogging.Debug("filenames.Length = " + filenames.Length); for (int i = 0; i < recordIDs.Length && i < filenames.Length; i++) { mappedFilenames.Add(i.ToString(), filenames[i]); } RecordArchivingProgress.WBxCreateTasksTable(mappedFilenames.Keys, mappedFilenames); Image image = (Image)RecordArchivingProgress.WBxFindNestedControlByID(RecordArchivingProgress.WBxMakeControlID(indexOfNextRecordToArchive.ToString(), "image")); if (image != null) { image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif"; } WBLogging.Debug("Finished"); } }
protected void DoSearch_Click(object sender, EventArgs e) { string strQuery = ""; strQuery = "<OrderBy><FieldRef Name='Title' Ascending='FALSE' /></OrderBy>"; List <string> conditions = new List <string>(); String filter = ""; String searchText = SearchBox.Text; if (searchText != "") { filter = "<Or><Contains><FieldRef Name='BaseName'/><Value Type='Text'>" + searchText + "</Value></Contains><Contains><FieldRef Name='Title'/><Value Type='Text'>" + searchText + "</Value></Contains></Or>"; } if (!String.IsNullOrEmpty(filter)) { strQuery = strQuery + "<Where>" + filter + "</Where>"; } SPList List = manager.Libraries.ProtectedMasterLibrary.List; SPQuery query = new SPQuery(); query.Query = string.Format(strQuery); WBLogging.Debug("The query filter being used: \n" + query.Query); SPFolder protectedLibraryRootFolder = manager.Libraries.ProtectedMasterLibrary.List.RootFolder; /* * WBTerm functionalArea = workBox.OwningTeam.FunctionalArea(workBox.FunctionalAreasTaxonomy)[0]; * * WBLogging.Debug("Looking for folder: \n" + functionalArea.Name); * * SPFolder functionalAreaFolder = protectedLibraryRootFolder.WBxGetFolderPath(functionalArea.Name); * * if (functionalAreaFolder == null) WBLogging.Debug("functionalAreaFolder == null"); * else * { * WBLogging.Debug("Adding folder filter to query of: " + functionalAreaFolder.Name); * // query.Folder = functionalAreaFolder; * } */ SPListItemCollection items = List.GetItems(query); WBLogging.Debug("Found items: " + items.Count); RenderFoundRecords(items); }
protected void MaybeGoToNextPage() { // There should be no reason to call this here now // CaptureChanges(); Hashtable metadataProblems = CheckMetadataOK(); string protectiveZone = ""; if (metadataProblems.Count > 0) { String errorMessage = ErrorMessageLabel.Text; // Have to give these somewhere to be be shown! errorMessage += metadataProblems[WorkBox.COLUMN_NAME__RECORDS_TYPE].WBxToString(); errorMessage += metadataProblems[WorkBox.COLUMN_NAME__FUNCTIONAL_AREA].WBxToString(); errorMessage += metadataProblems[WorkBox.COLUMN_NAME__PROTECTIVE_ZONE].WBxToString(); errorMessage += metadataProblems[WorkBox.COLUMN_NAME__SUBJECT_TAGS].WBxToString(); ErrorMessageLabel.Text = errorMessage; ReferenceIDMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__REFERENCE_ID].WBxToString();; ReferenceDateMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__REFERENCE_DATE].WBxToString();; SeriesTagFieldMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__SERIES_TAG].WBxToString(); ScanDateMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__SCAN_DATE].WBxToString(); OwningTeamFieldMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__OWNING_TEAM].WBxToString(); InvolvedTeamsFieldMessage.Text = metadataProblems[WorkBox.COLUMN_NAME__INVOLVED_TEAMS].WBxToString(); ShortTitleError.Text = metadataProblems[WBColumn.WorkBoxShortTitle.InternalName].WBxToString(); PublishingLocationError.Text = metadataProblems["PublishingLocation"].WBxToString(); pageRenderingRequired = true; } else { pageRenderingRequired = false; } if (pageRenderingRequired) { WBLogging.Debug("In publishButton_OnClick(): Page render required - not publishing at this point"); RenderPage(); } else { WBLogging.Debug("In publishButton_OnClick(): No page render required - so moving to publish"); GoToNextPage(); } }
private void CreateTable() { List <String> documentsDetailsList = new List <String>(); List <String> refreshedDocumentsDetailsList = new List <String>(); string currentDetails = DocumentsDetails.Value.WBxTrim(); WBLogging.Debug("Building the table with current details: " + currentDetails); if (!String.IsNullOrEmpty(currentDetails)) { documentsDetailsList = new List <String>(currentDetails.Split(';')); } numOfDocs = documentsDetailsList.Count; Table table = new Table(); table.Width = Unit.Percentage(100); TableRow headers = new TableRow(); headers.WBxAddTableHeaderCell("Title"); headers.WBxAddTableHeaderCell("Filename"); headers.WBxAddTableHeaderCell("File Type"); // headers.WBxAddTableHeaderCell("Else"); table.Rows.Add(headers); String recordsLibraryURL = WBFWebPartsUtils.GetRecordsLibraryURL(SPContext.Current.Site); using (SPSite site = new SPSite(recordsLibraryURL)) using (SPWeb web = site.OpenWeb()) { SPList library = web.GetList(recordsLibraryURL); int index = 0; foreach (String details in documentsDetailsList) { TableRow row = CreateEditableTableRow(site, web, library, index, details, refreshedDocumentsDetailsList); allRows.Add(row); table.Rows.Add(row); index++; } } EditRelatedDocumentsTable.Controls.Add(table); DocumentsDetails.Value = String.Join(";", refreshedDocumentsDetailsList.ToArray()); }
private void expandByRecordsTypeGUID(TreeNodeCollection nodes, String recordsTypeGUID) { foreach (TreeNode node in nodes) { if (node.Value == recordsTypeGUID) { WBLogging.Debug("Found the node to expand: " + node.Text); expandNodeAndParents(node); return; } expandByRecordsTypeGUID(node.ChildNodes, recordsTypeGUID); } }
static void UnRegisterLoggingService(SPFeatureReceiverProperties properties) { SPFarm farm = SPFarm.Local; if (farm != null) { WBLogging service = WBLogging.Local; if (service != null) { service.Delete(); } } }
private void CreateTable(bool setValues) { List <String> blockButtonsDetailsList = new List <String>(); string currentDetails = BlockButtonsDetails.Value.WBxTrim(); WBLogging.Debug("Building the table with current details: " + currentDetails); if (!String.IsNullOrEmpty(currentDetails)) { blockButtonsDetailsList = new List <String>(currentDetails.Split('^')); } NumberOfButtons = blockButtonsDetailsList.Count; Table table = new Table(); table.ID = "table-of-button-details"; //table.Width = Unit.Percentage(100); TableRow headers = new TableRow(); headers.WBxAddTableHeaderCell("Title"); headers.WBxAddTableHeaderCell("Link"); headers.WBxAddTableHeaderCell("Extra Text"); headers.WBxAddTableHeaderCell("Fill"); headers.WBxAddTableHeaderCell(""); headers.WBxAddTableHeaderCell("Outline"); headers.WBxAddTableHeaderCell(""); headers.WBxAddTableHeaderCell("Text"); table.Rows.Add(headers); int index = 0; foreach (String details in blockButtonsDetailsList) { TableRow row = CreateEditableTableRow(index, blockButtonsDetailsList.Count, details, setValues); allRows.Add(row); table.Rows.Add(row); index++; } EditBlockButtonsTable.Controls.Add(table); CreatePreview(); }
protected void KeepNextDocument(object sender, EventArgs e) { WBLogging.Debug("Attempting to keep the next document with index: " + indexOfNextRecordToKeep + " and filename: " + mappedFilenames[indexOfNextRecordToKeep.ToString()]); String callingUserLogin = SPContext.Current.Web.CurrentUser.LoginName; WBTaskFeedback feedback = new WBTaskFeedback(indexOfNextRecordToKeep.ToString()); try { SPSecurity.RunWithElevatedPrivileges(delegate() { using (WBRecordsManager elevatedManager = new WBRecordsManager(callingUserLogin)) { WBRecord record = elevatedManager.Libraries.GetRecordByID(recordIDs[indexOfNextRecordToKeep]); record[WBColumn.ReviewDate] = DateTime.Now.AddYears(2); record.Update(callingUserLogin, ReasonToKeepRecords.Value); feedback.Success("Kept successfully"); } }); } catch (Exception exception) { feedback.Failed("Keeping failed", exception); } WBLogging.Debug("Kept the document"); RecordKeepingProgress.WBxUpdateTask(feedback); indexOfNextRecordToKeep++; NextRecordToKeep.Text = "" + indexOfNextRecordToKeep; if (indexOfNextRecordToKeep < recordIDs.Length) { Image image = (Image)RecordKeepingProgress.WBxFindNestedControlByID(RecordKeepingProgress.WBxMakeControlID(indexOfNextRecordToKeep.ToString(), "image")); image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif"; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "TriggerNextStepFunction", "WorkBoxFramework_triggerKeepNextDocument();", true); } else { WBLogging.Debug("Trying to set button text to done"); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangeDoneButtonTextFunction", "WorkBoxFramework_finishedProcessing('Done');", true); } }
protected void updatePanelWithTeamDetails(WBTeam team) { TeamName.Text = team.Name; TeamGUID.Text = team.Id.ToString(); TeamAcronym.Text = team.Acronym; UseAllFunctionalAreas.Checked = team.UseAllFunctionalAreas; TeamFunctionalAreas.Text = team.FunctionalAreaUIControlValue; if (TeamFunctionalAreas.Text == "") { InheritedFunctionalAreas.Text = team.FunctionalArea(functionalAreas).Names(); } else { InheritedFunctionalAreas.Text = ""; } TeamsSiteURL.Text = team.TeamSiteUrl; TeamsSiteGUID.Text = team.TeamSiteGuidString; WBLogging.Debug("In TeamManagement.updatePanelWithTeamDetails(): OwnersGroupName = " + team.OwnersGroupName); WBLogging.Debug("In TeamManagement.updatePanelWithTeamDetails(): MembersGroupName = " + team.MembersGroupName); InformationAssetOwner.WBxInitialise(team.InformationAssetOwner(SPContext.Current.Web)); TeamManager.WBxInitialise(team.Manager(SPContext.Current.Web)); //TeamOwnersSharePointUserGroup.CommaSeparatedAccounts = ""; //TeamOwnersSharePointUserGroup.ResolvedEntities.Clear(); //TeamOwnersSharePointUserGroup.Entities.Clear(); TeamOwnersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.OwnersGroupName)); //TeamMembersSharePointUserGroup.CommaSeparatedAccounts = ""; //TeamMembersSharePointUserGroup.ResolvedEntities.Clear(); //TeamMembersSharePointUserGroup.Entities.Clear(); TeamMembersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.MembersGroupName)); //TeamPublishersSharePointUserGroup.CommaSeparatedAccounts = ""; TeamPublishersSharePointUserGroup.UpdateEntities(WBUtils.CreateEntitiesArrayList(team.PublishersGroupName)); RecordsTypesListUrl.Text = team.RecordsTypesListUrl; CommonActivitiesListUrl.Text = team.CommonActivitiesListUrl; FunctionalActivitiesListUrl.Text = team.FunctionalActivitiesListUrl; }
protected void CaptureChanges() { if (NewRadioButton.Checked) { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__CREATE_NEW_SERIES; } else { if (LeaveOnIzziCheckBox.Checked) { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__LEAVE_ON_IZZI; } else { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__ARCHIVE_FROM_IZZI; } } if (EditShortTitle.Text != ShortTitle.Text) { process.CurrentShortTitle = EditShortTitle.Text; } process.SubjectTagsUIControlValue = SubjectTagsField.Text; WBLogging.Debug("Captured subject tags to be: " + SubjectTagsField.Text); if (process.OwningTeamUIControlValue != OwningTeamField.Text) { // OK so the owning team has changed we need to change the owning team and the associated IAO: process.OwningTeamUIControlValue = OwningTeamField.Text; WBTeam owningTeam = new WBTeam(process.TeamsTaxonomy, process.OwningTeamUIControlValue); process.OwningTeamsIAOAtTimeOfPublishing = owningTeam.InformationAssetOwnerLogin; process.AddExtraMetadata(WBColumn.IAOAtTimeOfPublishing, process.OwningTeamsIAOAtTimeOfPublishing); } process.InvolvedTeamsWithoutOwningTeamAsUIControlValue = InvolvedTeamsField.Text; process.WebPageURL = WebPageURL.Text; if (!String.IsNullOrEmpty(process.WebPageURL)) { process.AddExtraMetadata(WBColumn.IntendedWebPageURL, process.WebPageURL); } }
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"; } } }
protected void Page_Load(object sender, EventArgs e) { manager = new WBRecordsManager(SPContext.Current.Web.CurrentUser.LoginName); if (!IsPostBack) { process = WBUtils.DeserializeFromCompressedJSONInURI <WBPublishingProcess>(Request.QueryString["PublishingProcessJSON"]); process.WorkBox = WorkBox; WBLogging.Debug("Created the WBProcessObject"); PublishingProcessJSON.Text = WBUtils.SerializeToCompressedJSONForURI(process); WBLogging.Debug("Serialized the WBProcessObject to hidden field"); } else { WBLogging.Debug("About to deserialise: " + PublishingProcessJSON.Text); process = WBUtils.DeserializeFromCompressedJSONInURI <WBPublishingProcess>(PublishingProcessJSON.Text); process.WorkBox = WorkBox; } if (process.HasMoreDocumentsToPublish) { if (process.PublishMode == WBPublishingProcess.PUBLISH_MODE__ALL_TOGETHER) { DocumentPublishingProgress.WBxCreateTasksTable(process.ItemIDs, process.MappedFilenames); } else { List <String> oneItem = new List <String>(); oneItem.Add(process.CurrentItemID); Dictionary <String, String> oneMapping = new Dictionary <String, String>(); oneMapping.Add(process.CurrentItemID, process.CurrentItem.Name); DocumentPublishingProgress.WBxCreateTasksTable(oneItem, oneMapping); } Image image = (Image)DocumentPublishingProgress.WBxFindNestedControlByID(DocumentPublishingProgress.WBxMakeControlID(process.CurrentItemID, "image")); image.ImageUrl = "/_layouts/images/WorkBoxFramework/processing-task-32.gif"; } }