XMLAccess简介
/xmlaccess.sh 参数:
EJPXB0001I: 命令行参数: -in <xml input file> [-user <username>] Will be queried over the console, if omitted [-password <password>] Will be queried over the console, if omitted [-out <output file>] default: write to stdout [-url <portal config url>] default: http://localhost/wps/config [-attempts <max connection attempts>] default: 1 attempt, no retries [-truststore <filename of the trust store for HTTPS>] default: $JAVA_HOME/lib/security/cacerts [-trustpwd <password for the trust store for HTTPS>] default: <empty> [-trusttype <filetype of the trust store for HTTPS>] default: jks [-keystore <filename of the key store for HTTPS>] default: $JAVA_HOME/lib/security/cacerts [-keypwd <password for the key store for HTTPS>] default: <empty> [-keytype <filetype of the key store for HTTPS>] default: jks [-credentialexport] enables export and import of credential secrets [-encryptionPassphrase <passphrase>] passphrase for credential encryption and decryption [-echo] simply return input instead of processing it
迁移门户网站的Portlet,(包括Portlet的权限)
从门户网站中导出内容的命令:
操作系统 |
命令 |
Windows |
xmlaccess.bat -in ExportRelease.xml -user wpsadmin -password wpsadminpwd -url http://hostname:port/wps/ config/virtualportalContext -out virtualportal_output.xml |
UNIX |
./xmlaccess.sh -in ExportRelease.xml -user wpsadmin -password wpsadminpwd -url http://hostname:port/wps/ config/virtualportalContext -out virtualportal_output.xml |
IBM i |
xmlaccess.sh -in ExportRelease.xml -user wpsadmin -password wpsadminpwd -url http://hostname:port/wps/ config/virtualportalContext -out virtualportal_output.xml |
导入到门户网站的命令
操作系统 |
命令 |
Windows |
xmlaccess.bat -in virtualportal_output.xml -user wpsadmin -password wpsadminpwd -url http:// hostname:port/wps/config/virtualportalContext -out Output.xml |
UNIX |
./xmlaccess.sh -in virtualportal_output.xml -user wpsadmin -password wpsadminpwd -url http:// hostname:port/wps/config/virtualportalContext -out Output.xml |
IBM i |
xmlaccess.sh -in virtualportal_output.xml -user wpsadmin -password wpsadminpwd -url http:// hostname:port/wps/config/virtualportalContext -out Output.xml |
xml-samples:
在一下目录中可以找到xml的样例文件
/usr/IBM/WebSphere/PortalServer/doc/xml-samples
导出门户网站的Portlet
案例:
XX联通:
/usr/IBM/WebSphere/PortalServer/bin/xmlaccess.sh -in ExportAllPortlets.xml -user wpsbind -password 1qazcde3 -url http://10.68.20.83:10038/wps/config -out Out_ExportNMunicom.xml
/usr/IBM/WebSphere/AppServer/profiles/wp_profile/installedApps/wps01/wps.ear/wps.war/themes/html/NMUnicomNew
看下导出的portel xml文件:
上面截图是导出所有,也就是Object,使用的模板是 ExportAllPortlets.xml
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd" type="export"> <!-- Example for using the * wildcard to export all resources of a given type. This script exports all Web modules (and their contained portlets) that are defined in the portal. --> <portal action="locate"> <web-app objectid="*" action="export"/> </portal> </request>
从上面的notepadd++编辑器里看到 我们要导出的portel的uid为
uid="com.ibm.chinaunicomportletv2.ChinaUnicomPortletV2Portlet.f7afb8e112.webmod
所有我们将xml模板修改为:
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd" type="export"> <!-- Example for using the * wildcard to export all resources of a given type. This script exports all Web modules (and their contained portlets) that are defined in the portal. --> <portal action="locate"> <web-app action="export" uid="com.ibm.chinaunicomportletv2.ChinaUnicomPortletV2Portlet.f7afb8e112.webmod"/> </portal> </request>
Out_ExportNMunicom.xml 内容:
<?xml version="1.0" encoding="UTF-8"?> <!-- IBM WebSphere Portal/6.0.1.1 build wp6011_073 exported on Fri Mar 14 15:24:10 GMT+08:00 2014 from wps02/10.68.20.82 --> <!-- 1 [web-app 1_HBNK7F5408VNA0IO3KP8UO00K5] --> <!-- 2 [servlet V_HBNK7F5408VNA0IO3KP8UO0024] --> ...... <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" build="wp6011_073" type="update" version="6.0.1.1" xsi:noNamespaceSchemaLocation="PortalConfig_6.0.1.xsd"> <portal action="locate"> <web-app action="update" active="true" domain="rel" objectid="1_HBNK7F5408VNA0IO3KP8UO00K5" removable="true" uid="com.ibm.chinaunicomportletv2.ChinaUnicomPortletV2Portlet.f7afb8e112.webmod"> <url>file://localhost/$user_install_root$/PortalServer/deployed/archive/com.ibm.chinaunicomportletv2.ChinaUnicomPortletV2Portlet.f7afb8e112.webmod/ChinaUnicomPortletV2.war</url> <access-control externalized="false" owner="uid=wpsbind,cn=apps,dc=nm,dc=unicom" private="false"/> ...... <localedata locale="ar"> <title>com.ibm.chinaunicomportletv2.ChinaUnicomPortletV2Portlet.f7afb8e112</title> </localedata> .....
注意:<url>标签里相对路径的地址。
导入门户网站的Portlet
导入:
[root@wpstest bin]# ./xmlaccess.sh -in /data/IBM/Out_ExportNMunicom.xml -user wpadmin -password password -url http://172.16.89.7:10040/wps/config -out output_all.xml
导入成功:
后台日志
这样portel就全部导入了。
访问portal管理控制台查看如下
导出Portal的页面
# /usr/IBM/WebSphere/PortalServer/bin/xmlaccess.sh -in ExportPage.xml -user wpsbind -password 1qazcde3 -url http://10.68.20.xx:10038/wps/config -out Out_ExportNMunicom_page.xml
上图是导出的全部页面:
主页下面的所有。
模板:
ExportSubTree.xml
df
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PortalConfig_1.4.xsd" type="export"> <!-- Sample for exporting subtree of the content hierarchy. This script exports the page customizer place with all contained pages. --> <portal action="locate"> <content-node action="export" uniquename="ibm.portal.Home" export-descendants="true"/> </portal> </request>
相关推荐
- 提到的“xmlaccess-inexport.xml”和“xmlaccess-inresult.xml”表明,管理员可以使用xmlaccess命令导出当前配置,以XML格式保存下来,便于备份和迁移。 9. 对Portlet的特定操作: - 文档中的“deployPortlet....
此外,使用xmlAccess导出主题配置文件也很重要。创建一个名为export.xml的文件,填写XML请求,用于导出主题配置,这样可以方便后续的管理和迁移。导出的XML内容应包括指定主题的相关元素。 在开发自定义主题的过程...
IBM WebSphere Portal是一款强大的企业级门户平台,提供了多种管理工具,以满足不同层次的管理和配置需求。本文主要关注的是XML配置接口,这是一种灵活且强大的方法,允许管理员通过XML文件来管理Portal的配置。 ...
将修改后的XML文件重新导入到Portal服务器,使用`xmlaccess`工具执行此操作。 13. **复制文件到服务器**: 最后,将修改好的主题文件复制到服务器的特定目录,以便服务器能够识别和应用该主题。 这个过程涉及到...
`ClsXMLAccess.vbproj` 可能是Visual Basic项目文件,用于定义和组织项目中的类和源代码。`AssemblyInfo.vb` 文件则包含了关于程序集的信息,如版本、版权和元数据。 在软件开发中,`bin` 和 `obj` 目录通常包含...