0

「contactInfo」アイテムを継承して新しいアイテム記述子を作成しようとしています..以下に示すようなもの..

<item-descriptor name="testContactInfo" super-type="contactInfo">
    <table name="test_contact_info" type="auxiliary" id-column-name="contact_id" shared-table-sequence="1">
        <property name="fixedlinenumber" column-name="fixed_line_num" data-type="string"/>
    </table>
</item-descriptor>

サーバーを起動すると、次のエラーが表示されます。

14:19:52,856 ERROR [ProfileAdapterRepository] Error parsing template: atg.repository.RepositoryException: Your item-descriptor definition for testContactInfo has super-type contactInfo but no sub-type attribute.

ここで何が間違っていますか?定義をuserProfile.xmlに保持しました

4

2 に答える 2

1

最初の質問: 実際に contactInfo アイテム記述子のサブタイプを作成しようとしていますか? つまり、システム内に contactInfo タイプのアイテムと testContactInfo タイプのアイテムがいくつかあることを期待していますか? それとも、追加しようとしているだけですか?既存の contactInfo アイテム記述子へのカスタム プロパティ?

実際に contactInfo のサブタイプを作成しようとしている場合は、contactInfo の記述子を変更して、contactInfo 型のアイテムと testContactInfo 型のアイテムを区別する方法を指定する必要があります。contactType などのプロパティを contactInfo に追加し、sub-type-property 属性を設定する必要があります。

<item-descriptor name="contactInfo" sub-type-property="contactType" ...>
  ...
  <property name="contactType" data-type="enumerated">
    <option value="standard"/>
    <option value="test"/>
  </property>
  ...
</item-descriptor>

そして、あなたはそれをサブタイプすることができます

<item-descriptor name="testContactInfo" super-type="contactInfo" sub-type-value="test">
  ...
</item-descriptor>

ただし、カスタム プロパティを追加するだけの場合は、既存の定義に追加することができます。既製のアイテムを拡張するためにサブタイプを指定する必要はありません。例えば

<item-descriptor name="contactInfo">
  <table name="test_contact_info" type="auxiliary" id-column-name="contact_id" shared-table-sequence="1">
    <property name="fixedlinenumber" column-name="fixed_line_num" data-type="string"/>
  </table>
</item-descriptor>

これにより、fixedlinenumber という新しいプロパティが標準の contactInfo アイテムに追加されます。

于 2012-09-21T13:53:36.217 に答える
0

アイテム記述子の継承は、2 つの方法で行うことができます。あなたはできる:-

  1. 既存の項目記述子に新しいプロパティを追加します。ここでは、既存の項目記述子に多くのプロパティを追加できます。これは、すぐに使用できるものでも、カスタム リポジトリでもかまいません。

たとえば、すべての contactInfo 項目で使用できる contactInfo 項目記述子に employeeId プロパティを設定できます。

  1. item-descriptor のサブタイプを作成します。これは一般に、特定の項目記述子に固有のプロパティを持たせるために使用されます。

たとえば、contactInfo タイプでは、追加の従業員 ID を格納する「employeeContactInfo」を使用でき、このタイプ専用の「employeeId」を使用できます。

したがって、基本的には要件に依存します。このウェブサイトでいくつかの詳細を見ることができます..素敵なチュートリアル:-

http://learnoracleatg.blogspot.in/2014/11/art203-how-to-extend-out-of-box-non.html および http://learnoracleatg.blogspot.in/2014/12/art204-how- to-add-new-item-descriptor.html

于 2014-12-08T13:34:10.000 に答える