вторник, 28 января 2014 г.

WebSphere Portal. Run XmlAccess on remote hosts.

If you want to automate the configuration and deployment task on WebSphere Portal, eventually, you will use XmlAccess.

IBM provides ant task called XmlAccess. My goal is to achieve the invokation of configuration tasks on remote machine from my machine. I use Windows 7 and ant 1.8.4 . Remote installations of WebSphere Portal use Linux.



Here are the steps to use XmlAccess ant task on remote machines.
From the remote WebSphere portal copy:
  • /base/wp.xml.client/bin/wp.xml.client.jar 
  • /base/wp.base/shared/app/wp.base.jar
In order to execute ant task you should use only IBM JDK. For Windows have to download IBM_DevelopmentPackage_for_Eclipse_Win_X86_32_4.5.0.zip from the IBM site.

Next, create build.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Invoke" basedir="." default="export">

<taskdef name="xmlaccess" classname="com.ibm.wps.xmlaccess.XmlAccessTask" classpath="wp.xml.client.jar;wp.base.jar"/>
<property name="targetPortalUser" value="${admin}"/>
<property name="targetPortalPwd" value="${password}"/>
<property name="targetPortalUrl" value="${remoteHost}:${remotePort}/wps/config"/>

<target name="export">
<xmlaccess
user="${targetPortalUser}"
password="${targetPortalPwd}"
url="${targetPortalUrl}"
srcfile="ExportAllPortlets.xml"
destfile="ExportAllPortlets.xml.target.xml" />
</target>
</project>

Here we define the XmlAccessTask with taskdef tag.
Next, we invoke xmlaccess task with the given sourcefile and output file.
After that you can invoke ant and ExportAllPortlets.xml.target.xml will appear in folder.

XmlAccessTask has the following options:
srcfile
destfile
url
user
password
trustStore
trustStorePassword
trustStoreType
failonerror


Комментариев нет:

Отправить комментарий