基本的なカスタマイズ > ユーザーインタフェースのカスタマイズ > UI の情報の表示 > JSP フレームワークを使用したテーブルの構築とレンダリング > ソリューション > ソリューションエレメント > MVC への既存のテーブル実装の変換
  
MVC への既存のテーブル実装の変換
概要
このセクションでは、9.x レガシータグから新規 MVC テーブルビルダーの対応する属性への属性マッピングについて説明します。
describeTable
describeTable タグのコンテンツは ComponentConfigBuilder インタフェースの buildComponentConfig メソッドで指定されています。
JSP は、このようになっていました:
<jca:describeTable var="tableDescriptor" id="netmarkets_project_list"
configurable="true"
type="wt.projmgmt.admin.Project2" label="${projectListLabel}">
MVC コードは、このようになります:
@ComponentBuilder(“netmarkets_project_list”)
public class ProjectListBuilder extends AbstractConfigurableTableBuilder {
@Override
public ComponentConfig buildComponentConfig(ComponentParams params) {
ComponentConfigFacory factory = getComponentConfigFactory();
TableConfig table = factory.newTableConfig();
table.setLabel(ClientMessage.get(RESOURCE,"PROJECT_LIST_NAME");
table.setType("wt.projmgmt.admin.Project2");

return table;
}
describeColumn
describeColumn タグのコンテンツも ComponentConfigBuilder インタフェースの buildComponentConfig メソッドで指定されています。列コンポーネントはテーブルコンポーネントの子コンポーネントなので、テーブルコンフィギュレーションに追加されます。
JSP は、このようになっていました:
<describeTable var="tableDescriptor" type="wt.part.WTPart"
id=" test.table" label="testTable" >
<describeColumn id="name" sortable=”true”/>
<describeColumn id="number"/>
</describeTable>
MVC コードは、このようになります:
TableConfig table = factory.newTableConfig();

table.addComponent(factory.newColumnConfig(“name”,true));
table.addComponent(factory.newColumnConfig(“number”,false));

renderTable
renderTable タグのコンテンツも ComponentConfigBuilder インタフェースの buildComponentConfig メソッドで指定されています。
JSP は、このようになっていました:
<jca:renderTable showCustomViewLink="false" model="${tableModel}" showCount="true"
showPagingLinks="true" />
MVC コードは、このようになります:
TableConfig table = factory.newTableConfig();

table.setShowCount(true);
table.setShowCustomViewLink(false);

getModel
getModel タグのコンテンツは ComponentDataBuilder インタフェースの buildComponentData メソッドで指定されています。
JSP は、このようになっていました:
<jca:getModel var="tableModel" descriptor="${tableDescriptor}"
serviceName="com.ptc.netmarkets.projmgmt.ProjectCommands"
methodName="getProjects" ……. >
<jca:addServiceArgument value="${user}" type="wt.org.WTUser"/>
<jca:addServiceArgument value="${pseudoType}" type="java.lang.Integer"/>
</jca:getModel>
MVC コードは、このようになります:
@Override
public QueryResult buildComponentData(ComponentConfig config,
ComponentParams params) {
WTPrincipal user = SessionHelper.getPrincipal();
return ProjectCommands.getProjects(user,0)
}