Asp.net 当我们试图使用C#2.0从Tridion 2009 broker LINK#u INFO表中获取一些数据时,服务器性能下降

Asp.net 当我们试图使用C#2.0从Tridion 2009 broker LINK#u INFO表中获取一些数据时,服务器性能下降,asp.net,c#-2.0,tridion,tridion2009,tridion-content-delivery,Asp.net,C# 2.0,Tridion,Tridion2009,Tridion Content Delivery,事实上,我试图在我们的页面上实现Google标记,这样我们的用户控件将在页面标题部分呈现低于HTML类型的内容 <link rel="alternate" hreflang="en-GB" href="http://www.mysite.com/english/index.aspx" /> <link rel="alternate" hreflang="de-DE" href="http://www.mysite.com/de/german/index.aspx" />

事实上,我试图在我们的页面上实现Google标记,这样我们的用户控件将在页面标题部分呈现低于HTML类型的内容

<link rel="alternate" hreflang="en-GB" href="http://www.mysite.com/english/index.aspx" />

<link rel="alternate" hreflang="de-DE" href="http://www.mysite.com/de/german/index.aspx" />

<link rel="alternate" hreflang="en-DE" href="http://www.mysite.com/de/english/index.aspx" />

<link rel="alternate" hreflang="ru-RU" href="http://www.mysite.com/ru/russian/index.aspx" />

<link rel="alternate" hreflang="en-RU" href="http://www.mysite.com/ru/english/index.aspx" />

<link rel="alternate" hreflang="fr-FR" href="http://www.mysite.com/fr/french/index.aspx" />

<link rel="alternate" hreflang="it-IT" href="http://www.mysite.com/it/italian/index.aspx" />

<link rel="alternate" hreflang="ja-JP" href="http://www.mysite.com/jp/japanese/index.aspx" />

<link rel="alternate" hreflang="ko-KR" href="http://www.mysite.com/kr/korean/index.aspx" />

<link rel="alternate" hreflang="pt-BR" href="http://www.mysite.com/br/portuguese/index.aspx" />

<link rel="alternate" hreflang="zh-Hans-CN" href="http://www.mysite.com/cn/chinese/index.aspx" />

<link rel="alternate" hreflang="en-US" href="http://www.mysite.com/us/english/index.aspx" />

<link rel="alternate" hreflang="en-GB" href="http://www.mysite.com/uk/english/index.aspx" />

<link rel="alternate" hreflang="en-AU" href="http://www.mysite.com/au/english/index.aspx" />

<link rel="alternate" hreflang="en-AE" href="http://www.mysite.com/ae/english/index.aspx" />

直接查询数据库是不受支持的,可能会使您的支持合同失效,并且很明显会绕过Tridion缓存的使用(这可能部分解释了您的性能问题)。建议:将Tridion链接API用于您试图实现的目标。

直接查询数据库不受支持,可能会使您的支持合同无效,并且显然会绕过Tridion缓存的使用(这可能部分解释了您的性能问题)。建议:使用Tridion链接API实现您想要实现的目标。

我希望您的实现中有一些标准代码,您可以在其中搜索一些合适的Tridion API链接。显然,正如前面所述,直接查询Tridion代理是不受支持的,但是它对于Tridon核心链接特性也没有任何意义

无论如何,请查找如下代码:

<tridion:ComponentLink runat="server" PageURI='tcm:12-1234-64'
                TemplateURI="tcm:0-0-0" ComponentURI="tcm:12-1233"
                LinkText="proper Tridion Linking in .NET" TextOnFail="true"/>

尽快拿到一些Tridon文档。这是与Tridion合作时必须做到的

祝你好运


编辑:一个未经测试的代码示例,当使用pageID调用方法id时(不带TCM),它应该能够在头部写出您的Google标记多语言链接:

使用系统;
使用Tridion.ContentManager;
使用Tridion.ContentManager.CommunicationManagement;
使用Tridion.ContentManager.ContentManagement;
使用Tridion.ContentManager.Templating;
命名空间网站.TridionTBBs.Utilities
{
/// 
///类公开常用Tridion项方法的实用程序方法。
/// 
公共静态类TridionCustomUtilities
{
#区域常数
public const string PageLinkGoogleMarkup=“\r\n”;
#端区
#区域页面链接
/// 
///此方法将返回多语言Google标记链接
///依赖于出版物和区域性信息所在的两个重要Webconfig条目
/// 
/// 
/// 
///等等。。。
/// 
///页面ID是从页面中提供的
静态无效GoogleMarkupPageLink(int pageID)
{
字符串[]PublicationId=ConfigurationManager.AppSettings[“publications”].Split(',');
StringWriter s=新的StringWriter();
使用(PageLink=new PageLink())
{
for(int i=0;i
这将要求您在web.config中存储属于每个发布的发布和区域性字符串。当然,您也可以将其存储在其他地方,但这似乎是Web服务器最快捷、压力最小的方式。当然,需要适当的缓存


这将避免您编写自定义部署脚本或其他复杂的非标准Tridion方法。

我希望您的实现中有一些标准代码,您可以在其中搜索一些适当的Tridion API链接。显然,正如前面所述,直接查询Tridion代理是不受支持的,但是它对于Tridon核心链接特性也没有任何意义

无论如何,请查找如下代码:

<tridion:ComponentLink runat="server" PageURI='tcm:12-1234-64'
                TemplateURI="tcm:0-0-0" ComponentURI="tcm:12-1233"
                LinkText="proper Tridion Linking in .NET" TextOnFail="true"/>

尽快拿到一些Tridon文档。这是与Tridion合作时必须做到的

祝你好运


编辑:一个未经测试的代码示例,当使用pageID调用方法id时(不带TCM),它应该能够在头部写出您的Google标记多语言链接:

使用系统;
使用Tridion.ContentManager;
使用Tridion.ContentManager.CommunicationManagement;
使用Tridion.ContentManager.ContentManagement;
使用Tridion.ContentManager.Templating;
命名空间网站.TridionTBBs.Utilities
{
/// 
///类公开常用Tridion项方法的实用程序方法。
/// 
公共静态类TridionCustomUtilities
{
#区域常数
public const string PageLinkGoogleMarkup=“\r\n”;
#端区
#区域页面链接
/// 
///此方法将返回多语言Google标记链接
///依赖于出版物和区域性信息所在的两个重要Webconfig条目
/// 
/// 
/// 
///等等。。。
/// 
///页面ID是从页面中提供的
静态无效GoogleMarkupPageLink(int pageID)
{
字符串[]PublicationId=ConfigurationManager.AppSettings[“publications”].Split(',');
StringWriter s=新的StringWriter();
使用(PageLink=new PageLink())
{
for(int i=0;iusing System;
using Tridion.ContentManager;
using Tridion.ContentManager.CommunicationManagement;
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.Templating;

namespace Website.TridionTBBs.Utilities
{
    /// <summary>
    /// Class exposing utility methods for frequent Tridion item methods.
    /// </summary>
    public static class TridionCustomUtilities
    {
        #region Constants

        public const string PageLinkGoogleMarkup = "<link rel=\"alternate\" hreflang=\"{0}\" href=\"{1}\" />\r\n";

        #endregion

        #region PageLinks
        /// <summary>
        /// This method will return the MultiLingual Google Markup link
        /// Relies on two important Webconfig entries where the publication and culture information is located
        /// <add key="publications" value="26,27,28,29,30,31,32,33,34" />
        /// <add key="tcm:0-26-1" value="en-GB" />
        /// <add key="tcm:0-27-1" value="de-DE" />
        /// etc...
        /// </summary>
        /// <param name="pageID">The PageId is provided from the page</param>
        static void GoogleMarkupPageLink(int pageID)
        {

            string[] publicationIDs = ConfigurationManager.AppSettings["publications"].Split(',');

            StringWriter s = new StringWriter();

            using (PageLink pageLink = new PageLink())
            {
                for (int i = 0; i < publicationIDs.Count; i++)
                {
                    Link link = pageLink.GetLink(String.Format("tcm:{0}-{1}", publicationIDs[i], pageID.ToString()));

                    if (link != null && link.IsResolved)
                    {
                        string linkUrl = link.Url;

                    }
                    string culture = ConfigurationManager.AppSettings[String.Format("tcm:0-{0}-1", publicationIDs[i])];

                    Response.Write(String.Format(PageLinkGoogleMarkup, culture, linkUrl));
                }
            }
        }
        #endregion
    }
}