私は主に動的なWebサイトを.NETで構築しており、UGCを動的コンポーネントプレゼンテーションと連動させようとしています。私のDCPは、REL出力形式を使用して(ブローカーデータベースに)公開されており、ComponentPresentationAssemblerクラスを使用して消費されています。
DCPには、動的リンクとUGCPostRatingの両方が含まれています。実行時に動的リンクは正常に解決されますが、UGCコードは解決されません。
データベース内のDCPコンテンツの例:
<div>
<h2><tcdl:Link type="Component" origin="tcm:0-0-0" destination="tcm:33-10793" templateURI="tcm:0-0-0" linkAttributes="" textOnFail="true" addAnchor="false" variantId="">Basic Business Checking</tcdl:Link></h2>
<tcdl:PostRating itemURI="tcm:33-10793" postParameter="ratingValuetcm:33-10793">
<tcdl:ItemStats itemURI="tcm:33-10793">
Rating:<tcdl:ContextVariable var="ugcItemStats.averageRating"/> (<tc dl:ContextVariable var="ugcItemStats.numberOfRatings"/> ratings)<br/>
</tcdl:ItemStats>
<form method="post" id="ratingForm">Rate:
<select name="ratingValuetcm:33-10793" size="1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5" selected="true">5</option>
</select>
<input type="submit" value="Rate!"/>
</form>
</tcdl:PostRating>
</div>
.NETページコード:
Query myQuery = new Query();
myQuery.Criteria = andCriteria;
string[] componentPresentationURIs = myQuery.ExecuteQuery();
ComponentPresentationAssembler componentPresentationAssembler = new ComponentPresentationAssembler("tcm:33-10796-64");
foreach (string componentPresentationURI in componentPresentationURIs) {
Response.Write(componentPresentationAssembler.GetContent(componentPresentationURI, strComponentTemplateURI));
}
ページに埋め込まれてデプロイすると、UGCは正常に機能します。
cd_dynamic_conf.xmlは、ugc_renderer_bundle.xmlタグバンドルで構成されます。
レンダリングされたhtmlでは、動的リンクは次のように解決されます。
<a href="/prodigy/business-rewards-checking.aspx" >Business Rewards Checking</a>
ただし、コードはそのままです。
そして、アイデアは大歓迎です。