本文整理汇总了C#中SobekCM.Core.Navigation.Navigation_Object类的典型用法代码示例。如果您正苦于以下问题:C# Navigation_Object类的具体用法?C# Navigation_Object怎么用?C# Navigation_Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Navigation_Object类属于SobekCM.Core.Navigation命名空间,在下文中一共展示了Navigation_Object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ManageMenu_ItemViewer
/// <summary> Constructor for a new instance of the ManageMenu_ItemViewer class </summary>
/// <param name="Current_Object"> Digital resource to display </param>
/// <param name="Current_User"> Current user for this session </param>
/// <param name="Current_Mode"> Navigation object which encapsulates the user's current request </param>
public ManageMenu_ItemViewer(SobekCM_Item Current_Object, User_Object Current_User, Navigation_Object Current_Mode)
{
// Save the current user and current mode information (this is usually populated AFTER the constructor completes,
// but in this case (QC viewer) we need the information for early processing
CurrentMode = Current_Mode;
CurrentUser = Current_User;
CurrentItem = Current_Object;
// Determine if this user can edit this item
if (CurrentUser == null)
{
Current_Mode.ViewerCode = String.Empty;
UrlWriterHelper.Redirect(Current_Mode);
return;
}
else
{
bool userCanEditItem = CurrentUser.Can_Edit_This_Item( CurrentItem.BibID, CurrentItem.Bib_Info.SobekCM_Type_String, CurrentItem.Bib_Info.Source.Code, CurrentItem.Bib_Info.HoldingCode, CurrentItem.Behaviors.Aggregation_Code_List );
if (!userCanEditItem)
{
Current_Mode.ViewerCode = String.Empty;
UrlWriterHelper.Redirect(Current_Mode);
return;
}
}
}
示例2: Static_Pages_Builder
/// <summary> Constructor for a new instance of the Static_Pages_Builder class </summary>
/// <param name="Primary_Web_Server_URL"> URL for the primary web server </param>
/// <param name="Static_Data_Location"> Network location for the data directory </param>
/// <param name="Default_Skin"> Default skin code </param>
public Static_Pages_Builder(string Primary_Web_Server_URL, string Static_Data_Location, string Default_Skin)
{
primaryWebServerUrl = Primary_Web_Server_URL;
staticSobekcmDataLocation = Static_Data_Location;
staticSobekcmLocation = UI_ApplicationCache_Gateway.Settings.Servers.Application_Server_Network;
tracer = new Custom_Tracer();
assistant = new SobekCM_Assistant();
// Save all the objects needed by the SobekCM Library
defaultSkin = Default_Skin;
// Create the mode object
currentMode = new Navigation_Object
{
ViewerCode = "citation",
Skin = String.Empty,
Mode = Display_Mode_Enum.Item_Display,
Language = Web_Language_Enum.English,
Base_URL = primaryWebServerUrl
};
// Set some constant settings
// SobekCM.Library.UI_ApplicationCache_Gateway.Settings.Watermarks_URL = primary_web_server_url + "/design/wordmarks/";
UI_ApplicationCache_Gateway.Settings.Base_SobekCM_Location_Relative = primaryWebServerUrl;
// Ensure all the folders exist
if (!Directory.Exists(staticSobekcmDataLocation))
Directory.CreateDirectory(staticSobekcmDataLocation);
if (!Directory.Exists(staticSobekcmDataLocation + "\\rss"))
Directory.CreateDirectory(staticSobekcmDataLocation + "\\rss");
}
示例3: TEI_ItemViewer
/// <summary> Constructor for a new instance of the TEI_ItemViewer class, used to display a
/// TEI file for a given digital resource </summary>
/// <param name="BriefItem"> Digital resource object </param>
/// <param name="CurrentUser"> Current user, who may or may not be logged on </param>
/// <param name="CurrentRequest"> Information about the current request </param>
public TEI_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest)
{
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties to the empy behaviors ( in the base class )
Behaviors = EmptyBehaviors;
// Get the TEI files to use
tei_file = BriefItem.Behaviors.Get_Setting("TEI.Source_File");
xslt_file = BriefItem.Behaviors.Get_Setting("TEI.XSLT");
css_file = BriefItem.Behaviors.Get_Setting("TEI.CSS");
// Ensure the XSLT file really exists
if (!File.Exists(xslt_file))
{
// This may just not have the path on it
if ((xslt_file.IndexOf("/") < 0) && (xslt_file.IndexOf("\\") < 0))
{
xslt_file = Path.Combine(UI_ApplicationCache_Gateway.Settings.Servers.Application_Server_Network, "plugins\\tei\\xslt", xslt_file);
}
}
string tei_file_network = SobekFileSystem.Resource_Network_Uri(BriefItem, tei_file);
XSLT_Transformer_ReturnArgs returnArgs = XSLT_Transformer.Transform(tei_file_network, xslt_file);
tei_string_to_display = String.Empty;
if (returnArgs.Successful)
{
tei_string_to_display = returnArgs.TransformedString;
// FInd the head information
int head_start = tei_string_to_display.IndexOf("<head", StringComparison.OrdinalIgnoreCase);
int head_end = tei_string_to_display.IndexOf("</head>", StringComparison.OrdinalIgnoreCase);
if ((head_start > 0) && (head_end > 0))
{
head_info = tei_string_to_display.Substring(head_start, head_end - head_start);
int end_bracket = head_info.IndexOf(">");
head_info = head_info.Substring(end_bracket + 1);
}
// Trim down to the body
int body_start = tei_string_to_display.IndexOf("<body", StringComparison.OrdinalIgnoreCase);
int body_end = tei_string_to_display.IndexOf("</body>", StringComparison.OrdinalIgnoreCase);
if ((body_start > 0) && (body_end > 0))
{
tei_string_to_display = tei_string_to_display.Substring(body_start, body_end - body_start);
int end_bracket = tei_string_to_display.IndexOf(">");
tei_string_to_display = tei_string_to_display.Substring(end_bracket + 1);
}
}
else
{
tei_string_to_display = "Error during XSLT transform of TEI<br /><br />" + returnArgs.ErrorMessage;
}
}
示例4: Text_Search_ItemViewer
/// <summary> Constructor for a new instance of the Text_Search_ItemViewer class, which allows the full text of an
/// individual resource to be searched and individual matching pages are displayed with page thumbnails </summary>
/// <param name="BriefItem"> Digital resource object </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="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public Text_Search_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer )
{
Tracer.Add_Trace("Text_Search_ItemViewer.Constructor");
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties to the empy behaviors ( in the base class )
Behaviors = EmptyBehaviors;
if (!String.IsNullOrWhiteSpace(CurrentRequest.Text_Search))
{
List<string> terms = new List<string>();
List<string> web_fields = new List<string>();
// Split the terms correctly
SobekCM_Assistant.Split_Clean_Search_Terms_Fields(CurrentRequest.Text_Search, "ZZ", Search_Type_Enum.Basic, terms, web_fields, null, Search_Precision_Type_Enum.Contains, '|');
Tracer.Add_Trace("Text_Search_ItemViewer.Constructor", "Performing Solr/Lucene search");
int page = CurrentRequest.SubPage.HasValue ? Math.Max(CurrentRequest.SubPage.Value, ((ushort)1)) : 1;
results = Solr_Page_Results.Search(BriefItem.BibID, BriefItem.VID, terms, 20, page, false);
Tracer.Add_Trace("Text_Search_ItemViewer.Constructor", "Completed Solr/Lucene search in " + results.QueryTime + "ms");
}
}
示例5: RequestCache
/// <summary> Constructor for a new instance of the RequestCache class </summary>
/// <param name="Current_Mode"> Mode / navigation information for the current request</param>
/// <param name="Hierarchy_Object"> Current item aggregation object to display </param>
/// <param name="Results_Statistics"> Information about the entire set of results for a search or browse </param>
/// <param name="Paged_Results"> Single page of results for a search or browse, within the entire set </param>
/// <param name="Browse_Object"> Object contains all the basic information about any browse or info display </param>
/// <param name="Current_Item"> Current item to display </param>
/// <param name="Current_Page"> Current page within the item</param>
/// <param name="HTML_Skin"> HTML Web skin which controls the overall appearance of this digital library </param>
/// <param name="Current_User"> Currently logged on user </param>
/// <param name="Public_Folder"> Object contains the information about the public folder to display </param>
/// <param name="Site_Map"> Optional site map object used to render a navigational tree-view on left side of static web content pages </param>
/// <param name="Items_In_Title"> List of items within the current title ( used for the Item Group display )</param>
/// <param name="Static_Web_Content"> HTML content-based browse, info, or imple CMS-style web content objects. These are objects which are read from a static HTML file and much of the head information must be maintained </param>
/// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public RequestCache(Navigation_Object Current_Mode,
Item_Aggregation Hierarchy_Object,
Search_Results_Statistics Results_Statistics,
List<iSearch_Title_Result> Paged_Results,
Item_Aggregation_Child_Page Browse_Object,
SobekCM_Item Current_Item,
Page_TreeNode Current_Page,
Web_Skin_Object HTML_Skin,
User_Object Current_User,
Public_User_Folder Public_Folder,
SobekCM_SiteMap Site_Map,
SobekCM_Items_In_Title Items_In_Title,
HTML_Based_Content Static_Web_Content,
Custom_Tracer Tracer)
{
this.Current_Mode = Current_Mode;
this.Hierarchy_Object = Hierarchy_Object;
this.Results_Statistics = Results_Statistics;
this.Paged_Results = Paged_Results;
this.Browse_Object = Browse_Object;
this.Current_Item = Current_Item;
this.Current_Page = Current_Page;
this.HTML_Skin = HTML_Skin;
this.Current_User = Current_User;
this.Public_Folder = Public_Folder;
this.Site_Map = Site_Map;
this.Items_In_Title = Items_In_Title;
this.Static_Web_Content = Static_Web_Content;
this.Tracer = Tracer;
}
示例6: JPEG_ItemViewer
/// <summary> Constructor for a new instance of the JPEG_ItemViewer class, used to display JPEGs linked to
/// pages in a digital resource </summary>
/// <param name="BriefItem"> Digital resource object </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="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
/// <param name="JPEG_ViewerCode"> JPEG viewer code, as determined by configuration files </param>
/// <param name="FileExtensions"> File extensions that this viewer allows, as determined by configuration files </param>
public JPEG_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer, string JPEG_ViewerCode, string[] FileExtensions)
{
// Add the trace
if ( Tracer != null )
Tracer.Add_Trace("JPEG_ItemViewer.Constructor");
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties
Behaviors = EmptyBehaviors;
// Is the JPEG2000 viewer included in this item?
bool zoomableViewerIncluded = BriefItem.UI.Includes_Viewer_Type("JPEG2000");
string[] jpeg2000_extensions = null;
if (zoomableViewerIncluded)
{
iItemViewerPrototyper jp2Prototyper = ItemViewer_Factory.Get_Viewer_By_ViewType("JPEG2000");
if (jp2Prototyper == null)
zoomableViewerIncluded = false;
else
{
zoomableViewerCode = jp2Prototyper.ViewerCode;
jpeg2000_extensions = jp2Prototyper.FileExtensions;
}
}
// Set some default values
width = 500;
height = -1;
includeLinkToZoomable = false;
// Determine the page
page = 1;
if (!String.IsNullOrEmpty(CurrentRequest.ViewerCode))
{
int tempPageParse;
if (Int32.TryParse(CurrentRequest.ViewerCode.Replace(JPEG_ViewerCode.Replace("#",""), ""), out tempPageParse))
page = tempPageParse;
}
// Just a quick range check
if (page > BriefItem.Images.Count)
page = 1;
// Try to set the file information here
if ((!set_file_information(FileExtensions, zoomableViewerIncluded, jpeg2000_extensions)) && (page != 1))
{
// If there was an error, just set to the first page
page = 1;
set_file_information(FileExtensions, zoomableViewerIncluded, jpeg2000_extensions);
}
// Since this is a paging viewer, set the viewer code
if (String.IsNullOrEmpty(CurrentRequest.ViewerCode))
CurrentRequest.ViewerCode = JPEG_ViewerCode.Replace("#", page.ToString());
}
示例7: TrackingSheet_ItemViewer
/// <summary> Constructor for the Tracking Sheet ItemViewer </summary>
/// <param name="Current_Object"></param>
/// <param name="Current_User"></param>
/// <param name="Current_Mode"></param>
public TrackingSheet_ItemViewer(SobekCM_Item Current_Object, User_Object Current_User, Navigation_Object Current_Mode)
{
CurrentMode = Current_Mode;
CurrentUser = Current_User;
//Assign the current resource object to track_item
track_item = Current_Object;
//Get the ItemID for this Item from the database
itemID = track_item.Web.ItemID;
//Get aggregation info
aggregations = track_item.Behaviors.Aggregation_Codes;
//If no aggregationPermissions present, display "none"
aggregations = aggregations.Length>0 ? aggregations.ToUpper() : "(none)";
aggregations = aggregations.Replace(";", "; ");
//Determine the OCLC & Aleph number for display
oclc = track_item.Bib_Info.OCLC_Record;
aleph = track_item.Bib_Info.ALEPH_Record;
if (String.IsNullOrEmpty(oclc) || oclc.Trim() == "0" || oclc.Trim() == "1")
oclc = "(none)";
if (String.IsNullOrEmpty(aleph) || aleph.Trim() == "0" || aleph.Trim() == "1")
aleph = "(none)";
//Determine the author(s) for display
authors_list = new List<string>();
int author_startCount = 0;
//Add the main entity first
if (track_item.Bib_Info.hasMainEntityName)
{
authors_list.Add(track_item.Bib_Info.Main_Entity_Name.Full_Name + track_item.Bib_Info.Main_Entity_Name.Role_String);
author_startCount++;
}
//Now add all other associated creators
for (int i = author_startCount; i < track_item.Bib_Info.Names_Count; i++)
{
//Skip any publishers in this list
if(track_item.Bib_Info.Names[i].Role_String.ToUpper().Contains("PUBLISHER"))
continue;
authors_list.Add(track_item.Bib_Info.Names[i].Full_Name + track_item.Bib_Info.Names[i].Role_String);
}
//Determine the publisher(s) for display
publishers_list=new string[track_item.Bib_Info.Publishers_Count];
for (int i = 0; i < track_item.Bib_Info.Publishers_Count; i++)
publishers_list[i] = track_item.Bib_Info.Publishers[i].Name;
//Create the temporary location for saving the barcode images
image_location = UI_ApplicationCache_Gateway.Settings.Servers.Base_Temporary_Directory + "tsBarcodes\\" + itemID.ToString();
// Create the folder for the user in the temp directory
if (!Directory.Exists(image_location))
Directory.CreateDirectory(image_location);
}
示例8: PDF_ItemViewer
/// <summary> Constructor for a new instance of the PDF_ItemViewer class </summary>
/// <param name="FileName"> Name of the PDF file to display </param>
/// <param name="Current_Mode"> Current navigation information for this request </param>
public PDF_ItemViewer(string FileName, Navigation_Object Current_Mode)
{
// Determine if this should be written as an iFrame
writeAsIframe = ((!String.IsNullOrEmpty(Current_Mode.Browser_Type)) && (Current_Mode.Browser_Type.IndexOf("CHROME") == 0));
// Save the filename
this.FileName = FileName;
}
示例9: Redirect
/// <summary> Redirect the user to the current mode's URL </summary>
/// <param name="Current_Mode"> Current navigation object which contains the information </param>
/// <param name="Flush_Response"> Flag indicates if the response should be flushed</param>
/// <remarks> This does not stop execution immediately (which would raise a ThreadAbortedException
/// and be costly in terms of performance) but it does set the
/// Request_Completed flag, which should be checked and will effectively stop any
/// further actions. </remarks>
public static void Redirect(Navigation_Object Current_Mode, bool Flush_Response)
{
if (Flush_Response)
HttpContext.Current.Response.Flush();
Current_Mode.Request_Completed = true;
HttpContext.Current.Response.Redirect(Redirect_URL(Current_Mode), false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
示例10: Google_Coordinate_Entry_ItemViewer
/// <summary> init viewer instance </summary>
public Google_Coordinate_Entry_ItemViewer(User_Object Current_User, SobekCM_Item Current_Item, Navigation_Object Current_Mode)
{
try
{
currentUser = Current_User;
currentItem = Current_Item;
CurrentMode = Current_Mode;
//string resource_directory = UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network + CurrentItem.Web.AssocFilePath;
//string current_mets = resource_directory + CurrentItem.METS_Header.ObjectID + ".mets.xml";
// If there is no user, send to the login
if (currentUser == null)
{
CurrentMode.Mode = Display_Mode_Enum.My_Sobek;
CurrentMode.My_Sobek_Type = My_Sobek_Type_Enum.Logon;
CurrentMode.Return_URL = Current_Item.BibID + "/" + Current_Item.VID + "/mapedit";
UrlWriterHelper.Redirect(CurrentMode);
return;
}
//holds actions from page
string action = HttpContext.Current.Request.Form["action"] ?? String.Empty;
string payload = HttpContext.Current.Request.Form["payload"] ?? String.Empty;
// See if there were hidden requests
if (!String.IsNullOrEmpty(action))
{
if ( action == "save")
SaveContent(payload);
}
////create a backup of the mets
//string backup_directory = UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network + Current_Item.Web.AssocFilePath + UI_ApplicationCache_Gateway.Settings.Resources.Backup_Files_Folder_Name;
//string backup_mets_name = backup_directory + "\\" + CurrentItem.METS_Header.ObjectID + "_" + DateTime.Now.Year + "_" + DateTime.Now.Month + "_" + DateTime.Now.Day + ".mets.bak";
//File.Copy(current_mets, backup_mets_name);
}
catch (Exception ee)
{
//Custom_Tracer.Add_Trace("MapEdit Start Failure");
throw new ApplicationException("MapEdit Start Failure\r\n" + ee.Message);
}
// Create the options dictionary used when saving information to the database, or writing MarcXML
options = new Dictionary<string, object>();
if (UI_ApplicationCache_Gateway.Settings.MarcGeneration != null)
{
options["MarcXML_File_ReaderWriter:MARC Cataloging Source Code"] = UI_ApplicationCache_Gateway.Settings.MarcGeneration.Cataloging_Source_Code;
options["MarcXML_File_ReaderWriter:MARC Location Code"] = UI_ApplicationCache_Gateway.Settings.MarcGeneration.Location_Code;
options["MarcXML_File_ReaderWriter:MARC Reproduction Agency"] = UI_ApplicationCache_Gateway.Settings.MarcGeneration.Reproduction_Agency;
options["MarcXML_File_ReaderWriter:MARC Reproduction Place"] = UI_ApplicationCache_Gateway.Settings.MarcGeneration.Reproduction_Place;
options["MarcXML_File_ReaderWriter:MARC XSLT File"] = UI_ApplicationCache_Gateway.Settings.MarcGeneration.XSLT_File;
}
options["MarcXML_File_ReaderWriter:System Name"] = UI_ApplicationCache_Gateway.Settings.System.System_Name;
options["MarcXML_File_ReaderWriter:System Abbreviation"] = UI_ApplicationCache_Gateway.Settings.System.System_Abbreviation;
}
示例11: Google_Coordinate_Entry_ItemViewer
/// <summary> Constructor for a new instance of the Google_Coordinate_Entry_ItemViewer class, used to edit the
/// coordinate information associated with this digital resource within an online google maps interface </summary>
/// <param name="BriefItem"> Digital resource object </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="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public Google_Coordinate_Entry_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer )
{
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
try
{
// Get the full SobekCM item
Tracer.Add_Trace("Google_Coordinate_Entry_ItemViewer.Constructor", "Try to pull this sobek complete item");
currentItem = SobekEngineClient.Items.Get_Sobek_Item(CurrentRequest.BibID, CurrentRequest.VID, Tracer);
if (currentItem == null)
{
Tracer.Add_Trace("Google_Coordinate_Entry_ItemViewer.Constructor", "Unable to build complete item");
CurrentRequest.Mode = Display_Mode_Enum.Error;
CurrentRequest.Error_Message = "Invalid Request : Unable to build complete item";
return;
}
//string resource_directory = UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network + CurrentItem.Web.AssocFilePath;
//string current_mets = resource_directory + CurrentItem.METS_Header.ObjectID + ".mets.xml";
// If there is no user, send to the login
if (CurrentUser == null)
{
CurrentRequest.Mode = Display_Mode_Enum.My_Sobek;
CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Logon;
CurrentRequest.Return_URL = BriefItem.BibID + "/" + BriefItem.VID + "/mapedit";
UrlWriterHelper.Redirect(CurrentRequest);
return;
}
//holds actions from page
string action = HttpContext.Current.Request.Form["action"] ?? String.Empty;
string payload = HttpContext.Current.Request.Form["payload"] ?? String.Empty;
// See if there were hidden requests
if (!String.IsNullOrEmpty(action))
{
if (action == "save")
SaveContent(payload);
}
////create a backup of the mets
//string backup_directory = UI_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network + Current_Item.Web.AssocFilePath + UI_ApplicationCache_Gateway.Settings.Resources.Backup_Files_Folder_Name;
//string backup_mets_name = backup_directory + "\\" + CurrentItem.METS_Header.ObjectID + "_" + DateTime.Now.Year + "_" + DateTime.Now.Month + "_" + DateTime.Now.Day + ".mets.bak";
//File.Copy(current_mets, backup_mets_name);
}
catch (Exception ee)
{
//Custom_Tracer.Add_Trace("MapEdit Start Failure");
throw new ApplicationException("MapEdit Start Failure\r\n" + ee.Message);
}
}
示例12: Flash_ItemViewer
/// <summary> Constructor for a new instance of the Flash_ItemViewer class, used to display a
/// flash file, or flash video, for a given digital resource </summary>
/// <param name="BriefItem"> Digital resource object </param>
/// <param name="CurrentUser"> Current user, who may or may not be logged on </param>
/// <param name="CurrentRequest"> Information about the current request </param>
public Flash_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest)
{
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties to the empy behaviors ( in the base class )
Behaviors = EmptyBehaviors;
// Find the appropriate flash files and label
flash_file = String.Empty;
flash_label = String.Empty;
string first_label = String.Empty;
string first_file = String.Empty;
int current_flash_index = 0;
const int FLASH_INDEX = 0;
foreach (BriefItem_FileGrouping thisPage in BriefItem.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)
{
// If this is the first one, assign it
if (String.IsNullOrEmpty(first_file))
{
first_file = thisFile.Name;
first_label = thisPage.Label;
}
if (current_flash_index == FLASH_INDEX)
{
flash_file = thisFile.Name;
flash_label = thisPage.Label;
break;
}
current_flash_index++;
}
}
}
// If none found, but a first was found, use that
if ((String.IsNullOrEmpty(flash_file)) && (!String.IsNullOrEmpty(first_file)))
{
flash_file = first_file;
flash_label = first_label;
}
// If this is not already a link format, make it one
if (( !String.IsNullOrEmpty(flash_file)) && ( flash_file.IndexOf("http:") < 0))
{
flash_file = BriefItem.Web.Source_URL + "/" + flash_file;
}
}
示例13: Restricted_ItemViewer
/// <summary> Constructor for a new instance of the Restricted_ItemViewer class, used display
/// the applicable restricted message for a digital resource which is currently restricted due to IP restrictions </summary>
/// <param name="BriefItem"> Digital resource object </param>
/// <param name="CurrentUser"> Current user, who may or may not be logged on </param>
/// <param name="CurrentRequest"> Information about the current request </param>
public Restricted_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest)
{
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties to the empy behaviors ( in the base class )
Behaviors = EmptyBehaviors;
}
示例14: Directory_ItemViewer
/// <summary> Constructor for a new instance of the Directory_ItemViewer class, used display
/// the tracking milestones information for a digital resource </summary>
/// <param name="BriefItem"> Digital resource object </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="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public Directory_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
{
Tracer.Add_Trace("Directory_ItemViewer.Constructor");
// Save the arguments for use later
this.BriefItem = BriefItem;
this.CurrentUser = CurrentUser;
this.CurrentRequest = CurrentRequest;
// Set the behavior properties to the empy behaviors ( in the base class )
Behaviors = EmptyBehaviors;
}
示例15: get_navigation_object
/// <summary> Resolve the requested URL (sepecified via the base url and the query string ) into a SobekCM navigation object </summary>
/// <param name="RequestQueryString"> Query string, from the request The request query string.</param>
/// <param name="BaseUrl"> Base URL of the original request </param>
/// <param name="RequestUserLanguages"> List of user languages requested (via browser settings) </param>
/// <param name="Tracer">The tracer.</param>
/// <returns> Fully built navigation controller object </returns>
public Navigation_Object get_navigation_object(NameValueCollection RequestQueryString, string BaseUrl, string[] RequestUserLanguages, Custom_Tracer Tracer)
{
NameValueCollection keys = RequestQueryString.Copy();
string redirect_url = RequestQueryString["urlrelative"];
redirect_url = redirect_url.Replace("/url-resolver/json", "").Replace("/url-resolver/json-p", "").Replace("/url-resolver/protobuf", "").Replace("/url-resolver/xml", "");
keys["urlrelative"] = redirect_url;
Navigation_Object currentMode = new Navigation_Object();
QueryString_Analyzer.Parse_Query(keys, currentMode, BaseUrl, RequestUserLanguages, Engine_ApplicationCache_Gateway.Codes, Engine_ApplicationCache_Gateway.Collection_Aliases, Engine_ApplicationCache_Gateway.Items, Engine_ApplicationCache_Gateway.URL_Portals, Engine_ApplicationCache_Gateway.WebContent_Hierarchy, Tracer);
return currentMode;
}