メタデータの末尾にスキップ
メタデータの先頭に移動

このページの古いバージョンを表示しています。現在のバージョンを表示します。

現在のバージョンとの相違点 View Version History

バージョン 1 現在のバージョン »

コンポーネントインスタンスは、コンポーネントとコンポーネントのマークアップの生成を担当するレンダリングエンジンの間のバインディングを記述します。 通常、レンダリングエンジンは Surf Webスクリプトエンジンです。

場所

  • classpath:/alfresco/site-data/components
  • classpath:/alfresco/web-extension/site-data/components

定義

<component>
  <!-- Required -->
  <scope>page | template | global</scope>
  <region-id>REGION_ID</region-id>
  <source-id>SOURCE_ID</source-id>

  <!-- Optional -->
  <url>URL</url>
  <component-type-id>COMPONENT_TYPE_ID</component-type-id>
  <chrome>CHROME_ID</chrome>
</component>

プロパティ

  • <id> - 規則にのっとったコンポーネントID
    • ページおよびテンプレートスコープリージョンのバインディングの場合、規則は <scope>.<region-id>.<source-id>
    • グローバルスコープ内のリージョンへのバインディングの場合、規則は global.<region-id>
  • <scope> - バインディングの範囲(ページ、テンプレート、グローバル)
  • <region-id> - バインドされている領域の名前
  • <source-id> - コンポーネントがバインドされているページまたはテンプレートインスタンスのID。 グローバルスコープの場合、global に設定する必要があります。

オプションプロパティ

  • <url> - WebスクリプトのURL(Webスクリプトがレンダリングされている場合)
  • <component-type-id> - このコンポーネントのコンポーネントタイプID
  • <chrome> - このコンポーネントのプレゼンテーションのフレームに使用されるChromeのID

例 - ページスコープバインディング

このコンポーネントは /sample/content という URL を持つ Webスクリプトを home ページの content という名前のページスコープの領域にバインドします。 したがって、 page.content.home の ID を持ちます。

classpath:/alfresco/web-extension/site-data/compnents/page.content.home.xml

<?xml version="1.0" encoding="utf-8"?>
<component>
  <id>page.content.home</id>
  <scope>page</scope>
  <region-id>content</region-id>
  <source-id>home</source-id>
  <url>/sample/content</url>
</component>

例 - テンプレートスコープバインディング

この例では/sample/header という URL を持つ Webスクリプトを home テンプレートの header というテンプレートスコープの領域にバインドします。したがって、 template.header.home の ID を持ちます。

classpath:/alfresco/web-extension/site-data/compnents/template.header.home.xml

<?xml version="1.0" encoding="utf-8"?>
<component>
  <id>template.header.home</id>
  <scope>template</scope>
  <region-id>header</region-id>
  <source-id>home</source-id>
  <url>/sample/header</url>
</component>

例 - グローバルスコープバインディング

この例では /sample/footer という URL を持つ Webスクリプトを footer という名前のグローバルスコープの領域にバインドします。 したがって、global.footer の ID があります。

classpath:/alfresco/web-extension/site-data/compnents/global.footer.xml

<?xml version="1.0" encoding="utf-8"?>
<component>
  <id>global.footer</id>
  <scope>global</scope>
  <region-id>footer</region-id>
  <source-id>global</source-id>
  <url>/sample/footer</url>
</component>

例 - カスタムページスコープバインディング

この例では /sample/content URL を持つ Webスクリプトを home ページの content という名前のページスコープ領域にバインドします。Surf はレンダリング時に Component をカスタムコンポーネントの Chrome でラップするよう通知します。また、Webスクリプトが実行中に使用できるいくつかのカスタムプロパティを提供します

classpath:/alfresco/web-extension/site-data/compnents/page.content.home.xml

<?xml version="1.0" encoding="utf-8"?>
<component>
  <id>page.content.home</id>
  <scope>page</scope>
  <region-id>content</region-id>
  <source-id>home</source-id>
  <url>/sample/content</url>
  <chrome>sample-chrome</chrome>
  <properties>
    <view>FULL</view>
    <style>formal</style>
  </properties>
</component>

原文:Component

  • ラベルがありません