3

Query.QueryOperator.AND_Field Tridion R5.3 VBscriptテンプレートでこのメソッドを使用していましたが、うまく機能しました。最近、Tridion 2011 SP1に移行する際に、この方法を使用してみましたが、機能しません。この方法は、新しいtridionバージョンでは減価償却されることを理解しました。

フォーラムのいくつかの投稿に従って、CD_Storage_Confで次の行も有効にしました。

<SearchFilter Name="SearchFilter" Class="com.tridion.broker.components.meta.MsSqlSearchFilterHome" defaultStorageId="defaultdb"/> 
<Item typeMapping="Query" storageId="defaultdb"/>

問題は、「Query.QueryOperator.AND_Field」メソッドの置き換えとは何ですか?このフィルターをC#でどのように使用できますか?サポートAPIファイルに記載されているブローカークエリメカニズムを使用するにはどうすればよいですか?

ありがとう。

4

1 に答える 1

6

SDL Tridion 2011コンテンツ配信では、オブジェクトを作成し、メソッドを使用してオブジェクトQueryを追加します。オブジェクトは1つのCriteriaオブジェクトのみを受け入れますが、そのオブジェクトはツリー構造内の他のオブジェクトを参照できます。CriteriasetCriteriaQueryCriteriaCriteria

AND演算子とOR演算子の両方を使用してクエリフィルターを作成する良い例については、SDLLiveContentのSDLTridion2011SP1ドキュメントのフィルターの作成を参照してください。

// Schema has ID of either 511 (Article) or 34 (Press Release).
ItemSchemaCriteria IsArticle = new ItemSchemaCriteria(511);
ItemSchemaCriteria IsPressRelease = new ItemSchemaCriteria(34);
Criteria IsArticleOrPressRelease = CriteriaFactory.Or(IsArticle, IsPressRelease);

// Type of the item is 16 (Component).
ItemTypeCriteria IsComponent = new ItemTypeCriteria(16);

// Both of the above conditions must be true
Criteria AllCriteria = CriteriaFactory.And(IsArticleOrPressRelease, IsComponent);

// Add these criteria to a query
Query MyQuery = new Query();
MyQuery.Criteria = AllCriteria;
于 2012-09-12T16:01:54.183 に答える