protected void Page_Load(object sender, EventArgs e) { manager = new WBRecordsManager(SPContext.Current.Web.CurrentUser.LoginName); if (WorkBox.IsWebAWorkBox(SPContext.Current.Web)) { workBox = new WorkBox(SPContext.Current); team = workBox.OwningTeam; functionalAreasTaxonomy = workBox.FunctionalAreasTaxonomy; } else { team = WBTeam.GetFromTeamSite(SPContext.Current); if (team != null) { teamsTaxonomy = team.Taxonomy; functionalAreasTaxonomy = WBTaxonomy.GetFunctionalAreas(teamsTaxonomy); } } if (team == null) { WBLogging.Debug("Couldn't find a suitable team !!"); return; } masterLibraryHasVersions = manager.Libraries.ProtectedMasterLibrary.List.EnableVersioning; RecordsLibraryFolders.TreeNodePopulate += new TreeNodeEventHandler(RecordsLibraryFolders_TreeNodePopulate); // RecordsLibraryFolders.SelectedNodeChanged += new EventHandler(RecordsLibraryFolders_SelectedNodeChanged); RecordsLibraryFolders.PopulateNodesFromClient = true; RecordsLibraryFolders.EnableClientScript = true; treeState = new WBLocationTreeState(SPContext.Current.Web, WBRecordsManager.VIEW_MODE__BROWSE_FOLDERS, WBRecordsType.PROTECTIVE_ZONE__PUBLIC); if (!IsPostBack) { WBTermCollection <WBTerm> functionalAreas = team.FunctionalArea(functionalAreasTaxonomy); ViewState["SortColumn"] = WBColumn.DatePublished.InternalName; ViewState["SortDirection"] = "Descending"; /* * TreeViewLocationCollection collection = new TreeViewLocationCollection(manager, , "", functionalAreas); * * RecordsLibraryFolders.DataSource = collection; * RecordsLibraryFolders.DataBind(); */ manager.PopulateWithFunctionalAreas(treeState, RecordsLibraryFolders.Nodes, WBRecordsManager.VIEW_MODE__BROWSE_FOLDERS, functionalAreas); } else { SetSelectedPath(); if (!String.IsNullOrEmpty(selectedPath)) { ProcessSelection(selectedPath); } } }
protected void Page_Load(object sender, EventArgs e) { WBLogging.Debug("In Page_Load"); WBLogging.Debug("EventArgs type: " + e.GetType().Name); WBLogging.Debug("Request[\"__EVENTARGUMENT\"] = " + Request["__EVENTARGUMENT"]); 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"); newOrReplace = Request.QueryString["NewOrReplace"]; archiveOrLeave = Request.QueryString["ArchiveOrLeave"]; if (newOrReplace == "New") { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__CREATE_NEW_SERIES; } else { if (archiveOrLeave == "Archive") { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__ARCHIVE_FROM_IZZI; } else { process.ReplaceAction = WBPublishingProcess.REPLACE_ACTION__LEAVE_ON_IZZI; } } WBLogging.Debug("Captured replace action as: " + process.ReplaceAction); PublishingProcessJSON.Value = WBUtils.SerializeToCompressedJSONForURI(process); WBLogging.Debug("Serialized the WBProcessObject to hidden field"); SelectedFolderPath.Text = "/"; } else { process = WBUtils.DeserializeFromCompressedJSONInURI <WBPublishingProcess>(PublishingProcessJSON.Value); process.WorkBox = WorkBox; } LibraryLocations.TreeNodePopulate += new TreeNodeEventHandler(LibraryLocations_TreeNodePopulate); //LibraryLocations.SelectedNodeChanged += new EventHandler(LibraryLocations_SelectedNodeChanged); LibraryLocations.PopulateNodesFromClient = true; LibraryLocations.EnableClientScript = true; String viewMode = process.IsReplaceActionToCreateNewSeries ? "New" : "Replace"; treeState = new WBLocationTreeState(SPContext.Current.Web, viewMode, process.ProtectiveZone); if (!IsPostBack) { if (viewMode == "New") { Description.Text = "Select the folder into which to publish the document"; } else { Description.Text = "Select the document to replace"; } WBTermCollection <WBTerm> teamFunctionalAreas = WorkBox.OwningTeam.FunctionalArea(manager.FunctionalAreasTaxonomy); manager.PopulateWithFunctionalAreas(treeState, LibraryLocations.Nodes, viewMode, teamFunctionalAreas); } else { String selectedPath = manager.GetSelectedPath(Request); if (!String.IsNullOrEmpty(selectedPath)) { ProcessSelection(selectedPath); } } }