クラウドサービス設定 cloud-service-configurations

設定は、サービス設定を保存するためのロジックと構造を提供するようにデザインされています。

既存のインスタンスを拡張して、独自の設定を作成できます。

概念 concepts

設定の作成に用いられる原則は、以下の概念に基づいています。

  • サービスやアダプターを使用して、設定を取得する。
  • 設定(プロパティや段落など)は、親から継承される。
  • パスによって、分析ノードから参照される。
  • 簡単に拡張できる。
  • Adobe Analytics など、より複雑な設定に対応できる柔軟性がある。
  • 依存関係のサポート(例:Adobe Analytics プラグインには Adobe Analytics 設定)。

構造 structure

設定のベースパスは次のとおりです。

/etc/cloudservices

設定のタイプごとに、テンプレートとコンポーネントが提供されます。 これによって、カスタマイズしてから大部分のニーズを満たせる設定テンプレートを作成できます。

新しいサービス用の設定を行うには、以下の操作を実行します。

  • 次の場所にサービスページを作成します。

    /etc/cloudservices

  • この下に次のコンポーネントを作成します。

    • 設定テンプレート
    • 設定コンポーネント

テンプレートとコンポーネントは、sling:resourceSuperType をそれぞれ次の場所から継承する必要があります。ベーステンプレート:

cq/cloudserviceconfigs/templates/configpage

ベースコンポーネント:

cq/cloudserviceconfigs/components/configpage

サービスプロバイダーは、サービスページも提供する必要があります。

/etc/cloudservices/<service-name>

テンプレート template

テンプレートは、次のベーステンプレートを拡張します。

cq/cloudserviceconfigs/templates/configpage

そして、カスタムコンポーネントを指す resourceType を定義します。

/libs/cq/analytics/templates/sitecatalyst
sling:resourceSuperType = cq/cloudserviceconfigs/templates/configpage
allowedChildren = /libs/cq/analytics/templates/sitecatalyst
allowedPaths = /etc/cloudservices/analytics/*, /etc/cloudservices/analytics/.*
componentReference = cq/analytics/components/sitecatalyst
jcr:content/
cq:designPath = /etc/designs/cloudservices
sling:resourceType = cq/analytics/components/sitecatalystpage

/libs/cq/analytics/templates/generictracker
sling:resourceSuperType = cq/cloudservices/templates/configpage
allowedChildren = /libs/cq/analytics/templates/generictracker
allowedPaths = /etc/cloudservices/analytics/*, /etc/cloudservices/analytics/.*
jcr:content/
cq:designPath = /etc/designs/cloudservices
sling:resourceType = cq/analytics/components/generictrackerpage

コンポーネント components

コンポーネントは、次のベースコンポーネントを拡張します。

cq/cloudserviceconfigs/templates/configpage

/libs/cq/analytics/components/sitecatalystpage

/libs/cq/analytics/components/generictrackerpage

テンプレートとコンポーネントを設定したら、次の場所の下にサブページを追加して、設定を追加できます。

/etc/cloudservices/<service-name>

コンテンツモデル content-model

コンテンツモデルは、次の場所の下に cq:Page として保存されます。

/etc/cloudservices/<service-name>(/*)

/etc/cloudservices
/etc/cloudservices/service-name
/etc/cloudservices/service-name/config
/etc/cloudservices/service-name/config/inherited-config

設定は、サブノード jcr:content の下に保存されます。

  • ダイアログで定義される固定プロパティは、jcr:node に直接保存する必要があります。
  • (parsys または iparsys を使用する)動的要素は、サブノードを使用してコンポーネントデータを保存します。
/etc/cloudservices/service/config/jcr:content as nt:unstructured
propertyname
*
par/component/ as cq:Component
propertyname
*

API api

API に関する参考ドキュメントは、com.day.cq.wcm.webservicesupport を参照してください。

AEM の統合 aem-integration

使用可能なサービスが、(foundation/components/page または wcm/mobile/components/page から継承されたいずれかのページの)ページのプロパティ​ダイアログの「クラウドサービス」タブに一覧表示されます。

このタブでは以下についても表示されます。

  • サービスを有効にできる場所へのリンク
  • パスフィールドから設定(サービスのサブノード)を選択する

パスワードの暗号化 password-encryption

サービスのユーザー資格情報を保存する際は、すべてのパスワードを暗号化する必要があります。

非表示のフォームフィールドを追加することによって、パスワードを暗号化できます。 このフィールドでは、プロパティ名にアノテーション @Encrypted が必要です。すなわち、password フィールドの場合、名前は次のようになります。

password@Encrypted

すると、CryptoSupport によって、プロパティが(EncryptionPostProcessor サービスを使用して)自動的に暗号化されます。

NOTE
これは、標準の [SlingPostServlet](https://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html) アノテーションに似ています。
NOTE
デフォルトでは、EcryptionPostProcessor は、/etc/cloudservices に対する POST リクエストのみを暗号化します。

サービスページ jcr:content ノードの追加プロパティ additional-properties-for-service-page-jcr-content-nodes

プロパティ
説明
componentReference
ページに自動的に含めるコンポーネントへの参照パス。
これは、追加機能とJSのインクルージョンに使用されます。
これには、
cq/cloudserviceconfigs/components/servicecomponents
が含まれるページ上のコンポーネントが含まれます(通常はbody タグの前)。
Adobe AnalyticsとAdobe Targetの場合は、これを使用して、JavaScript呼び出しなどの追加機能を追加して訪問者の動作を追跡します。
説明
サービスの簡単な説明。
descriptionExtended
サービスの詳細な説明。
ranking
一覧表示に使用するサービスランキング。
selectableChildren
ページのプロパティダイアログに設定を表示するためのフィルター。
serviceUrl
サービス web サイトへの URL。
serviceUrlLabel
サービス URL のラベル。
thumbnailPath
サービスのサムネールへのパス。
visible
ページのプロパティダイアログでの表示/非表示。デフォルトでは表示(オプション)。

ユースケース use-cases

デフォルトでは、以下のサービスが提供されます。

NOTE
カスタムクラウドサービスの作成も参照してください。
recommendation-more-help
experience-manager-65-lts-help-main-toc