当前位置: 首页>>代码示例>>C#>>正文


C# Custom_Tracer.Add_Trace方法代码示例

本文整理汇总了C#中SobekCM.Tools.Custom_Tracer.Add_Trace方法的典型用法代码示例。如果您正苦于以下问题:C# Custom_Tracer.Add_Trace方法的具体用法?C# Custom_Tracer.Add_Trace怎么用?C# Custom_Tracer.Add_Trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SobekCM.Tools.Custom_Tracer的用法示例。


在下文中一共展示了Custom_Tracer.Add_Trace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        /// <summary> Create the BriefItemInfo from a full METS-based SobekCM_Item object,
        /// using the default mapping set </summary>
        /// <param name="Original"> Original METS-based object to use </param>
        /// <param name="MappingSetId"> Name of the mapping set to use (if there are more than one)</param>
        /// <param name="Tracer"> Custom tracer to record general process flow </param>
        /// <returns> Completely built BriefItemInfo object from the METS-based SobekCM_Item object </returns>
        public static BriefItemInfo Create(SobekCM_Item Original, string MappingSetId, Custom_Tracer Tracer )
        {
            // Try to get the brief mapping set
            List<IBriefItemMapper> mappingSet = get_mapping_set(MappingSetId);

            // Create the mostly empty new brief item
            Tracer.Add_Trace("BriefItem_Factory.Create", "Create the mostly empty new brief item");
            BriefItemInfo newItem = new BriefItemInfo
            {
                BibID = Original.BibID,
                VID = Original.VID,
                Title = Original.Bib_Info.Main_Title.Title
            };

            // Build the new item using the selected mapping set
            Tracer.Add_Trace("BriefItem_Factory.Create", "Use the set of mappers to map data to the brief item");
            foreach (IBriefItemMapper thisMapper in mappingSet)
            {
                Tracer.Add_Trace("BriefItem_Factory.Create", "...." + thisMapper.GetType().ToString().Replace("SobekCM.Engine_Library.Items.BriefItems.Mappers.",""));
                thisMapper.MapToBriefItem(Original, newItem);
            }
            Tracer.Add_Trace("BriefItem_Factory.Create", "Finished using all instatiated and configued mappers");

            return newItem;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:31,代码来源:BriefItem_Factory.cs

示例2: 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");
            }
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:34,代码来源:Text_Search_ItemViewer.cs

示例3: Build_Brief_Item

        /// <summary> Builds a brief version of a digital resource, used when displaying the 'FULL VIEW' in 
        /// a search result or browse list </summary>
        /// <param name="METS_Location"> Location (URL) of the METS file to read via HTTP </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <returns> Briefly built version of a digital resource </returns>
        public SobekCM_Item Build_Brief_Item(string METS_Location, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Build_Brief_Item", "Create the requested item");
            }

            try
            {
                // Get the response object for this METS file
                string mets_file = METS_Location.Replace("\\", "/") + "/citation_mets.xml";

                SobekCM_Item thisPackage = Build_Item_From_METS(mets_file, "citation_mets.xml", Tracer);

                if (thisPackage == null)
                {
                    if (Tracer != null)
                        Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Build_Brief_Item", "Unable to find/read either METS file", Custom_Trace_Type_Enum.Error);
                }

                if (Tracer != null)
                {
                    Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Build_Brief_Item", "Finished building this item");
                }

                return thisPackage;
            }
            catch (Exception ee)
            {
                if (Tracer != null)
                    Tracer.Add_Trace("SobekCM_METS_Based_ItemBuilder.Build_Brief_Item", ee.ToString().Replace("\n", "<br />"), Custom_Trace_Type_Enum.Error);
                return null;
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:39,代码来源:SobekCM_METS_Based_ItemBuilder.cs

示例4: Read_HTML_File

        /// <summary> Read the source browse and info static html files and create the
        /// appropriate <see cref="HTML_Based_Content"/> object with all the bibliographic information
        /// (author, keywords, description, title, code) loaded from the header in the HTML file</summary>
        /// <param name="Source_File"> Source file to read directly from the local network (not via the web)</param>
        /// <param name="Retain_Entire_Display_Text"> Flag indicates whether the entire display text should be retained (as it is about to be displayed) or just the basic information from the HEAD of the file </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Fully built browse info object with all the bibliographic information</returns>
        public static HTML_Based_Content Read_HTML_File(string Source_File,  bool Retain_Entire_Display_Text, Custom_Tracer Tracer)
        {
            try
            {
                if (Tracer != null)
                {
                    Tracer.Add_Trace("HTML_Based_Content_Reader.Read_HTML_File", "Reading source file");
                }

                // Read this info file
                StreamReader reader = new StreamReader(Source_File);
                string displayText = reader.ReadToEnd();
                reader.Close();

                if (Tracer != null)
                {
                    Tracer.Add_Trace("HTML_Based_Content_Reader.Read_HTML_File", "Succesfully read the source file");
                }

                // Convert this to the object
                return Text_To_HTML_Based_Content(displayText, Retain_Entire_Display_Text, Source_File, Tracer);
            }
            catch ( Exception ee )
            {
                if (Tracer != null)
                {
                    Tracer.Add_Trace("HTML_Based_Content_Reader.Read_HTML_File", "EXCEPTION caught reading source file " + ee.Message );
                }

                return null;
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:39,代码来源:HTML_Based_Content_Reader.cs

示例5: 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);
            }
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:63,代码来源:Google_Coordinate_Entry_ItemViewer.cs

示例6: Aggregate_Statistics

        /// <summary> Aggregate all the item-level and item group-level hits up the hierarchy to the aggregations </summary>
        /// <param name="Year"> Year of this usage </param>
        /// <param name="Month"> Month of this usage </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> TRUE if successfully aggregated, otherwise FALSE </returns>
        /// <remarks> This calls the 'SobekCM_Statistics_Aggregate' stored procedure </remarks> 
        public static string Aggregate_Statistics(int Year, int Month, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Engine_Database.Aggregate_Statistics", "");
            }

            try
            {
                EalDbParameter[] parameters = new EalDbParameter[3];
                parameters[0] = new EalDbParameter("@statyear", Year);
                parameters[1] = new EalDbParameter("@statmonth", Month);
                EalDbParameter returnMsg = parameters[2] = new EalDbParameter("@message", Month);
                returnMsg.Direction = ParameterDirection.InputOutput;

                // Define a temporary dataset
                EalDbAccess.ExecuteNonQuery( DatabaseType, Connection_String, CommandType.StoredProcedure, "SobekCM_Statistics_Aggregate", parameters);

                return returnMsg.Value.ToString();
            }
            catch (Exception ee)
            {
                Last_Exception = ee;
                if (Tracer != null)
                {
                    Tracer.Add_Trace("Engine_Database.Aggregate_Statistics", "Exception caught during database work", Custom_Trace_Type_Enum.Error);
                    Tracer.Add_Trace("Engine_Database.Aggregate_Statistics", ee.Message, Custom_Trace_Type_Enum.Error);
                    Tracer.Add_Trace("Engine_Database.Aggregate_Statistics", ee.StackTrace, Custom_Trace_Type_Enum.Error);
                }
                return "Exception caught";
            }
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:38,代码来源:Engine_Database.cs

示例7: Write_HTML

        /// <summary> Writes the HTML generated by this error html subwriter directly to the response stream </summary>
        /// <param name="Output"> Stream to which to write the HTML for this subwriter </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> TRUE -- Value indicating if html writer should finish the page immediately after this, or if there are other controls or routines which need to be called first </returns>
        public override bool Write_HTML(TextWriter Output, Custom_Tracer Tracer)
        {
            Tracer.Add_Trace("Error_HtmlSubwriter.Write_HTML", "Rendering HTML");

            // Start the page container
            Output.WriteLine("<div id=\"pagecontainer\">");
            Output.WriteLine("<br />");

            string errorMessage = RequestSpecificValues.Current_Mode.Error_Message;
            if (String.IsNullOrEmpty(errorMessage))
                errorMessage = "Error";

                Output.WriteLine("<center>");

                Output.WriteLine("  <br /><br />");
                Output.WriteLine("<span style=\"font-size:large; color:red\">");
                Output.WriteLine("    <b>Deprecated URL detected</b>");
                Output.WriteLine("</span>");
                Output.WriteLine("<span style=\"font-size:1.2em\">");
                Output.WriteLine("  <br /><br />");
                Output.WriteLine("The URL you entered is a legacy URL.  Support for this URL will end shortly.<br /><br />Please update your records to the new URL below:<br /><br />");
                Output.WriteLine("<a href=\"" + errorMessage + "\">" + errorMessage + "</a>");
                Output.WriteLine("  <br /><br /><br /><br />");
                Output.WriteLine("</span>");
                Output.WriteLine("</center>");
                Output.WriteLine();

                Output.WriteLine("<!-- Close the pagecontainer div -->");
                Output.WriteLine("</div>");
                Output.WriteLine();

            return true;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:37,代码来源:LegacyUrl_HtmlSubwriter.cs

示例8: get_web_skin

        /// <summary> [HELPER] Gets the language-specific web skin, by web skin code and language code </summary>
        /// <param name="SkinCode"> Web skin code </param>
        /// <param name="RequestedLanguage"> Web language </param>
        /// <param name="DefaultLanguage"> Default language, in case the requested web language does nto exist </param>
        /// <param name="Tracer"></param>
        /// <returns> A build language-specific web skin </returns>
        /// <remarks> This may be public now, but this will be converted into a private helped class with 
        /// the release of SobekCM 5.0 </remarks>
        public static Web_Skin_Object get_web_skin(string SkinCode, Web_Language_Enum RequestedLanguage, Web_Language_Enum DefaultLanguage, Custom_Tracer Tracer)
        {
            Complete_Web_Skin_Object completeSkin = get_complete_web_skin(SkinCode, Tracer);

            if (completeSkin == null)
            {
                Tracer.Add_Trace("WebSkinServices.get_web_skin", "Complete skin retrieved was NULL, so returning NULL");
                return null;
            }

            // Look in the cache for this first
            Web_Skin_Object cacheObject = CachedDataManager.WebSkins.Retrieve_Skin(SkinCode, Web_Language_Enum_Converter.Enum_To_Code(RequestedLanguage), Tracer);
            if (cacheObject != null)
            {
                if (Tracer != null) Tracer.Add_Trace("WebSkinServices.get_web_skin", "Web skin found in the memory cache");
                return cacheObject;
            }

            // Try to get this language-specifi web skin
            Web_Skin_Object returnValue = Web_Skin_Utilities.Build_Skin(completeSkin, Web_Language_Enum_Converter.Enum_To_Code(RequestedLanguage), Tracer);

            // If this web skin has a value (an no exception) store in the cache
            if ((returnValue != null) && (String.IsNullOrEmpty(returnValue.Exception)))
            {
                if (Tracer != null) Tracer.Add_Trace("WebSkinServices.get_web_skin", "Store the web skin in the memory cache");
                CachedDataManager.WebSkins.Store_Skin(SkinCode, Web_Language_Enum_Converter.Enum_To_Code(RequestedLanguage), returnValue, Tracer );
            }

            // Return the object
            return returnValue;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:39,代码来源:WebSkinServices.cs

示例9: Write_Main_Viewer_Section

        /// <summary> Stream to which to write the HTML for this subwriter  </summary>
        /// <param name="Output"> Response stream for the item viewer to write directly to </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Write_Main_Viewer_Section(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("EAD_Description_ItemViewer.Write_Main_Viewer_Section", "");
            }

            // Get the metadata module for EADs
            EAD_Info eadInfo = (EAD_Info)CurrentItem.Get_Metadata_Module(GlobalVar.EAD_METADATA_MODULE_KEY);

            // Build the value
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"sbkEad_MainArea\">");

            if ( !String.IsNullOrWhiteSpace(CurrentMode.Text_Search))
            {
                // Get any search terms
                List<string> terms = new List<string>();
                if (CurrentMode.Text_Search.Trim().Length > 0)
                {
                    string[] splitter = CurrentMode.Text_Search.Replace("\"", "").Split(" ".ToCharArray());
                    terms.AddRange(from thisSplit in splitter where thisSplit.Trim().Length > 0 select thisSplit.Trim());
                }

                Output.Write(Text_Search_Term_Highlighter.Hightlight_Term_In_HTML(eadInfo.Full_Description, terms));
            }
            else
            {
                Output.Write(eadInfo.Full_Description);
            }

            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:37,代码来源:EAD_Description_ItemViewer.cs

示例10: Write_Main_Viewer_Section

        /// <summary> Stream to which to write the HTML for this subwriter  </summary>
        /// <param name="Output"> Response stream for the item viewer to write directly to </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Write_Main_Viewer_Section(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("YouTube_Embedded_Video_ItemViewer.Write_Main_Viewer_Section", "");
            }

            //Determine the name of the FLASH file
            string youtube_url = CurrentItem.Bib_Info.Location.Other_URL;
             if ( youtube_url.IndexOf("watch") > 0 )
                 youtube_url = youtube_url.Replace("watch?v=","v/") + "?fs=1&amp;hl=en_US";
            const int width = 600;
            const int height = 480;

            // Add the HTML for the image
            StringBuilder result = new StringBuilder(500);
            Output.WriteLine("          <td><div id=\"sbkEmv_ViewerTitle\">Streaming Video</div></td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td id=\"sbkEmv_MainArea\">");
            Output.WriteLine("            <object style=\"width:" + width + ";height:" + height + "\">");
            Output.WriteLine("              <param name=\"allowscriptaccess\" value=\"always\" />");
            Output.WriteLine("              <param name=\"movie\" value=\"" + youtube_url + "\" />");
            Output.WriteLine("              <param name=\"allowFullScreen\" value=\"true\"></param>");
            Output.WriteLine("              <embed src=\"" + youtube_url + "\" type=\"application/x-shockwave-flash\" AllowScriptAccess=\"always\" allowfullscreen=\"true\" width=\"" + width + "\" height=\"" + height + "\"></embed>");
            Output.WriteLine("            </object>");
            Output.WriteLine("          </td>" );
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:31,代码来源:YouTube_Embedded_Video_ItemViewer.cs

示例11: Get_LanguageSpecific_Web_Skin

        /// <summary> Get the language-specific web skin, by skin code and language </summary>
        /// <param name="SkinCode"> Code for the web skin </param>
        /// <param name="RequestedLanguage"> Requested language for the web skin code </param>
        /// <param name="DefaultLanguage"> Default UI language for the instance </param>
        /// <param name="Cache_On_Build"> Flag indicates whether to use the cache </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Language-specific web skin object </returns>
        public Web_Skin_Object Get_LanguageSpecific_Web_Skin(string SkinCode, Web_Language_Enum RequestedLanguage, Web_Language_Enum DefaultLanguage, bool Cache_On_Build, Custom_Tracer Tracer)
        {
            // If no interface yet, look in the cache
            if ((SkinCode != "new") && (Cache_On_Build))
            {
                Web_Skin_Object htmlSkin = CachedDataManager.WebSkins.Retrieve_Skin(SkinCode, Web_Language_Enum_Converter.Enum_To_Code(RequestedLanguage), Tracer);
                if (htmlSkin != null)
                {
                    if (Tracer != null)
                    {
                        Tracer.Add_Trace("SobekEngineClient_WebSkinEndpoints.Get_LanguageSpecific_Web_Skin", "Web skin '" + SkinCode + "' found in cache");
                    }
                    return htmlSkin;
                }
            }

            // If still not interface, build one
            Web_Skin_Object new_skin = WebSkinServices.get_web_skin(SkinCode, RequestedLanguage, DefaultLanguage, Tracer);

            // Look in the web skin row and see if it should be kept around, rather than momentarily cached
            if ((new_skin != null) && ( String.IsNullOrEmpty(new_skin.Exception)))
            {
                if (Cache_On_Build)
                {
                    // Momentarily cache this web skin object
                    CachedDataManager.WebSkins.Store_Skin(SkinCode, Web_Language_Enum_Converter.Enum_To_Code(RequestedLanguage), new_skin, Tracer);
                }
            }

            return new_skin;
        }
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:38,代码来源:SobekEngineClient_WebSkinEndpoints.cs

示例12: Get_Item_Brief

        /// <summary> Gets the brief digital resource object, by BibID_VID </summary>
        /// <param name="BibID"> Bibliographic identifier (BibID) for the digital resource to retrieve </param>
        /// <param name="VID"> Volume identifier (VID) for the digital resource to retrieve </param>
        /// <param name="UseCache"> Flag indicates if the cache should be used to check for a built copy or store the final product </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Fully built brief digital item object </returns>
        public BriefItemInfo Get_Item_Brief(string BibID, string VID, bool UseCache, Custom_Tracer Tracer)
        {
            // Add a beginning trace
            Tracer.Add_Trace("SobekEngineClient_ItemEndpoints.Get_Item_Brief", "Get brief item information by bibid/vid");

            // Look in the cache
            if ((Config.UseCache) && (UseCache))
            {
                BriefItemInfo fromCache = CachedDataManager.Items.Retrieve_Brief_Digital_Resource_Object(BibID, VID, Tracer);
                if (fromCache != null)
                {
                    Tracer.Add_Trace("SobekEngineClient_WebContentServices.Get_Item_Brief", "Found brief item in the local cache");
                    return fromCache;
                }
            }
            // Get the endpoint
            MicroservicesClient_Endpoint endpoint = GetEndpointConfig("Items.GetItemBrief", Tracer);

            // Format the URL
            string url = String.Format(endpoint.URL, BibID, VID);

            // Call out to the endpoint and deserialize the object
            BriefItemInfo returnValue = Deserialize<BriefItemInfo>(url, endpoint.Protocol, Tracer);

            // Add to the local cache
            if ((Config.UseCache) && (UseCache) && (returnValue != null))
            {
                Tracer.Add_Trace("SobekEngineClient_WebContentServices.Get_Item_Brief", "Store brief item in the local cache");
                CachedDataManager.Items.Store_Brief_Digital_Resource_Object(BibID, VID, returnValue, Tracer);
            }

            // Return the object
            return returnValue;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:40,代码来源:SobekEngineClient_ItemEndpoints.cs

示例13: Remove_Digital_Resource_Object

        /// <summary> Removes a user-specific digital resource object from the cache , it it exists </summary>
        /// <param name="UserID"> Primary key of the user, if this should be removed from the user-specific cache</param>
        /// <param name="BibID"> Bibliographic Identifier for the digital resource to remove </param>
        /// <param name="VID"> Volume Identifier for the digital resource to remove </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param>
        public void Remove_Digital_Resource_Object(int UserID, string BibID, string VID, Custom_Tracer Tracer)
        {
            // If the cache is disabled, just return before even tracing
            if (settings.Disabled)
                return;

            if (Tracer != null)
            {
                Tracer.Add_Trace("CachedDataManager_ItemServices.Remove_Digital_Resource_Object", "");
            }

            string key_start = "ITEM_" + BibID.ToUpper() + "_" + VID + "_";

            // Build the sorted list of locally cached stuff
            List<Cached_Object_Info> locallyCached = (from DictionaryEntry thisItem in HttpContext.Current.Cache select new Cached_Object_Info(thisItem.Key.ToString(), thisItem.Value.GetType())).ToList();

            // Determine which keys to expire
            List<string> keys_to_expire = (from cachedObject in locallyCached where cachedObject.Object_Key.IndexOf(key_start) == 0 select cachedObject.Object_Key).ToList();

            // Clear these from the local cache
            foreach (string expireKey in keys_to_expire)
            {
                HttpContext.Current.Cache.Remove(expireKey);
            }

            // Now, remove the actual item
            HttpContext.Current.Cache.Remove("ITEM_" + BibID.ToUpper() + "_" + VID);
            if (UserID > 0)
            {
                HttpContext.Current.Cache.Remove("USERITEM" + UserID + "_ITEM_" + BibID.ToUpper() + "_" + VID);
            }
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:37,代码来源:CachedDataManager_ItemServices.cs

示例14: Write_Main_Viewer_Section

        /// <summary> Stream to which to write the HTML for this subwriter  </summary>
        /// <param name="Output"> Response stream for the item viewer to write directly to </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        public override void Write_Main_Viewer_Section(TextWriter Output, Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("EAD_Description_ItemViewer.Write_Main_Viewer_Section", "");
            }

            // Try to get the ead information
            EAD_Transfer_Object eadInfo = SobekEngineClient.Items.Get_Item_EAD(BriefItem.BibID, BriefItem.VID, true, Tracer);

            // Build the value
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"sbkEad_MainArea\">");

            if ( !String.IsNullOrWhiteSpace(CurrentMode.Text_Search))
            {
                // Get any search terms
                List<string> terms = new List<string>();
                if (CurrentMode.Text_Search.Trim().Length > 0)
                {
                    string[] splitter = CurrentMode.Text_Search.Replace("\"", "").Split(" ".ToCharArray());
                    terms.AddRange(from thisSplit in splitter where thisSplit.Trim().Length > 0 select thisSplit.Trim());
                }

                Output.Write(Text_Search_Term_Highlighter.Hightlight_Term_In_HTML(eadInfo.Full_Description, terms));
            }
            else
            {
                Output.Write(eadInfo.Full_Description);
            }

            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:37,代码来源:EAD_Description_ItemViewer.cs

示例15: Get_Browse_Results

        /// <summary> Method returns the table of results for the browse indicated </summary>
        /// <param name="ItemAggr"> Item Aggregation from which to return the browse </param>
        /// <param name = "ChildPageObject">Object with all the information about the browse</param>
        /// <param name = "Page"> Page of results requested for the indicated browse </param>
        /// <param name = "Sort"> Sort applied to the results before being returned </param>
        /// <param name="Potentially_Include_Facets"> Flag indicates if facets could be included in this browse results </param>
        /// <param name = "Need_Browse_Statistics"> Flag indicates if the browse statistics (facets and total counts) are required for this browse as well </param>
        /// <param name = "Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        /// <param name="Results_Per_Page"> Number of results to retrieve per page</param>
        /// <returns> Resutls for the browse or info in table form </returns>
        public static Multiple_Paged_Results_Args Get_Browse_Results(Item_Aggregation ItemAggr, Item_Aggregation_Child_Page ChildPageObject,
                                                                      int Page, int Sort, int Results_Per_Page, bool Potentially_Include_Facets, bool Need_Browse_Statistics,
                                                                      Custom_Tracer Tracer)
        {
            if (Tracer != null)
            {
                Tracer.Add_Trace("Item_Aggregation_Utilities.Get_Browse_Results", String.Empty);
            }

            // Get the list of facets first
            List<short> facetsList = ItemAggr.Facets;
            if (!Potentially_Include_Facets)
                facetsList = null;

            // Pull data from the database if necessary
            if ((ChildPageObject.Code == "all") || (ChildPageObject.Code == "new"))
            {
                // Get this browse from the database
                if ((ItemAggr.ID < 0) || (ItemAggr.Code.ToUpper() == "ALL"))
                {
                    if (ChildPageObject.Code == "new")
                        return Engine_Database.Get_All_Browse_Paged(true, false, Results_Per_Page, Page, Sort, Need_Browse_Statistics, facetsList, Need_Browse_Statistics, Tracer);
                    return Engine_Database.Get_All_Browse_Paged(false, false, Results_Per_Page, Page, Sort, Need_Browse_Statistics, facetsList, Need_Browse_Statistics, Tracer);
                }

                if (ChildPageObject.Code == "new")
                {
                    return Engine_Database.Get_Item_Aggregation_Browse_Paged(ItemAggr.Code, true, false, Results_Per_Page, Page, Sort, Need_Browse_Statistics, facetsList, Need_Browse_Statistics, Tracer);
                }
                return Engine_Database.Get_Item_Aggregation_Browse_Paged(ItemAggr.Code, false, false, Results_Per_Page, Page, Sort, Need_Browse_Statistics, facetsList, Need_Browse_Statistics, Tracer);
            }

            // Default return NULL
            return null;
        }
开发者ID:MarkVSullivan,项目名称:SobekCM-Web-Application,代码行数:45,代码来源:Item_Aggregation_Utilities.cs


注:本文中的SobekCM.Tools.Custom_Tracer.Add_Trace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。