/// <summary> Constructor for a new instance of the UF_Media_ItemViewer class, used display
        /// the media ( i.e., archival CD or DVD  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 UF_Media_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;

            // Set the behavior properties to the empy behaviors ( in the base class )
            Behaviors = EmptyBehaviors;

            // Get the archives information
            Tracer.Add_Trace("UF_Media_ItemViewer.Constructor", "Try to pull the archives details for this item");
            DataSet data = Engine_Database.Tracking_Get_History_Archives(BriefItem.Web.ItemID, Tracer);

            if ((data == null) || (data.Tables.Count < 1))
            {
                Tracer.Add_Trace("Constructor.Constructor", "Unable to pull tracking details");
                CurrentRequest.Mode          = Display_Mode_Enum.Error;
                CurrentRequest.Error_Message = "Internal Error : Unable to pull tracking information for " + BriefItem.BibID + ":" + BriefItem.VID;
                return;
            }

            // Save this table
            mediaTable = data.Tables[0];
        }
        private void add_single_point(string Latitude, string Longitude, Navigation_Object Current_Mode, List <DataRow> DatarowsInThisPoint, StringBuilder ScriptBuilder)
        {
            // Build the info window
            StringBuilder contentBuilder = new StringBuilder(2000);

            contentBuilder.Append(DatarowsInThisPoint.Count <= 2 ? "<div class=\"sbkMbav_InfoDivSmall\">" : "<div class=\"sbkMbav_InfoDiv\">");
            contentBuilder.Append("<table><tr style=\"vertical-align:top;\">");
            string thisBibId = String.Empty;

            foreach (DataRow thisRow in DatarowsInThisPoint)
            {
                thisBibId = thisRow[2].ToString();
                string groupTitle     = thisRow[3].ToString();
                string groupThumbnail = thisBibId.Substring(0, 2) + "/" + thisBibId.Substring(2, 2) + "/" + thisBibId.Substring(4, 2) + "/" + thisBibId.Substring(6, 2) + "/" + thisBibId.Substring(8) + "/" + thisRow[4];
                int    itemCount      = Convert.ToInt32(thisRow[5]);
                string type           = thisRow[6].ToString();

                // Calculate the link
                string link = Current_Mode.Base_URL + thisBibId;

                // Calculate the thumbnail
                string thumb = UI_ApplicationCache_Gateway.Settings.Servers.Image_URL + groupThumbnail.Replace("\\", "/").Replace("//", "/");
                if ((thumb.ToUpper().IndexOf(".JPG") < 0) && (thumb.ToUpper().IndexOf(".GIF") < 0))
                {
                    thumb = Static_Resources_Gateway.Nothumb_Jpg;
                }

                contentBuilder.Append("<td><table class=\"sbkMbav_Thumb\" >");
                contentBuilder.Append("<tr><td><a href=\"" + link + "\" target=\"" + thisBibId + "\"><img src=\"" + thumb + "\" /></a></td></tr>");
                contentBuilder.Append("<tr><td><span class=\"sbkMbav_ThumbText\">" + groupTitle.Replace("'", ""));
                if (itemCount > 1)
                {
                    if (type.ToUpper() == "NEWSPAPER")
                    {
                        contentBuilder.Append("<br />( " + itemCount + " issues )");
                    }
                    else
                    {
                        contentBuilder.Append("<br />( " + itemCount + " volumes )");
                    }
                }
                contentBuilder.Append("</span></td></tr></table></td>");
            }
            contentBuilder.Append("</tr></table>");
            contentBuilder.Append("</div>");

            if ((DatarowsInThisPoint.Count < 2) && (!String.IsNullOrEmpty(thisBibId)))
            {
                contentBuilder.Append("<center><a href=\"" + Current_Mode.Base_URL + thisBibId + "\">Click here for more information about this title</a></center><br/>");
            }
            else
            {
                contentBuilder.Append("<center><a href=\"" + Current_Mode.Base_URL + Current_Mode.Aggregation + "/results?coord=" + Latitude + "," + Longitude + ",,\">Click here for more information about these " + DatarowsInThisPoint.Count + " titles</a></center><br/>");
            }


            ScriptBuilder.AppendLine("    add_point( " + Latitude + ", " + Longitude + ", '" + contentBuilder + "' );");
        }
        /// <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;
            }
        }
        /// <summary> Constructor for a new instance of the PDF_ItemViewer class, used to display a PDF file from 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="FileExtensions"> List of file extensions this video viewer should show </param>
        public PDF_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer, string[] FileExtensions)
        {
            // Save the arguments for use later
            this.BriefItem      = BriefItem;
            this.CurrentUser    = CurrentUser;
            this.CurrentRequest = CurrentRequest;

            // Determine if this should be written as an iFrame
            writeAsIframe = ((!String.IsNullOrEmpty(CurrentRequest.Browser_Type)) && (CurrentRequest.Browser_Type.IndexOf("CHROME") == 0));

            // Set the behavior properties
            Behaviors = new List <HtmlSubwriter_Behaviors_Enum> {
                HtmlSubwriter_Behaviors_Enum.Suppress_Footer
            };

            // Determine if a particular video was selected
            pdf = 1;
            if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["pdf"]))
            {
                int tryPdf;
                if (Int32.TryParse(HttpContext.Current.Request.QueryString["pdf"], out tryPdf))
                {
                    if (tryPdf < 1)
                    {
                        tryPdf = 1;
                    }
                    pdf = tryPdf;
                }
            }

            // Collect the list of pdf by stepping through each download page
            pdfFileNames = new List <string>();
            pdfLabels    = new List <string>();
            foreach (BriefItem_FileGrouping downloadPage in BriefItem.Downloads)
            {
                foreach (BriefItem_File thisFileInfo in downloadPage.Files)
                {
                    string extension = thisFileInfo.File_Extension.Replace(".", "");
                    foreach (string thisPossibleFileExtension in FileExtensions)
                    {
                        if (String.Compare(extension, thisPossibleFileExtension, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            pdfFileNames.Add(thisFileInfo.Name);
                            pdfLabels.Add(downloadPage.Label);
                        }
                    }
                }
            }

            // Ensure the pdf count wasn't too large
            if (pdf > pdfFileNames.Count)
            {
                pdf = 1;
            }
        }
Ejemplo n.º 5
0
        /// <summary> Constructor for a new instance of the JPEG2000_ItemViewer class, used to display JPEG2000s 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>
        public JPEG2000_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer, string ViewerCode, string[] FileExtensions)
        {
            // Add the trace
            if (Tracer != null)
            {
                Tracer.Add_Trace("JPEG2000_ItemViewer.Constructor");
            }

            // Save the arguments for use later
            this.BriefItem      = BriefItem;
            this.CurrentUser    = CurrentUser;
            this.CurrentRequest = CurrentRequest;

            // Determine if the navigator ( in the left nav bar ) should be suppressed
            suppressNavigator = false;
            if (UI_ApplicationCache_Gateway.Settings.Contains_Additional_Setting("JPEG2000 ItemViewer.Suppress Navigator"))
            {
                if (UI_ApplicationCache_Gateway.Settings.Get_Additional_Setting("JPEG2000 ItemViewer.Suppress Navigator").ToLower().Trim() != "false")
                {
                    suppressNavigator = true;
                }
            }

            // Determine the page
            page = 1;
            if (!String.IsNullOrEmpty(CurrentRequest.ViewerCode))
            {
                int tempPageParse;
                if (Int32.TryParse(CurrentRequest.ViewerCode.Replace(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)) && (page != 1))
            {
                // If there was an error, just set to the first page
                page = 1;
                set_file_information(FileExtensions);
            }

            // Since this is a paging viewer, set the viewer code
            if (String.IsNullOrEmpty(CurrentRequest.ViewerCode))
            {
                CurrentRequest.ViewerCode = ViewerCode.Replace("#", page.ToString());
            }
        }
Ejemplo n.º 6
0
        /// <summary> Constructor for a new instance of the Video_ItemViewer class, used to display a video loaded
        /// locally with the digital resource files </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="FileExtensions"> List of file extensions this video viewer should show </param>
        public Video_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer, string[] FileExtensions)
        {
            // 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;

            // Determine if a particular video was selected
            video = 1;
            if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["video"]))
            {
                int tryVideo;
                if (Int32.TryParse(HttpContext.Current.Request.QueryString["video"], out tryVideo))
                {
                    if (tryVideo < 1)
                    {
                        tryVideo = 1;
                    }
                    video = tryVideo;
                }
            }

            // Collect the list of videos by stepping through each download page
            videoFileNames = new List <string>();
            videoLabels    = new List <string>();
            foreach (BriefItem_FileGrouping downloadPage in BriefItem.Downloads)
            {
                foreach (BriefItem_File thisFileInfo in downloadPage.Files)
                {
                    string extension = thisFileInfo.File_Extension.Replace(".", "");
                    foreach (string thisPossibleFileExtension in FileExtensions)
                    {
                        if (String.Compare(extension, thisPossibleFileExtension, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            videoFileNames.Add(thisFileInfo.Name);
                            videoLabels.Add(downloadPage.Label);
                        }
                    }
                }
            }

            // Ensure the video count wasn't too large
            if (video > videoFileNames.Count)
            {
                video = 1;
            }
        }
        /// <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.URL_Portals, Engine_ApplicationCache_Gateway.WebContent_Hierarchy, Engine_ApplicationCache_Gateway.Settings.System.Custom_BibID_RegEx, Tracer);

            return(currentMode);
        }
Ejemplo n.º 8
0
        /// <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="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="Current_User"> Currently logged on user </param>
        /// <param name="Public_Folder"> Object contains the information about the public folder to display </param>
        /// <param name="Top_Collection"> Item aggregation for the top-level collection, which is used in a number of places, for example
        /// showing the correct banner, even when it is not the "current" aggregation </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,
                            Search_Results_Statistics Results_Statistics,
                            List <iSearch_Title_Result> Paged_Results,
                            User_Object Current_User,
                            Public_User_Folder Public_Folder,
                            Item_Aggregation Top_Collection,
                            Custom_Tracer Tracer)
        {
            this.Current_Mode       = Current_Mode;
            this.Results_Statistics = Results_Statistics;
            this.Paged_Results      = Paged_Results;
            this.Current_User       = Current_User;
            this.Public_Folder      = Public_Folder;
            this.Top_Collection     = Top_Collection;
            this.Tracer             = Tracer;

            Flags = new RequestCache_RequestFlags();
        }
Ejemplo n.º 9
0
        /// <summary> Constructor for a new instance of the Tracking_ItemViewer class, used display
        /// the full workflow history 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 Tracking_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;

            // Set the behavior properties to the empy behaviors ( in the base class )
            Behaviors = EmptyBehaviors;

            // Get the tracking information
            Tracer.Add_Trace("Tracking_ItemViewer.Constructor", "Try to pull the tracking details for this item");
            trackingDetails = SobekEngineClient.Items.Get_Item_Tracking_Work_History(BriefItem.BibID, BriefItem.VID, Tracer);
            if (trackingDetails == null)
            {
                Tracer.Add_Trace("Tracking_ItemViewer.Constructor", "Unable to pull tracking details");
                CurrentRequest.Mode          = Display_Mode_Enum.Error;
                CurrentRequest.Error_Message = "Internal Error : Unable to pull tracking information for " + BriefItem.BibID + ":" + BriefItem.VID;
            }
        }
Ejemplo n.º 10
0
        /// <summary> Constructor for a new instance of the Sanborn_ItemViewer class, used to display a HTML file from 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>
        public Sanborn_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;

            // The prototyper checks for existence of the .gif file, so that should exist
            // and we won't both checking again here.
            gifFile = BriefItem.BibID + "_" + BriefItem.VID + ".gif";

            // Check for existence of the HTMl file though
            if (SobekFileSystem.FileExists(BriefItem, BriefItem.BibID + "_" + BriefItem.VID + ".htm"))
            {
                htmlFile = SobekFileSystem.Resource_Network_Uri(BriefItem, BriefItem.BibID + "_" + BriefItem.VID + ".htm");
            }
        }
        private static void set_web_skin_from_aggregation(Navigation_Object Current_Mode, Item_Aggregation Aggregation_Object)
        {
            // If th aggregation can only display under certain web skins, see if the current is acceptable
            // Do NOT do this replacement if the web skin is in the URL and this is admin mode
            if ((!Current_Mode.Skin_In_URL) || (Current_Mode.Mode != Display_Mode_Enum.Administrative))
            {
                // Is there a list of acceptible web skins?
                if ((Aggregation_Object.Web_Skins != null) && (Aggregation_Object.Web_Skins.Count > 0))
                {
                    string currentWebSkin = Current_Mode.Skin;
                    bool   acceptableSkin = false;
                    foreach (string aggrWebSkin in Aggregation_Object.Web_Skins)
                    {
                        if (String.Compare(currentWebSkin, aggrWebSkin, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            acceptableSkin = true;
                            break;
                        }
                    }

                    // If no match found, assign the skin
                    if (!acceptableSkin)
                    {
                        // Use default skin if there
                        if (!String.IsNullOrWhiteSpace(Aggregation_Object.Default_Skin))
                        {
                            Current_Mode.Skin = Aggregation_Object.Default_Skin.ToLower();
                        }
                        else
                        {
                            Current_Mode.Skin = Aggregation_Object.Web_Skins[0];
                        }

                        // Let the nav object know this was a default
                        Current_Mode.Default_Skin = Current_Mode.Skin;
                    }
                }
            }
        }
        /// <summary> Gets the item aggregation and search fields for the current item aggregation </summary>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <param name="Aggregation_Object"> [OUT] Fully-built object for the current aggregation object </param>
        /// <returns> TRUE if successful, otherwise FALSE </returns>
        /// <remarks> This attempts to pull the objects from the cache.  If unsuccessful, it builds the objects from the
        /// database and hands off to the <see cref="CachedDataManager" /> to store in the cache. </remarks>
        protected static bool Get_Top_Level_Collection(Navigation_Object Current_Mode, Custom_Tracer Tracer, out Item_Aggregation Aggregation_Object)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("abstractHtmlSubwriter.Get_Top_Level_Collection", String.Empty);
            }

            string languageCode = Web_Language_Enum_Converter.Enum_To_Code(Current_Mode.Language);

            // Get the ALL collection group
            try
            {
                // Try to pull this from the cache
                Aggregation_Object = CachedDataManager.Aggregations.Retrieve_Item_Aggregation("all", Web_Language_Enum_Converter.Code_To_Enum(languageCode), Tracer);
                if (Aggregation_Object != null)
                {
                    return(true);
                }

                // Get the item aggregation from the Sobek Engine Client
                Aggregation_Object = SobekEngineClient.Aggregations.Get_Aggregation("all", Web_Language_Enum_Converter.Code_To_Enum(languageCode), UI_ApplicationCache_Gateway.Settings.System.Default_UI_Language, Tracer);
            }
            catch (Exception ee)
            {
                Aggregation_Object         = null;
                Current_Mode.Error_Message = "Error pulling the item aggregation corresponding to all collection groups : " + ee.Message;
                return(false);
            }

            // If this is null, just stop
            if (Aggregation_Object == null)
            {
                Current_Mode.Error_Message = "Unable to pull the item aggregation corresponding to all collection groups";
                return(false);
            }

            return(true);
        }
        /// <summary> Gets the item aggregation and search fields for the current item aggregation </summary>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <param name="Aggregation_Object"> [OUT] Fully-built object for the current aggregation object </param>
        /// <returns> TRUE if successful, otherwise FALSE </returns>
        /// <remarks> This attempts to pull the objects from the cache.  If unsuccessful, it builds the objects from the
        /// database and hands off to the <see cref="CachedDataManager" /> to store in the cache. </remarks>
        protected static bool Get_Collection(Navigation_Object Current_Mode, Custom_Tracer Tracer, out Item_Aggregation Aggregation_Object)
        {
            string languageCode = Web_Language_Enum_Converter.Enum_To_Code(Current_Mode.Language);

            if (Tracer != null)
            {
                Tracer.Add_Trace("abstractHtmlSubwriter.Get_Collection", "Get aggregation (" + Current_Mode.Aggregation + ") or (" + Current_Mode.Default_Aggregation + ") for language (" + languageCode + ")");
            }

            // If there is an aggregation listed, try to get that now
            if ((Current_Mode.Aggregation.Length > 0) && (Current_Mode.Aggregation != "all"))
            {
                // Try to pull the aggregation information
                Aggregation_Object = CachedDataManager.Aggregations.Retrieve_Item_Aggregation(Current_Mode.Aggregation, Web_Language_Enum_Converter.Code_To_Enum(languageCode), Tracer);
                if (Aggregation_Object != null)
                {
                    set_web_skin_from_aggregation(Current_Mode, Aggregation_Object);
                    return(true);
                }

                // Get the item aggregation from the Sobek Engine Client (which checks the local cache as well)
                Aggregation_Object = SobekEngineClient.Aggregations.Get_Aggregation(Current_Mode.Aggregation, Web_Language_Enum_Converter.Code_To_Enum(languageCode), UI_ApplicationCache_Gateway.Settings.System.Default_UI_Language, Tracer);

                // Return if this was valid
                if (Aggregation_Object != null)
                {
                    set_web_skin_from_aggregation(Current_Mode, Aggregation_Object);
                    return(true);
                }

                Current_Mode.Error_Message = "Invalid item aggregation '" + Current_Mode.Aggregation + "' referenced.";
                return(false);
            }

            return(Get_Top_Level_Collection(Current_Mode, Tracer, out Aggregation_Object));
        }
Ejemplo n.º 14
0
        /// <summary> Constructor for a new instance of the HTML_ItemViewer class, used to display a HTML file from 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>
        public HTML_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 first HTML file loaded
            foreach (BriefItem_FileGrouping thisPage in BriefItem.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)
                    {
                        htmlFile = thisFile.Name;
                        break;
                    }
                }
            }
        }
 /// <summary> Creates and returns the an instance of the <see cref="Metadata_Links_ItemViewer"/> class for showing the
 /// links to the main metadata files associated with a digital resource (such METS file, marc.xml file, etc..) during
 /// execution of a single HTTP request. </summary>
 /// <param name="CurrentItem"> 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>
 /// <returns> Fully built and initialized <see cref="Metadata_Links_ItemViewer"/> object </returns>
 /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for
 /// the digital resource requested.  The created viewer is then destroyed at the end of the request </remarks>
 public iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
 {
     return(new Metadata_Links_ItemViewer(CurrentItem, CurrentUser, CurrentRequest));
 }
Ejemplo n.º 16
0
        /// <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> Wites a section of citation from a provided digital resource </summary>
        /// <param name="ElementInfo"> Additional possible data about this citation element </param>
        /// <param name="Output"> Response stream for the item viewer to write directly to </param>
        /// <param name="Item"> Digital resource with all the data to write </param>
        /// <param name="LeftColumnWidth"> Number of pixels of the left column, or the definition terms </param>
        /// <param name="SearchLink"> Beginning of the search link that can be used to allow the web patron to select a term and run a search against this instance </param>
        /// <param name="SearchLinkEnd"> End of the search link that can be used to allow the web patron to select a term and run a search against this instance  </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public void Write_Citation_Section(CitationElement ElementInfo, StringBuilder Output, BriefItemInfo Item, int LeftColumnWidth, string SearchLink, string SearchLinkEnd, Custom_Tracer Tracer, Navigation_Object CurrentRequest)
        {
            // Set the default (since this always displays)
            string rights_statement = "All applicable rights reserved by the source institution and holding location.";
            string rights_image     = String.Empty;
            string uri = String.Empty;

            const string SEE_TEXT = "See License Deed";

            // Look for a match in the item description
            BriefItem_DescriptiveTerm rightsTerm = Item.Get_Description("Rights Management");

            if ((rightsTerm != null) && (rightsTerm.Values.Count > 0))
            {
                rights_statement = rightsTerm.Values[0].Value;

                if ((rightsTerm.Values[0].URIs != null) && (rightsTerm.Values[0].URIs.Count == 1))
                {
                    uri = rightsTerm.Values[0].URIs[0];

                    switch (uri)
                    {
                    case "http://creativecommons.org/licenses/by-nc-nd/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Nd_Img;
                        break;

                    case "http://creativecommons.org/licenses/by-nc-sa/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Sa_Img;
                        break;

                    case "http://creativecommons.org/licenses/by-nc/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nc_Img;
                        break;

                    case "http://creativecommons.org/licenses/by-nd/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Nd_Img;
                        break;

                    case "http://creativecommons.org/licenses/by-sa/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Sa_Img;
                        break;

                    case "http://creativecommons.org/licenses/by/3.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_By_Img;
                        break;

                    case "http://creativecommons.org/publicdomain/zero/1.0/":
                        rights_image = UI_ApplicationCache_Gateway.Configuration.UI.StaticResources.Cc_Zero_Img;
                        break;
                    }
                }
            }

            string displayLabel = (String.IsNullOrEmpty(ElementInfo.DisplayTerm)) ? "Rights Management" : ElementInfo.DisplayTerm;

            Output.AppendLine("        <dt class=\"sbk_CivRIGHTS_Element\" style=\"width:" + LeftColumnWidth + "px;\" >" + displayLabel + ": </dt>");
            Output.Append("        <dd class=\"sbk_CivRIGHTS_Element\" style=\"margin-left:" + LeftColumnWidth + "px;\"><span itemprop=\"rights\">");

            if ((rights_statement.IndexOf("http://") == 0) || (rights_statement.IndexOf("https://") == 0))
            {
                Output.Append("<a href=\"" + rights_statement + "\" target=\"RIGHTS\" >" + rights_statement + "</a>");
            }
            else
            {
                // Show the rights image?
                if (String.IsNullOrEmpty(rights_image))
                {
                    if (!String.IsNullOrEmpty(uri))
                    {
                        Output.Append(rights_statement + " ( <a href=\"" + uri + "\" alt=\"" + SEE_TEXT + "\" target=\"license\">link</a> )");
                    }
                    else
                    {
                        Output.Append(rights_statement);
                    }
                }
                else
                {
                    // Since the image is derived from the URI, there must be a URI here
                    Output.Append("<a href=\"" + uri + "\" alt=\"" + SEE_TEXT + "\" target=\"cc_license\"><img src=\"" + rights_image + "\" /></a> " + rights_statement);
                }
            }

            Output.AppendLine("</span></dd>");
            Output.AppendLine();
        }
Ejemplo n.º 18
0
        /// <summary> Displays an item as HTML using this template </summary>
        /// <param name="Output">Text writer to write all of the HTML for this template</param>
        /// <param name="Bib">Bibliographic identifier for the item to display</param>
        /// <param name="Skin_Code">Current base skin code</param>
        /// <param name="isMozilla">Flag indicates if this is Mozilla</param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <returns>HTML code for any pop-up forms, which must be placed in a different DIV on the web page</returns>
        public string Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, Navigation_Object Current_Mode)
        {
            Output.WriteLine("<script src=\"" + Static_Resources_Gateway.Sobekcm_Metadata_Js + "\" type=\"text/javascript\"></script>");
            Output.WriteLine("<a name=\"template\"> </a>");
            // Start to build the return value
            StringBuilder returnValue = new StringBuilder();

            // TEMPORARY CODE TO SUPPORT MULTI-PAGE TEMPLATES IN ONE PAGE (WILL CHANGE)
            bool multiple_page = templatePages.Count > 1;

            // Set the current base url on all the elements
            foreach (abstract_Element thisElement in templatePages.SelectMany(ThisPage => ThisPage.Panels.SelectMany(ThisPanel => ThisPanel.Elements)))
            {
                thisElement.Set_Base_URL(Current_Mode.Base_URL);
            }

            // Now, render these pages
            bool first_title = true;

            foreach (Template_Page thisPage in templatePages)
            {
                if (multiple_page)
                {
                    Output.WriteLine("<br /><h1>" + thisPage.Title + "</h1><br />");
                }

                foreach (Template_Panel thisPanel in thisPage.Panels)
                {
                    Output.WriteLine("<table cellpadding=\"4px\" border=\"0px\" cellspacing=\"0px\" class=\"SobekEditItemSection\" >");
                    Output.WriteLine("  <tr align=\"left\">");
                    if (first_title)
                    {
                        Output.WriteLine("    <td colspan=\"3\" class=\"SobekEditItemSectionTitle_first\">&nbsp;" + thisPanel.Title + "</td>");
                        first_title = false;
                    }
                    else
                    {
                        Output.WriteLine("    <td colspan=\"3\" class=\"SobekEditItemSectionTitle\">&nbsp;" + thisPanel.Title + "</td>");
                    }
                    Output.WriteLine("  </tr>");
                    Output.WriteLine();

                    foreach (abstract_Element thisElement in thisPanel.Elements)
                    {
                        thisElement.Render_Template_HTML(Output, Bib, Skin_Code, isMozilla, returnValue, Current_User, CurrentLanguage, Translator, Current_Mode.Base_URL);
                    }

                    Output.WriteLine("</table><br />");
                }
            }
            return(returnValue.ToString());
        }
        /// <summary> Gets the browse or info object and any other needed data for display ( text to display) </summary>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Aggregation_Object"> Item Aggregation object</param>
        /// <param name="Base_Directory"> Base directory location under which the the CMS/info source file will be found</param>
        /// <param name="Current_User"> Currently logged on user, which can determine which items to show </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <param name="Browse_Object"> [OUT] Stores all the information about this browse or info </param>
        /// <param name="Complete_Result_Set_Info"> [OUT] Information about the entire set of results </param>
        /// <param name="Paged_Results"> [OUT] List of search results for the requested page of results </param>
        /// <param name="Browse_Info_Display_Text"> [OUT] Static HTML-based content to be displayed if this is browing a staticly created html source file </param>
        /// <returns> TRUE if successful, otherwise FALSE </returns>
        /// <remarks> This attempts to pull the objects from the cache.  If unsuccessful, it builds the objects from the
        /// database and hands off to the <see cref="CachedDataManager" /> to store in the cache </remarks>
        protected static bool Get_Browse_Info(Navigation_Object Current_Mode,
                                              Item_Aggregation Aggregation_Object,
                                              string Base_Directory,
                                              User_Object Current_User,
                                              Custom_Tracer Tracer,
                                              out Item_Aggregation_Child_Page Browse_Object,
                                              out Search_Results_Statistics Complete_Result_Set_Info,
                                              out List <iSearch_Title_Result> Paged_Results,
                                              out HTML_Based_Content Browse_Info_Display_Text)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("abstractHtmlSubwriter.Get_Browse_Info", String.Empty);
            }

            // Set output initially to null
            Paged_Results            = null;
            Complete_Result_Set_Info = null;
            Browse_Info_Display_Text = null;

            // First, make sure the browse submode is valid
            Browse_Object = Aggregation_Object.Child_Page_By_Code(Current_Mode.Info_Browse_Mode);

            if (Browse_Object == null)
            {
                Current_Mode.Error_Message = "Unable to retrieve browse/info item '" + Current_Mode.Info_Browse_Mode + "'";
                return(false);
            }

            // Is this a table result, or a string?
            switch (Browse_Object.Source_Data_Type)
            {
            case Item_Aggregation_Child_Source_Data_Enum.Database_Table:

                // Set the current sort to ZERO, if currently set to ONE and this is an ALL BROWSE.
                // Those two sorts are the same in this case
                int sort = Current_Mode.Sort.HasValue ? Math.Max(Current_Mode.Sort.Value, ((ushort)1)) : 1;
                if ((sort == 0) && (Browse_Object.Code == "all"))
                {
                    sort = 1;
                }

                // Special code if this is a JSON browse
                string browse_code = Current_Mode.Info_Browse_Mode;
                if (Current_Mode.Writer_Type == Writer_Type_Enum.JSON)
                {
                    browse_code = browse_code + "_JSON";
                    sort        = 12;
                }

                // Get the page count in the results
                int current_page_index = Current_Mode.Page.HasValue ? Math.Max(Current_Mode.Page.Value, ((ushort)1)) : 1;

                // Determine if this is a special search type which returns more rows and is not cached.
                // This is used to return the results as XML and DATASET
                bool special_search_type = false;
                int  results_per_page    = 20;
                if ((Current_Mode.Writer_Type == Writer_Type_Enum.XML) || (Current_Mode.Writer_Type == Writer_Type_Enum.DataSet))
                {
                    results_per_page    = 1000000;
                    special_search_type = true;
                    sort = 2;     // Sort by BibID always for these
                }

                Tracer.Add_Trace("abstractHtmlSubwriter.Get_Browse_Info", "Current_Mode.Writer_Type=[" + Current_Mode.Writer_Type.ToString() + "].");
                Tracer.Add_Trace("abstractHtmlSubwriter.Get_Browse_Info", "Current_Mode.Results_Display_Type=[" + Current_Mode.Result_Display_Type + "].");

                if (String.Equals(Current_Mode.Result_Display_Type, "timeline", StringComparison.OrdinalIgnoreCase))
                {
                    Tracer.Add_Trace("abstractHtmlSubwriter.Get_Browse_Info", "Is timeline, setting browse results_per_page and sort.");

                    results_per_page = 20000;
                    sort             = 12;
                }

                // Set the flags for how much data is needed.  (i.e., do we need to pull ANYTHING?  or
                // perhaps just the next page of results ( as opposed to pulling facets again).
                bool need_browse_statistics = true;
                bool need_paged_results     = true;
                if ((!special_search_type) && (Current_User == null))
                {
                    // Look to see if the browse statistics are available on any cache for this browse
                    Complete_Result_Set_Info = CachedDataManager.Retrieve_Browse_Result_Statistics(Aggregation_Object.Code, browse_code, Tracer);
                    if (Complete_Result_Set_Info != null)
                    {
                        need_browse_statistics = false;
                    }

                    // Look to see if the paged results are available on any cache..
                    Paged_Results = CachedDataManager.Retrieve_Browse_Results(Aggregation_Object.Code, browse_code, current_page_index, sort, (uint)results_per_page, Tracer);
                    if (Paged_Results != null)
                    {
                        need_paged_results = false;
                    }
                }

                // Was a copy found in the cache?
                if ((!need_browse_statistics) && (!need_paged_results))
                {
                    if (Tracer != null)
                    {
                        Tracer.Add_Trace("SobekCM_Assistant.Get_Browse_Info", "Browse statistics and paged results retrieved from cache");
                    }
                }
                else
                {
                    if (Tracer != null)
                    {
                        Tracer.Add_Trace("SobekCM_Assistant.Get_Browse_Info", "Building results information");
                    }

                    // Try to pull more than one page, so we can cache the next page or so
                    List <List <iSearch_Title_Result> > pagesOfResults;

                    // Get from the hierarchy object
                    Multiple_Paged_Results_Args returnArgs = Item_Aggregation_Utilities.Get_Browse_Results(Aggregation_Object, Browse_Object, current_page_index, sort, results_per_page, !special_search_type, need_browse_statistics, Current_User, Tracer);
                    if (need_browse_statistics)
                    {
                        Complete_Result_Set_Info = returnArgs.Statistics;
                    }
                    pagesOfResults = returnArgs.Paged_Results;
                    if ((pagesOfResults != null) && (pagesOfResults.Count > 0))
                    {
                        Paged_Results = pagesOfResults[0];
                    }

                    // Save the overall result set statistics to the cache if something was pulled
                    if ((!special_search_type) && (Current_User == null))
                    {
                        if ((need_browse_statistics) && (Complete_Result_Set_Info != null))
                        {
                            CachedDataManager.Store_Browse_Result_Statistics(Aggregation_Object.Code, browse_code, Complete_Result_Set_Info, Tracer);
                        }

                        // Save the overall result set statistics to the cache if something was pulled
                        if ((need_paged_results) && (Paged_Results != null))
                        {
                            CachedDataManager.Store_Browse_Results(Aggregation_Object.Code, browse_code, current_page_index, sort, (uint)results_per_page, pagesOfResults, Tracer);
                        }
                    }
                }
                break;

            case Item_Aggregation_Child_Source_Data_Enum.Static_HTML:
                Browse_Info_Display_Text = SobekEngineClient.Aggregations.Get_Aggregation_HTML_Child_Page(Aggregation_Object.Code, Aggregation_Object.Language, UI_ApplicationCache_Gateway.Settings.System.Default_UI_Language, Browse_Object.Code, Tracer);
                break;
            }
            return(true);
        }
Ejemplo n.º 20
0
 /// <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 abstract void Add_Menu_Items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted);
Ejemplo n.º 21
0
        /// <summary> Constructor for a new instance of the GnuBooks_PageTurner_ItemViewer class, used to display the
        /// jpegs images attached to an item in the GnuBooks viewer </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 GnuBooks_PageTurner_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;
        }
 /// <summary> Constructor for a new instance of the MODEL3DTHREEJS_ItemViewer class, used to display a 3D file from 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 MODEL3DTHREEJS_ItemViewer(BriefItemInfo BriefItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
 {
     this.BriefItem      = BriefItem;
     this.CurrentRequest = CurrentRequest;
     this.CurrentUser    = CurrentUser;
 }
        /// <summary> Adds the banner to the response stream from either the html web skin
        /// or from the current item aggreagtion object, depending on flags in the web skin object </summary>
        /// <param name="Output"> Stream to which to write the HTML for the banner </param>
        /// <param name="Banner_Division_Name"> Name for the wrapper division around the banner </param>
        /// <param name="Hierarchy_Object"> Current item aggregation object to display </param>
        /// <param name="HTML_Skin"> HTML Web skin which controls the overall appearance of this digital library </param>
        /// <param name="Web_Page_Title"> Web page title to add behind the banner image </param>
        /// <param name="CurrentMode"> Mode / navigation information for the current request</param>
        /// <remarks> This is called by several html subwriters that otherwise tell this class to suppress writing the banner </remarks>
        public static void Add_Banner(TextWriter Output, string Banner_Division_Name, string Web_Page_Title, Navigation_Object CurrentMode, Web_Skin_Object HTML_Skin, Item_Aggregation Hierarchy_Object)
        {
            Output.WriteLine("<!-- abstractHtmlSubwriter.Add_Banner - Write the main collection, interface, or institution banner -->");

            if ((HTML_Skin != null) && (HTML_Skin.Override_Banner.HasValue) && (HTML_Skin.Override_Banner.Value))
            {
                if (!String.IsNullOrEmpty(HTML_Skin.Banner_HTML))
                {
                    Output.WriteLine(HTML_Skin.Banner_HTML);
                }
            }
            else
            {
                string url_options = UrlWriterHelper.URL_Options(CurrentMode);
                if (url_options.Length > 0)
                {
                    url_options = "?" + url_options;
                }

                if ((Hierarchy_Object != null) && (Hierarchy_Object.Code != "all"))
                {
                    Output.WriteLine("<section id=\"sbkAhs_BannerDiv\" role=\"banner\" title=\"" + Hierarchy_Object.ShortName + "\">");
                    Output.WriteLine("  <h1 class=\"hidden-element\">" + Web_Page_Title + "</h1>");
                    Output.WriteLine("  <a alt=\"" + Hierarchy_Object.ShortName + "\" href=\"" + CurrentMode.Base_URL + Hierarchy_Object.Code + url_options + "\"><img id=\"mainBanner\" src=\"" + CurrentMode.Base_URL + Hierarchy_Object.Get_Banner_Image(HTML_Skin) + "\"  alt=\"" + Hierarchy_Object.ShortName + "\" /></a>");
                    Output.WriteLine("</section>");
                }
                else
                {
                    if ((Hierarchy_Object != null) && (Hierarchy_Object.Get_Banner_Image(HTML_Skin).Length > 0))
                    {
                        Output.WriteLine("<section id=\"sbkAhs_BannerDiv\" role=\"banner\" title=\"" + Hierarchy_Object.ShortName + "\">");
                        Output.WriteLine("  <h1 class=\"hidden-element\">" + Web_Page_Title + "</h1>");
                        Output.WriteLine("  <a alt=\"" + Hierarchy_Object.ShortName + "\" href=\"" + CurrentMode.Base_URL + url_options + "\"><img id=\"mainBanner\" src=\"" + CurrentMode.Base_URL + Hierarchy_Object.Get_Banner_Image(HTML_Skin) + "\"  alt=\"" + Hierarchy_Object.ShortName + "\" /></a>");
                        Output.WriteLine("</section>");
                    }
                    else
                    {
                        string skin_url = CurrentMode.Base_Design_URL + "skins/" + CurrentMode.Skin + "/";
                        Output.WriteLine("<section id=\"sbkAhs_BannerDiv\" role=\"banner\"><h1 class=\"hidden-element\">" + Web_Page_Title + "</h1><a href=\"" + CurrentMode.Base_URL + url_options + "\"><img id=\"mainBanner\" src=\"" + skin_url + "default.jpg\" alt=\"\" /></a></section>");
                    }
                }
            }

            Output.WriteLine();
        }
        /// <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;

            // Add the item menu information
            Item_MenuItem menuItem = new Item_MenuItem("Description", "Metadata", null, url, ViewerCode);

            MenuItems.Add(menuItem);
        }
Ejemplo n.º 25
0
 /// <summary> Creates and returns the an instance of the <see cref="GnuBooks_PageTurner_ItemViewer"/> class for showing the
 /// digital resource as an online flip book within a Gnu library page turner interface </summary>
 /// <param name="CurrentItem"> 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>
 /// <returns> Fully built and initialized <see cref="GnuBooks_PageTurner_ItemViewer"/> object </returns>
 /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for
 /// the digital resource requested.  The created viewer is then destroyed at the end of the request </remarks>
 public iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
 {
     return(new GnuBooks_PageTurner_ItemViewer(CurrentItem, CurrentUser, CurrentRequest));
 }
Ejemplo n.º 26
0
 /// <summary> Creates and returns the an instance of the <see cref="ManageMenu_ItemViewer"/> class for showing the
 /// administrative management menu for a digital resource during execution of a single HTTP request. </summary>
 /// <param name="CurrentItem"> 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>
 /// <returns> Fully built and initialized <see cref="ManageMenu_ItemViewer"/> object </returns>
 /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for
 /// the digital resource requested.  The created viewer is then destroyed at the end of the request </remarks>
 public virtual iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
 {
     return(new ManageMenu_ItemViewer(CurrentItem, CurrentUser, CurrentRequest));
 }
Ejemplo n.º 27
0
        /// <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);
        }
Ejemplo n.º 28
0
        /// <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 virtual void Add_Menu_Items(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, List <Item_MenuItem> MenuItems, bool IpRestricted)
        {
            // Again, ensure access
            if (!Has_Access(CurrentItem, CurrentUser, false))
            {
                return;
            }

            // Get the URL for this
            string previous_code = CurrentRequest.ViewerCode;

            CurrentRequest.ViewerCode = ViewerCode;
            string url = UrlWriterHelper.Redirect_URL(CurrentRequest);

            CurrentRequest.ViewerCode = previous_code;
            MenuItems.Add(new Item_MenuItem("Manage", "Management Menu", null, url, "manage"));

            bool is_bib_level = (String.Compare(CurrentItem.Type, "BIB_LEVEL", StringComparison.OrdinalIgnoreCase) == 0);

            if (!is_bib_level)
            {
                // Look for TEI-type item
                bool is_tei = false;
                if ((UI_ApplicationCache_Gateway.Configuration.Extensions != null) &&
                    (UI_ApplicationCache_Gateway.Configuration.Extensions.Get_Extension("TEI") != null) &&
                    (UI_ApplicationCache_Gateway.Configuration.Extensions.Get_Extension("TEI").Enabled))
                {
                    string tei_file  = CurrentItem.Behaviors.Get_Setting("TEI.Source_File");
                    string xslt_file = CurrentItem.Behaviors.Get_Setting("TEI.XSLT");
                    if ((tei_file != null) && (xslt_file != null))
                    {
                        is_tei = true;
                    }
                }

                if (!is_tei)
                {
                    // Add the menu item for editing metadatga
                    CurrentRequest.Mode          = Display_Mode_Enum.My_Sobek;
                    CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Edit_Item_Metadata;
                    string edit_metadata_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                    MenuItems.Add(new Item_MenuItem("Manage", "Edit Metadata", null, edit_metadata_url, "nevermatchthis"));
                }
                else
                {
                    // Add the menu item for editing metadatga
                    CurrentRequest.Mode          = Display_Mode_Enum.My_Sobek;
                    CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Edit_TEI_Item;
                    string edit_tei_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                    MenuItems.Add(new Item_MenuItem("Manage", "Edit TEI", null, edit_tei_url, "nevermatchthis"));
                }

                // Add the menu item for editing item behaviors
                CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Edit_Item_Behaviors;
                string edit_behaviors_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Edit Item Behaviors", null, edit_behaviors_url, "nevermatchthis"));

                // Add the menu item for managing download files
                CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.File_Management;
                string manage_downloads = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Manage Download Files", null, manage_downloads, "nevermatchthis"));

                // Add the menu item for managing pages and divisions
                if ((CurrentItem.Images == null) || (CurrentItem.Images.Count == 0))
                {
                    CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Page_Images_Management;
                    string page_images_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                    MenuItems.Add(new Item_MenuItem("Manage", "Manage Pages and Divisions", null, page_images_url, "nevermatchthis"));
                }
                else
                {
                    CurrentRequest.Mode       = Display_Mode_Enum.Item_Display;
                    CurrentRequest.ViewerCode = "qc";
                    string qc_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                    MenuItems.Add(new Item_MenuItem("Manage", "Manage Pages and Divisions", null, qc_url, "nevermatchthis"));
                }

                // Add the manage geo-spatial data option
                CurrentRequest.Mode       = Display_Mode_Enum.Item_Display;
                CurrentRequest.ViewerCode = "mapedit";
                string mapedit_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Manage Geo-Spatial Data (beta)", null, mapedit_url, "mapedit"));

                // Add the tracking sheet menu option
                CurrentRequest.ViewerCode = "ts";
                string tracking_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "View Tracking Sheet", null, tracking_url, "ts"));
            }
            else
            {
                // Get all the mySObek URLs
                CurrentRequest.Mode = Display_Mode_Enum.My_Sobek;

                // Add the group behavior edit
                CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Edit_Group_Behaviors;
                string edit_behaviors_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Edit Item Group Behaviors", null, edit_behaviors_url, "nevermatchthis"));

                // Add the option to add a new volume
                CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Group_Add_Volume;
                string add_volume_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Add New Volume", null, add_volume_url, "nevermatchthis"));

                // Add the option for group mass update
                CurrentRequest.My_Sobek_Type = My_Sobek_Type_Enum.Group_Mass_Update_Items;
                string mass_update_url = UrlWriterHelper.Redirect_URL(CurrentRequest);
                MenuItems.Add(new Item_MenuItem("Manage", "Mass Update Item Behaviors", null, mass_update_url, "nevermatchthis"));
            }

            CurrentRequest.Mode       = Display_Mode_Enum.Item_Display;
            CurrentRequest.ViewerCode = previous_code;
        }
Ejemplo n.º 29
0
 /// <summary> Creates and returns the item viewer for this viewer type </summary>
 /// <param name="CurrentItem"> 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>
 /// <returns> Fully built and initialized item viewer object of this type </returns>
 /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for
 /// the digital resource requested.  The created viewer is then destroyed at the end of the request </remarks>
 public abstract iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer);
Ejemplo n.º 30
0
 /// <summary> Creates and returns the an instance of the <see cref="Video_ItemViewer"/> class for showing a locally
 /// loaded video for a digital resource during execution of a single HTTP request. </summary>
 /// <param name="CurrentItem"> 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>
 /// <returns> Fully built and initialized <see cref="Video_ItemViewer"/> object </returns>
 /// <remarks> This method is called whenever a request requires the actual viewer to be created to render the HTML for
 /// the digital resource requested.  The created viewer is then destroyed at the end of the request </remarks>
 public iItemViewer Create_Viewer(BriefItemInfo CurrentItem, User_Object CurrentUser, Navigation_Object CurrentRequest, Custom_Tracer Tracer)
 {
     return(new Video_ItemViewer(CurrentItem, CurrentUser, CurrentRequest, Tracer, FileExtensions));
 }