20


通知配置

Sun Java System Content Delivery Server 为内容开发者提供了有关他们所提交的内容的通知,并为订户提供了有关更新和促销的通知。您可以确定发送到内容开发者的通知类型以及订户的 opt-in 默认值。

本章包含以下主题:


20.1 配置开发者通知

开发者可以通过 Developer Portal 将内容提交到 Content Delivery Server。可以将 Content Delivery Server 设置为只要对开发者提交的内容进行操作时就向其发送电子邮件通知。

要设置通知,请执行以下操作:

1. 确保 $CDS_HOME/deployment/deployment-name/conf/CDS.properties 文件中的 default.external.developerportal.uri 属性指向 Developer Portal 所在的位置。

请使用格式 http://hostname:port/developer/,其中 hostname:port 是运行 Developer Portal 的主机的名称和端口号。

2. 设置 $CDS_HOME/deployment/deployment-name/conf/EventService.properties 文件中的以下属性。

3. (可选)定制发送的通知。

您可以通过编辑随 Content Delivery Server 提供的默认模板或创建自己的 XSL 文件来定制通知。

代码样例 20-1 提供了可以使用的通知模板的定义。如果您要创建自己的文件,则必须更新上一步骤中说明的标识文件位置的属性。


代码样例 20-1 通知模板的定义
/*
 * Definition of XML documents that are piped to the
 * XSL transformation sheets.
 *
 * <dn>
 *  <developer>Joe Developer</developer>
 *
 *  <submission> <!-- when content was submitted (even if failed) -->
 *    <succeeded> <!-- may be zero or more -->
 *      <name>Name used to submit</name>
 *      <id>ID used to submit</id>
 *      <url>URL this content is viewable at</url>
 *    </succeeded>
 *    <failed> <!-- may be zero or more -->
 *      <name>Name used to submit</name>
 *      <id>ID used to submit</id>
 *      <errormsg>Error message</errormsg>
 *      <errorlog>Lengthy error info</errorlog>
 *    </failed>
 *  <submission>
 *
 *  <statuschanged>
 *
 *    <!-- The possible status values are:
 *
 *    pending
 *    denied
 *    published
 *    unpublished
 *    deleted
 *    new
 *
 *    -->
 *
 *    <newstatus>status</newstatus>
 *
 *    <name>Name used to submit</name>
 *    <id>content id</id>
 *    <url>URL where this content is accessible</url>
 *    <message>Message left for developer</message>
 *  </statuschanged>>
 *
 *  <propertychanged>
 *    <name>Name used to submit</name>
 *    <id>content id</id>
 *    <url>URL where this content is accessible</url>
 *    <textproperty> <!-- zero or more of those -->
 *      <name>property name</name>
 *      <oldvalue>old property value</oldvalue>
 *      <newvalue>new property value</newvalue>
 *    </textproperty>
 *
 *    <!-- binary property is special, since it doesn't have a
 *         displayable value, so only name is mentioned.
 *    -->
 *    <binaryproperty>property name</binaryproperty> <!-- zero or
 *           more -->
 *    <priceproperty> <!-- zero or one of this, only for suggested
 *           price -->
 *      <!-- note the pricedata tag. It is used to unify the
 *           structure to make XSLT transformation easier.
 *      -->
 *      <oldvalue><pricedata>
 *        <billing1>
 *          <!-- the following is $13.27, but helps localization
 *               if broken in such a way. There is also a "number"
 *               tag which gives the price in cents (coins)
 *           -->
 *          <price>
 *            <number>1327</number>
 *            <bills>13</bills>
 *            <coins>27</coins>
 *          </price>
 *          <usage_count>usage_count</usage_count>
 *         <usage_period_days>usage_period_days</usage_period_days>
 *          <recurring>recurring</recurring>
 *        </billing1>
 *        <billing2>
 *          <price><bills>13</bills><coins>27</coins></price>
 *          <frequency>frequency</frequency>
 *          <recurring>recurring</recurring>
 *        </billing2>
 *        <billing3>
 *          <price><bills>13</bills><coins>27</coins></price>
 *          <usage_count>usage_count</usage_count>
 *        </billing3>
 *      </pricedata></oldvalue>
 *      <newvalue><!-- the same as for oldvalue --> </newvalue>
 *    </priceproperty>
 *
 *  </propertychanged>
 *
 *  <adminemail>Email address developer can inquire at</adminemail>
 * </dn>
 */

 


20.2 为订户通知配置默认值

Content Delivery Server 会将关于更新或促销的通知发送给订户。订户在设置帐户首选项时,可以通过设置选项来选择接收这些通知。可以将默认值设置为 opt-in 或 opt-out。初始默认值为 opt-in。

要更改默认的选项,需要设置 $CDS_HOME/deployment/deployment-name/conf/security.config 文件中的 user.profile.optin 属性。将该属性设置为 true 表示将默认值设置为 opt-in。将该属性设置为 false 表示将默认值设置为 opt-out。