使用 XML 配置接口创建 Web 内容页面
与其他门户网站页面一样,您可以使用 XML 配置接口(xmlaccess 命令)来创建 Web 内容页面。 页面定义与标准门户网站页面相似。但是,增加了页面参数,用于指定与 Web 内容页面相关联的站点区域。
过程
- 创建 xmlaccess 命令时,像对标准门户网站页面一样指定页面参数。
以下代码块是指定页面参数的示例:
<content-node action="update" content-parentref="parentOID" domain="rel" objectid="someOID" preserve-old-layout="true" type="page"> <content-mapping-info> <content-mapping content-id="/mylibrary2/sitearea2" default="true" delegated-access-level="User"/> <content-mapping content-id="ddccb7ed-8485-48c8-b875-31d17d9da65b" default="false"/> </content-mapping-info> </content-node>注: content-id 属性的值可以是 Web 内容项的标识,也可以是指向此内容项的路径。如果您正在使用内容路径,那么此值必须以正斜杠字符 (/) 开头,后跟库名。使用内容路径来创建 Web 内容页面时,无法通过路径中项的显示标题字段来构建路径。指定路径时,您必须使用项的名称字段。 - 因为 Web 内容查看器使用公用呈示参数来标识要呈示的内容,所以在创建 xmlaccess 命令时请包括页面参数 param.sharing.scope。
将此参数的值设置为 ibm.portal.sharing.scope.page。
以下代码块是使用 XML 配置接口时 Web 内容页面的参数定义示例:
<parameter name="com.ibm.portal.wcm.contentroot" type="string" update="set"> <![CDATA[/mylib/mysite/mysitearea]]> </parameter> <parameter name="param.sharing.scope" type="string" update="set"> <![CDATA[ibm.portal.sharing.scope.page]]> </parameter> - 创建 xmlaccess 命令时,请至少添加一个所配置的用于侦听其他 Portlet 并进行动态广播的 Web 内容查看器。 添加查看器可确保正确呈示为此页面选择的内容,并且页面之间的链接有效。以下代码块是说明了如何使用 XML 配置接口来添加 Web 内容查看器的示例:
<component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_U796BB1A0OS250IOS7F1BP3081" ordinal="100" orientation="H" skinref="undefined" type="container" width="undefined"> <component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_U796BB1A0OS250IOS7F1BP3085" ordinal="100" orientation="V" skinref="undefined" type="container" width="undefined"> <component action="update" active="true" deletable="undefined" domain="rel" modifiable="undefined" objectid="7_U796BB1A0OS250IOS7F1BP3087" ordinal="100" skinref="undefined" type="control" width="undefined"> <portletinstance action="update" domain="rel" objectid="5_U796BB1A0OS250IOS7F1BP3083" portletref="3_U796BB1A008OD0IOS2ODAD28U4"> <preferences name="WCM_BROADCASTS_TO" update="set"> <value><![CDATA[WCM_LINKING_DYNAMIC]]></value> </preferences> <preferences name="WCM_LISTENS_TO" update="set"> <value><![CDATA[WCM_LINKING_OTHER]]></value> </preferences> </portletinstance> </component> </component> </component>迁移说明: 在 V6.1.5 之后,XML 配置界面用来表示 Web 内容页面的内容关联的格式已更改。通常,在迁移过程中会将现有的所有 Web 内容页面自动转换为更新后的格式。但是,如果您迁移之后在更旧的门户网站上创建 Web 内容页面,然后将这些页面导入到 V8.5 门户网站,那么页面格式将不兼容。在这种情况下,您必须在 V8.5 门户网站上手动运行 action-migrate-content-mappings 配置任务,以便将新的 Web 内容页面转换为 V8.5 格式。要执行此转换,请从 wp_profile_root/ConfigEngine 目录运行以下任务:- Windows:ConfigEngine.bat action-migrate-content-mappings -DWasPassword=password -DPortalAdminPwd=password
- UNIX: ./ConfigEngine.sh action-migrate-content-mappings -DWasPassword=password -DPortalAdminPwd=password
- IBM® i:ConfigEngine.sh action-migrate-content-mappings -DWasPassword=password -DPortalAdminPwd=password