配置旨在提供用于存储服务配置的逻辑和结构。
您可以扩展现有实例以创建您自己的配置。
在开发配置时使用的原则基于以下概念:
配置的基本路径是:
/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.
可用服务列在 Cloud Services 选项卡 页面属性 对话框(从 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
仅加密 POST
发出的请求 /etc/cloudservices
.
属性 | 描述 |
componentReference | 要自动包含在页面中的组件的引用路径。 此插件可用于其他功能和JS包含项。 这包括页面上的组件,其中 cq/cloudserviceconfigs/components/servicecomponents 包含(通常在 body 标记)。对于Analytics和Target,我们使用此功能包含其他功能,例如用于跟踪访客行为的JavaScript调用。 |
说明 | 服务的简短描述。 |
descriptionExtended | 服务的扩展描述。 |
排名 | 用于列表的服务排名。 |
selectableChildren | 在“页面属性”对话框中显示配置的过滤器。 |
serviceUrl | 服务网站的URL。 |
serviceUrlLabel | 服务URL的标签。 |
thumbnailPath | 服务的缩略图路径。 |
可见 | 页面属性对话框的可见性;默认可见(可选) |
默认情况下,会提供以下服务:
另请参阅 创建自定义Cloud Service.