設定は、サービス設定を保存するためのロジックと構造を提供するようにデザインされています。
既存のインスタンスを拡張して、独自の設定を作成できます。
設定の作成に用いられる原則は、以下の概念に基づいています。
設定のベースパスは次のとおりです。
/etc/cloudservices
設定のタイプごとに、テンプレートとコンポーネントが提供されます。これによって、カスタマイズしてから大部分のニーズを満たせる設定テンプレートを作成できます。
新しいサービス用の設定を行うには:
次の場所にサービスページを作成します。
/etc/cloudservices
この下に次のコンポーネントを作成します。
テンプレートとコンポーネントは、sling:resourceSuperType
をそれぞれ次の場所から継承する必要があります。ベーステンプレート:
cq/cloudserviceconfigs/templates/configpage
ベースコンポーネント:
cq/cloudserviceconfigs/components/configpage
サービスプロバイダーは、サービスページも提供する必要があります。
/etc/cloudservices/<service-name>
テンプレートは、次のベーステンプレートを拡張します。
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
コンポーネントは、次のベースコンポーネントを拡張します。
cq/cloudserviceconfigs/templates/configpage
/libs/cq/analytics/components/sitecatalystpage
/libs/cq/analytics/components/generictrackerpage
テンプレートとコンポーネントを設定したら、次の場所の下にサブページを追加して、設定を追加できます。
/etc/cloudservices/<service-name>
コンテンツモデルは、次の場所の下に 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 に関する参考ドキュメントは、com.day.cq.wcm.webservicesupport を参照してください。
使用可能なサービスが、(foundation/components/page
または wcm/mobile/components/page
から継承されたいずれかのページの)ページのプロパティダイアログの「クラウドサービス」タブに一覧表示されます。
このタブでは以下についても表示されます。
サービスのユーザー資格情報を保存する際は、すべてのパスワードを暗号化する必要があります。
非表示のフォームフィールドを追加することによって、パスワードを暗号化できます。このフィールドでは、プロパティ名にアノテーション @Encrypted
が必要です。すなわち、password
フィールドの場合、名前は次のようになります。
password@Encrypted
すると、CryptoSupport
によって、プロパティが(EncryptionPostProcessor
サービスを使用して)自動的に暗号化されます。
これは、標準の [SlingPostServlet](https://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html)
アノテーションに似ています。
デフォルトでは、EcryptionPostProcessor
は、/etc/cloudservices
に対する POST
リクエストのみを暗号化します。
プロパティ | 説明 |
componentReference | コンポーネントへの参照パスをページに自動的に含めます。 追加機能および JS インクルージョンに使用されます。 このプロパティには、 cq/cloudserviceconfigs/components/servicecomponents が(通常は body タグの前に)含まれるページ上のコンポーネントが含まれます。Analytics および Target の場合、このプロパティを使用して、訪問者の行動を追跡する JavaScript 呼び出しなどの追加機能を含めます。 |
description | サービスの簡単な説明。 |
descriptionExtended | サービスの詳細な説明。 |
ranking | 一覧表示に使用するサービスランキング。 |
selectableChildren | ページのプロパティダイアログに設定を表示するためのフィルター。 |
serviceUrl | サービス Web サイトへの URL。 |
serviceUrlLabel | サービス URL のラベル。 |
thumbnailPath | サービスのサムネールへのパス。 |
visible | ページのプロパティダイアログでの表示/非表示。デフォルトでは表示(オプション)。 |
デフォルトでは、以下のサービスが提供されます。
カスタムクラウドサービスの作成も参照してください。