문제

우리의 고객은 관리되는 메타 데이터에서 분류군에서 모든 용어를 표시하지 않고 라이브러리의 문서에서만 표시되지 않도록 목록보기 필터링을 변경하지 않았습니다.

현재 우리는 두 개의 열이 있습니다 :

우리는 학기 분류법에 의해 채워진 관리되는 메타 데이터 열을 가지고 있습니다. 열의 필터를 사용할 때 분류학의 모든 값이 표시됩니다.

image1

필터 뷰의 사용자 정의 필드 정의 열이 라이브러리에있는 문서의 값만 표시됩니다.

image2

이 필터링을 제공하는 방법을 찾으려고 노력했습니다. 검색 한 후에는 관리되는 메타 데이터 열에이 작업을 수행 할 수있는 간단한 방법이없는 것처럼 보입니다. 그물을 바라 보는 것은 또한 결정적 인 답변을주지 않았습니다. 나는 누군가가 같은 질문을하는 한 곳을 발견했지만, 대답은 내 사건에 만족스럽지 않습니다.

목록보기 필터링 맨징 메타 데이터 필드에서

도움이 되었습니까?

해결책

We were finally able to resolve the issue. In short - to work you need to change the way how OOTB Filter code works to way that it thinks that it is operating with SPFieldLookup.

To achieve this you need 3 steps.

1.Create copy of Filter.aspx file located from Sharepoint Root Directory. This aspx is responsible for rendering items in filter view. 2. Create HttpModule to redirect requests to the customFilter. 3. Register created HttpModule in webconfig.

  1. Replace FilterAspxPage class (the code is in Microsoft.Sharepoint.ApplicationPages.dll) used in this aspx file with custom implementation, which should look like this:

    public partial class CustomFilter : Microsoft.SharePoint.ApplicationPages.FilterAspxPage
    {   
        protected new void GetDistinctValues()
        {
        // exact copy of the method GetDistinctValues from Microsoft.Sharepoint.ApplicationPages.dll with code taken from OnInit method
        // to properly initialize objects used in this method
        // Also one use of reflection was needed, because renderAsHtml is protected
    
        // after assignment to text4 string we've added this condition:
    
        if (text4.Equals("Microsoft.SharePoint.Taxonomy.TaxonomyField", StringComparison.InvariantCultureIgnoreCase) == true)
        {
            text4 = "Microsoft.SharePoint.SPFieldLookup";
        }
      }
    }
    
  2. Here is an example of how to create custom HttpModule:

    public class ListFilterRedirectModule : IHttpModule
    {
    
    #region IHttpModule Members
    
        public void Dispose()
        {
        }
    
        public void Init(HttpApplication context)
        {
            context.BeginRequest += new EventHandler(context_BeginRequest);
        }
    #endregion
    
    
        private void context_BeginRequest(object sender, EventArgs e)
        {
            HttpApplication application = (HttpApplication)sender;
            HttpContext context = application.Context;
    
            if (context.Request.RawUrl.IndexOf("/_layouts/filter.aspx", StringComparison.InvariantCultureIgnoreCase) >= 0)
            {
                string newUrl = context.Request.Url.Scheme+"://"+context.Request.Url.Host + context.Request.RawUrl.Replace("/_layouts/filter.aspx", "/_layouts/CustomFilter.aspx");
                context.Response.Redirect(newUrl);
            }
        }
    
    }
    
  3. You will need to configure this module in the web.config file of your web and register it with IIS before being able to use it. For more information of the whole process see the following link: http://go.microsoft.com/?linkid=8101007. Below are sample lines that you can add to the web.config file:

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
            <add name="ListFilterRedirectModule" type="ListFilterRedirectModule, ... , Version=1.0.0.0, Culture=neutral, PublicKeyToken=..." />
        </modules>
    </system.webServer>
    

다른 팁

You may use this solution from CodePlex: http://metadatapagefilter.codeplex.com/ It has quite some limitations (column must exist as root site, limited to term sets with one level ...) but maybe it can help you.

Read the discussions if you are using IE8 or 9 as it indicates how to work around a infinite loading situation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top