基本的なカスタマイズ > ユーザーインタフェースのカスタマイズ > Windchill JSP フレームワークを使用した HTML クライアントのカスタマイズ > タイプロードファイルでのレイアウトの定義
  
タイプロードファイルでのレイアウトの定義
1. タイプにはデフォルトレイアウトがいくつありますか。
どのタイプも、プロフィールやスクリーンと関連付けられていないデフォルトレイアウトを 1 つだけ持ちます。
2. サブタイプはどのようにしてレイアウトを継承できますか。
レイアウトはサブタイプによって自動的に継承されます。つまり、サブタイプ間で同じレイアウトを再定義する必要はありません (再定義すると、実際に予想外の結果が生じることがあります。ポイント 4 を参照してください)。サブタイプが同じレイアウトを共有する場合は、タイプ階層ツリーでそのレイアウトを 1 つ上に移動することを検討してください。
3. 継承したレイアウトをサブタイプで更新できますか。
はい。サブタイプで <csvtypeContext>Parent-Type-Name</csvtypeContext> タグを使ってレイアウトを定義すると、サブタイプでレイアウトをオーバーライドすることになります。オーバーライドすると、既存のレイアウトに新しいグループを追加したり、既存のグループに新しい (継承または非継承) 属性を追加したり、座標のようなグループまたはグループメンバーのプロパティを再定義したりできます。
4. サブタイプで独自のレイアウトを作成できますか。
はい。<csvtypeContext/> タグを空のままにしておくか、このタグにサブタイプ名を設定すると、サブタイプのコンテキスト内にレイアウトを作成することになります。サブタイプで独自のレイアウトを作成すると、独自コンテキスト内で同じ継承したレイアウトを定義したとしても、親タイプからレイアウトを継承しなくなり、すべての継承したレイアウトから切り離されます。
5. サブタイプのレイアウトに新しい属性を追加するにはどうしますか。
継承した場合もしていない場合も、グループメンバーとして定義された属性はそのタイプに最初に存在している必要があります。つまり、新しい (継承していない) 属性をサブタイプのレイアウトに追加する場合は、まずサブタイプにその属性を作成する必要があります。
6. バッチ属性をロードする動的グループを作成するにはどうしますか。
isStatic を false に設定して、グループメンバーを 0 個または 1 個持つ動的グループを作成します。このグループメンバーは、LWCAttributeSetAttribute クラスの属性である必要があります。このクラスはバッチ属性 (SCA|ALL_IBAS など) を指す "マッピング" プロパティを持っていることがあります。
ファイルのロードの例
次の例は、レイアウトとそのメタデータを wt.change2.WTChangeOrder2 タイプに追加します。
!-- beginning to define a new layout -->
csvBeginLayoutDefView handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
beginProcessLayoutDefinition">
csvname>mini_info_page_layout/csvname> !-- name of the layout -->
csvisDefault>false/csvisDefault> !-- whether this is the default layout to use -->
csvtypeContext>/csvtypeContext> !-- By default, it's the current type.
It is a must have to indicate an inherited layout -->
csvdefaultGroup>groupA/csvdefaultGroup> !-- the default group of the layout,
has to be one of the groups defined below -->
csvprofiles>/csvprofiles> !-- a combination of typeContext, profiles, and screens
uniquely identifies a layout -->
csvscreens>Mini_Info_Page/csvscreens> !-- available screens must have been
defined in the BaseDefinitionLoader.xml -->
/csvBeginLayoutDefView>

!-- beginning of defining a group within the layout -->
csvBeginGroupDefView handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
beginProcessGroupDefinition">
csvname>groupA/csvname> !-- name of the group, uniquely identify a
group within a layout -->
csvisStatic>true/csvisStatic> !-- in most cases, it's true -->
csvstyle>List/csvstyle> !-- available group styles must have been defined in the
BaseDefinitionLoader.xml -->
/csvBeginGroupDefView>

!-- defining properties of the group: 3 in total -->
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">
csvname>displayName/csvname> !-- name of the property -->
csvvalue>groupA/csvvalue> !-- value -->
csvlocale_en_us>EN_US groupA/csvlocale_en_us> !--
the following are localized values -->
csvlocale_en_gb>EN_GB groupA/csvlocale_en_gb>
csvlocale_fr>FR groupA/csvlocale_fr>
csvlocale_de>DE groupA/csvlocale_de>
csvlocale_es>ES groupA/csvlocale_es>
csvlocale_ja>JA groupA/csvlocale_ja>
csvlocale_it>IT groupA/csvlocale_it>
csvlocale_ko>KO groupA/csvlocale_ko>
csvlocale_zh_cn>ZH_CN groupA/csvlocale_zh_cn>
csvlocale_zh_tw>ZH_TW groupA/csvlocale_zh_tw>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">csvname>description/csvname>
csvvalue>groupA/csvvalue>
csvlocale_en_us>EN_US groupA/csvlocale_en_us>
csvlocale_en_gb>EN_GB groupA/csvlocale_en_gb>
csvlocale_fr>FR groupA/csvlocale_fr>
csvlocale_de>DE groupA/csvlocale_de>
csvlocale_es>ES groupA/csvlocale_es>
csvlocale_ja>JA groupA/csvlocale_ja>
csvlocale_it>IT groupA/csvlocale_it>
csvlocale_ko>KO groupA/csvlocale_ko>
csvlocale_zh_cn>ZH_CN groupA/csvlocale_zh_cn>
csvlocale_zh_tw>ZH_TW groupA/csvlocale_zh_tw>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">
csvname>sort_order/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>

!-- beginning of defining a membership of the group: -->
csvBeginGroupMemberView handler="com.ptc.core.lwc.server.TypeDefinitionLoader
.beginProcessGroupMembership">
csvname>number/csvname>
/csvBeginGroupMemberView>

!-- beginning of defining properties (coordinates) of the membership -->
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>col_coord/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>row_coord/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>col_span/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>row_span/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>

!-- ending of defining a membership of the group -->
csvEndGroupMemberView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader. endProcessGroupMembership"/>
!-- more memberships can be defined here -->
!-- ending of defining a group within the layout -->
csvEndGroupDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessGroupDefinition"/>
!-- more groups can be defined here -->
!-- ending of defining a new layout -->
csvEndLayoutDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessLayoutDefinition"/>
!-- more layouts can be defined here -->
!-- ending of defining a type -->
csvEndTypeDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessTypeDefinition"/>