In the process of doing projects, we often have one for the development and testing of the portal environment (test server) on the line and a real environment (production server), when the development after the test is completed, then the development of good portal set derived from the test server, and it their introduction to the production server. The traditional way we will test server development testing is complete, the production server again is a re-do, this is time-consuming and demanding. XMLAccessActually WS Portal provides a command-line tool called XMLAccess (XMLAccess is a small independent application rocedures, it uses HTTP server connectivity and connectivity. Therefore, we can visit and remote configuration portal.)
XMLaccess provide a command line for batch portal configuration updates and portal migration. You can make it all or part of portal configuration derived configuration to a XML file. Then, you can use the XML file in another portal to create derived configuration.
2. Xmlaccess the way
。 This command-line client is an independent process, it uses HTTP protocol and server connectivity. This also allows remote configuration and portals. Command line client included in wp_root / bin directory of wp.xml.client.jar paper, we can also use it remotely, only need to configure the Java Runtime Environment, modify Xmlaccess.sh document.
Xmlaccess.sh documents
#!/bin/sh JAVA=D:/Program/PORTAL~1/APPSER~1/java/bin/java WPS_HOME=D:/Program/PORTAL~1/PORTAL~1 ${JAVA} -classpath ${WPS_HOME}/bin/wp.xml.client.jar com.ibm.wps.xmlaccess.XmlAccess $* #! / Bin / sh JAVA = D: / Program / PORTAL ~ ~ 1/java/bin/java 1/APPSER WPS_HOME = D: / Program / PORTAL 1/PORTAL ~ ~ (a $ JAVA-ish $ () WPS_HOME) / bin / * $ wp.xml.client.jar com.ibm.wps.xmlaccess.XmlAccess
3. The use of basic grammar Xmlaccess
Xmlaccess is a command-line clients, included in the WebSphere \ PortalServer \ bin directory.: The basic command syntax is as follows:
./Xmlaccess.sh -in XML_file -user username -pwd password -url PortalConfigURL -out result.xml . / Xmlaccess.sh XML_file-in-user password - username-pwd url PortalConfigURL-out result.xml
: Of which:
Table 1 Xmlaccess basic grammar
Elements of Grammar Description
Xmlaccess Operation Access Control implementation of the script.
XML file XML file Treatment should include XML request (derived configuration or updating) the file name.
Password and user Requests should be used to describe the competence of the user IDs and passwords. user(DN)。 The user value, you must specify portal login brief period designated users; Not supports proprietary name (DN). XML XML configuration interface can be only in the virtual resources XML_ACCESS Manager on the role and resources in a virtual PORTAL Administrator on the role of user access.
PortalConfigURL PortalConfigURL 。 The URL from the portal hostname, during installation designated portal basic URI (eg / wps), and servlet extension / config components.
result.xml Result.xml Includes XML output (derived configuration) of the outcome document name.。 Later you can use this document has been re-introduction derived configuration.
4. Xmlaccess right portal resources there are five operational action
All that portal XML resources are a necessary element of the action attribute. XML action XML elements action attribute determines the right portal of resources of the type of treatment.
Allow following:
• Locate: logo and the XML elements (usually for other operational needs it as a context) corresponding portal resources.
• Create: A set of attributes to the new portal resources. A new resources can always be created, even if the same name already exists another resource.
• Update: with a given configuration data (properties and configuration data subordinate elements) update the corresponding portal resources allocation; If there is no corresponding portal resources, will create portal resources.
• Delete: Delete the corresponding element of this XML portal resources.
• Export: XML output includes orders corresponding elements of this portal resources XML representation.
5. Xmlaccess common scene
5.1. Portal Portlet migration (including Portlet authority)
First, from a portal (test server) derived moved the Portlet.ExportWelcomePortlet.xml。 Following is a portlet paper derived the script, named ExportWelcomePortlet.xml.
ExportWelcomePortlet.xml ExportWelcomePortlet.xml
: Use the following command-line implementation derived order:
./xmlaccess.sh -in ExportWelcomePortlet.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Out_ExportWelcomePortlet.xml . / Xmlaccess.sh ExportWelcomePortlet.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Out_ExportWelcomePortlet.xml
:Out_ExportWelcomePortlet.xml。 The outcome document is derived as shown in the following named: Out_ExportWelcomePortlet.xml.
Out_ExportWelcomePortlet.xml Out_ExportWelcomePortlet.xml
。 The above document will be using the following statement into the second portal (production server).
./xmlaccess.sh -in Out_ExportWelcomePortlet.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Result_ExportWelcomePortlet.xml . / Xmlaccess.sh Out_ExportWelcomePortlet.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Result_ExportWelcomePortlet.xml
5.2. Theme and Skin. 5.2. Migration Theme and Skin.
Theme and Skin。 First, from a portal (test server) derived moved in the Theme and Skin. ExportThemeSkin.xml。 Following is a portlet paper derived the script, named ExportThemeSkin.xml.
ExportThemeSkin.xml ExportThemeSkin.xml
: Use the following command-line implementation derived order:
./xmlaccess.sh -in ExportThemeSkin -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Out_ExportThemeSkin.xml . / Xmlaccess.sh ExportThemeSkin-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Out_ExportThemeSkin.xml
Out_ ExportThemeSkin.xml The outcome document is derived name: Out_ ExportThemeSkin.xml
ĺ°†Out_ ExportThemeSkin.xml。 Out_ ExportThemeSkin.xml document will be using the following statement into the second portal (production server).
./xmlaccess.sh -in Out_ExportThemeSkin.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Result_ ExportThemeSkin.xml . / Xmlaccess.sh Out_ExportThemeSkin.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Result_ ExportThemeSkin.xml
5.3. Migration pages (including page layout, the page contains portlets page competence, and the Theme and use pages Skin)
Page。 First, from a portal (test server) derived moved Page. ExportWelcomePage.xml。 Following is a derived page document script, named ExportWelcomePage.xml.
ExportWelcomePage.xml ExportWelcomePage.xml
Use the following command-line implementation derived order:
./xmlaccess.sh -in ExportWelcomePage.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Out_ ExportWelcomePage.xml . / Xmlaccess.sh ExportWelcomePage.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Out_ ExportWelcomePage.xml
Out_ ExportWelcomePage.xml
Out_ ExportWelcomePage.xml。 Out_ ExportWelcomePage.xml document will be using the following statement into the second portal (production server).
./xmlaccess.sh -in Out_ExportWelcomePage.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config -out Result_ ExportWelcomePage.xml . / Xmlaccess.sh Out_ExportWelcomePage.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config-out Result_ ExportWelcomePage.xml
5.4. Transfer virtual portal Portal content (such as relocation of virtual portals and portlets pages)
MyVirtual,wpsadmin Assume that the virtual portal called Portal MyVirtual, administrators is wpsadmin
First, from a portal (test server) derived moved in the pages and portlets. ExportVirtualWelcomePageAndPortlet.xml Following is a derived page document script. Named ExportVirtualWelcomePageAndPortlet.xml
ExportVirtualWelcomePageAndPortlet.xml ExportVirtualWelcomePageAndPortlet.xml
Use the following command-line implementation derived order:
./xmlaccess.sh -in ExportVirtualWelcomePageAndPortlet.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config/MyVirtual -out Out_ExportVirtualWelcomePageAndPortlet.xml . / Xmlaccess.sh ExportVirtualWelcomePageAndPortlet.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config/MyVirtual-out Out_ExportVirtualWelcomePageAndPortlet.xml
Out_ExportVirtualWelcomePageAndPortlet.xml The outcome document is derived name: Out_ExportVirtualWelcomePageAndPortlet.xml
Out_ExportVirtualWelcomePageAndPortlet.xml document will be using the following statement into the second portal (production server).
./xmlaccess.sh -in Out_ExportVirtualWelcomePageAndPortlet.xml -user wpsadmin -pwd wpsadmin -url http://localhost:9081/wps/config/MyVirtual -out Result_ ExportVirtualWelcomePageAndPortlet.xm . / Xmlaccess.sh Out_ExportVirtualWelcomePageAndPortlet.xml-in-user-pwd wpsadmin wpsadmin - url http://localhost:9081/wps/config/MyVirtual-out Result_ ExportVirtualWelcomePageAndPortlet.xm
6. Xmlaccess limitations
6.1. Restrictions on the Use of XML configuration interface to perform the following tasks:
• Authorized management tasks, namely: to have specific permission to visit the other management users perform these tasks.
• Restrictions specific user or specific portal resource management tasks. In its integrity by the portal configuration backup and recovery, you should pay attention to:
• To rebuild portal to portal configuration only full export to XML documents is not enough. You will also need the portlet WAR files and may also need other non-standard installation together with Portal installed on paper resources, such as theme paper.
• XML configuration interface is not designed to handle large quantities of data, in this regard its work efficiency is not high.
• To solve the production server backup and recovery problem, you should use the low-level database backup and file system.
6.2. Visit the attention and security matters
When you run Xmlaccess command-line tools, you need to designate the portal user identification and password for authentication on your own. When you use HTTP connections, as user and password sent to the server without encryption, so you should only have protection, which can be sure that no leaks HTTP connections in the internal network and XML configuration interface.