/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Start with the default label on the menu string label = "Page Turner"; // Allow the label to be implemented for this viewer BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { label = thisViewerInfo.Label; } // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Allow the label to be implemented for this viewer BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is null, or no label, use the default if ((thisViewerInfo == null) || (String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { // Add the item menu information using the default label Item_MenuItem menuItem = new Item_MenuItem("Video", null, null, url, ViewerCode); MenuItems.Add(menuItem); } else { // Add the item menu information using the custom level Item_MenuItem menuItem = new Item_MenuItem(thisViewerInfo.Label, null, null, url, ViewerCode); MenuItems.Add(menuItem); } }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Try to get the TEI file name string tei_file = CurrentItem.Behaviors.Get_Setting("TEI.Source_File"); if (tei_file == null) { // Ensure the TEI file really exists return; } // Ensure the TEI file really exists if (!SobekFileSystem.FileExists(CurrentItem, tei_file)) { return; } // Look for the label in the METS structure map string first_label = "TEI"; if (CurrentItem.Downloads != null) { foreach (BriefItem_FileGrouping thisPage in CurrentItem.Downloads) { // Look for a flash file on each page foreach (BriefItem_File thisFile in thisPage.Files) { if (String.Compare(thisFile.Name, tei_file, StringComparison.OrdinalIgnoreCase) == 0) { first_label = thisPage.Label.Replace(".xml", "").Replace(".XML", ""); break; } } } } // Allow the label to be implemented for this viewer from the database as well BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { first_label = thisViewerInfo.Label; } // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(first_label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Determine the label to show on the menu string label = "Map It!"; if (!String.IsNullOrEmpty(CurrentRequest.Coordinates)) { if (CurrentRequest.ViewerCode == "mapsearch") { label = "Map Search"; } else { if (((CurrentItem.Images != null) && (CurrentItem.Images.Count > 1)) || (String.Compare(CurrentItem.Type, "map", StringComparison.OrdinalIgnoreCase) != 0)) { label = "Search Results"; } else { label = "Map Coverage"; } } } // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Allow the label to be implemented for this viewer from the database as an override BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { label = thisViewerInfo.Label; } // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Get the label string first_label = "FLASH"; foreach (BriefItem_FileGrouping thisPage in CurrentItem.Downloads) { // Look for a flash file on each page foreach (BriefItem_File thisFile in thisPage.Files) { if (String.Compare(thisFile.File_Extension, ".SWF", StringComparison.OrdinalIgnoreCase) == 0) { first_label = thisPage.Label; break; } } } // Allow the label to be implemented for this viewer from the database as well BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { first_label = thisViewerInfo.Label; } // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(first_label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }
/// <summary> Gets the menu items related to this viewer that should be included on the main item (digital resource) menu </summary> /// <param name="CurrentItem"> Digital resource object, which can be used to ensure if and how this viewer should appear /// in the main item (digital resource) menu </param> /// <param name="CurrentUser"> Current user, who may or may not be logged on </param> /// <param name="CurrentRequest"> Information about the current request </param> /// <param name="MenuItems"> List of menu items, to which this method may add one or more menu items </param> /// <param name="IpRestricted"> Flag indicates if this item is IP restricted AND if the current user is outside the ranges </param> public void Add_Menu_items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted) { // Start with an empty label string first_label = String.Empty; // First, look at the viewer information from the database BriefItem_BehaviorViewer thisViewer = CurrentItem.Behaviors.Get_Viewer("HTML"); if (!String.IsNullOrWhiteSpace(thisViewer.Label)) { first_label = thisViewer.Label; } // Next, look for a page name in the METS if (String.IsNullOrEmpty(first_label)) { foreach (BriefItem_FileGrouping thisPage in CurrentItem.Downloads) { // Look for a HTML file on each page foreach (BriefItem_File thisFile in thisPage.Files) { if (thisFile.File_Extension.IndexOf(".HTM", StringComparison.OrdinalIgnoreCase) == 0) { if (!String.IsNullOrWhiteSpace(thisPage.Label)) { first_label = thisPage.Label; } break; } } } } // Finally, just default to HTML otherwise if (String.IsNullOrEmpty(first_label)) { first_label = "HTML"; } // Get the URL for this string previous_code = CurrentRequest.ViewerCode; CurrentRequest.ViewerCode = ViewerCode; string url = UrlWriterHelper.Redirect_URL(CurrentRequest); CurrentRequest.ViewerCode = previous_code; // Allow the label to be implemented for this viewer from the database as well BriefItem_BehaviorViewer thisViewerInfo = CurrentItem.Behaviors.Get_Viewer(ViewerCode); // If this is found, and has a custom label, use that if ((thisViewerInfo != null) && (!String.IsNullOrWhiteSpace(thisViewerInfo.Label))) { first_label = thisViewerInfo.Label; } // Add the item menu information Item_MenuItem menuItem = new Item_MenuItem(first_label, null, null, url, ViewerCode); MenuItems.Add(menuItem); }