Sharepoint 2010 在Sharepoint 2010中禁用指向我的网站配置文件的链接

Sharepoint 2010 在Sharepoint 2010中禁用指向我的网站配置文件的链接,sharepoint-2010,Sharepoint 2010,我想利用Sharepoint 2010中的一些社交协作功能,例如记事本Web部件和标记,但不想使用我的网站配置文件页面 我已经构建了一个自定义控件,可以从userdisp.aspx页面重定向到自定义用户配置文件页面。我想继续使用该自定义配置文件页面。但是,例如,由记事本Web部件生成的用户配置文件链接似乎直接进入/Sites/MySites/person.aspx页面,而不经过/u layouts/userdisp.aspx页面。所以我的个人资料重定向控制没有捕捉到它 在Sharepoint管理

我想利用Sharepoint 2010中的一些社交协作功能,例如记事本Web部件和标记,但不想使用我的网站配置文件页面

我已经构建了一个自定义控件,可以从userdisp.aspx页面重定向到自定义用户配置文件页面。我想继续使用该自定义配置文件页面。但是,例如,由记事本Web部件生成的用户配置文件链接似乎直接进入/Sites/MySites/person.aspx页面,而不经过/u layouts/userdisp.aspx页面。所以我的个人资料重定向控制没有捕捉到它

在Sharepoint管理中心的“管理服务应用程序”>“用户配置文件服务应用程序”>“管理用户权限”下,我只选中了“使用社交功能”复选框,没有选中“创建个人网站”,因此我不确定配置文件页为什么没有链接到旧的userdisp.aspx页


是否可以将这些链接重定向回userdisp.aspx页面

它似乎已硬编码到Web部件中

I位于,链接来自,定义为:

public override Uri PublicUrl
{
  get
  {
    string userProfileUrl = UserProfileGlobal.GetUserProfileURL(
        this.m_objManager.UserProfileApplicationProxy, 
        this.m_objManager.PartitionID, 
        "?accountname=", 
        this.m_UserProfileFields["AccountName"].ToString());
    if (!string.IsNullOrEmpty(userProfileUrl))
      return new Uri(userProfileUrl);
    else
      return (Uri) null;
  }
}
这最终要求:

internal static string GetUserProfileURL(string profileWebUrl, string strIdentifier, string strValue)
{
  if (string.IsNullOrEmpty(profileWebUrl))
    return (string) null;
  else
    return PersonalSpaceGlobal.EnsureTrailingSlash(profileWebUrl) 
        + "Person.aspx" 
        + strIdentifier 
        + (strIdentifier.Equals("?accountname=", StringComparison.OrdinalIgnoreCase) 
            ? SPHttpUtility.UrlKeyValueEncode(strValue).Replace(":", "%3A") 
            : SPHttpUtility.UrlKeyValueEncode(strValue));
}   
我可以想出两个变通办法:

  • 将jQuery添加到页面以更改URL(选择器=span.socialcomment-username>a)
  • 创建您自己的Web部件,其中包含从SocialCommentControl继承的自定义控件,该控件将覆盖
  • 重写RenderComment可能会很混乱。您需要复制方法的代码,以便将以下内容更改为您自己的代码:

    SocialCommentControl._GetProperty(
        comment, 
        SocialCommentControl.SocialCommentProperty.PublicPage)
    
    希望RenderComment的67行代码中没有内部方法调用。否则,实施起来就会困难得多。如果您可以简单地重写,那么会容易得多,但不幸的是,它是一个静态方法


    总之,我可能会推荐jQuery选项,而不是扩展SocialCommentControl。

    它似乎是硬编码到Web部件中的

    I位于,链接来自,定义为:

    public override Uri PublicUrl
    {
      get
      {
        string userProfileUrl = UserProfileGlobal.GetUserProfileURL(
            this.m_objManager.UserProfileApplicationProxy, 
            this.m_objManager.PartitionID, 
            "?accountname=", 
            this.m_UserProfileFields["AccountName"].ToString());
        if (!string.IsNullOrEmpty(userProfileUrl))
          return new Uri(userProfileUrl);
        else
          return (Uri) null;
      }
    }
    
    这最终要求:

    internal static string GetUserProfileURL(string profileWebUrl, string strIdentifier, string strValue)
    {
      if (string.IsNullOrEmpty(profileWebUrl))
        return (string) null;
      else
        return PersonalSpaceGlobal.EnsureTrailingSlash(profileWebUrl) 
            + "Person.aspx" 
            + strIdentifier 
            + (strIdentifier.Equals("?accountname=", StringComparison.OrdinalIgnoreCase) 
                ? SPHttpUtility.UrlKeyValueEncode(strValue).Replace(":", "%3A") 
                : SPHttpUtility.UrlKeyValueEncode(strValue));
    }   
    
    我可以想出两个变通办法:

  • 将jQuery添加到页面以更改URL(选择器=span.socialcomment-username>a)
  • 创建您自己的Web部件,其中包含从SocialCommentControl继承的自定义控件,该控件将覆盖
  • 重写RenderComment可能会很混乱。您需要复制方法的代码,以便将以下内容更改为您自己的代码:

    SocialCommentControl._GetProperty(
        comment, 
        SocialCommentControl.SocialCommentProperty.PublicPage)
    
    希望RenderComment的67行代码中没有内部方法调用。否则,实施起来就会困难得多。如果您可以简单地重写,那么会容易得多,但不幸的是,它是一个静态方法


    综上所述,我可能会推荐jQuery选项而不是扩展SocialCommentControl。

    感谢您的回复。我希望我能早点看到这一点,但我从stackoverflow收到的电子邮件通知似乎已经停止工作了。。。我决定试试jQuery路线。我已经修改了现有的重定向控件来处理“accountname”查询参数,并将使用jQuery将url重定向到userdisp.aspx页面。我会让你知道它是如何工作的。再次感谢你的帮助!Rich,你能覆盖_GetProperty吗?我得到一个错误,说它没有标记为虚拟、抽象或重写,所以你不能。你知道有没有其他方法可以将其作为继承控件“重写”呢?比起在页面上拖动所有跨距或链接,我更喜欢这个想法。@P-Dub:我不确定我在想什么。不能重写静态方法。所以这并不是那么简单明了。我已将答案更改为覆盖RenderComment而不是_GetProperty。感谢您的回复。我希望我能早点看到这一点,但我从stackoverflow收到的电子邮件通知似乎已经停止工作了。。。我决定试试jQuery路线。我已经修改了现有的重定向控件来处理“accountname”查询参数,并将使用jQuery将url重定向到userdisp.aspx页面。我会让你知道它是如何工作的。再次感谢你的帮助!Rich,你能覆盖_GetProperty吗?我得到一个错误,说它没有标记为虚拟、抽象或重写,所以你不能。你知道有没有其他方法可以将其作为继承控件“重写”呢?比起在页面上拖动所有跨距或链接,我更喜欢这个想法。@P-Dub:我不确定我在想什么。不能重写静态方法。所以这并不是那么简单明了。我已将答案更改为覆盖RenderComment而不是_GetProperty。