<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed Materials - Property of IBM, 5724-E76, (C) Copyright IBM Corp. 2004 - All Rights reserved. General purpose tasks --> <!-- propogate_properties is used to copy parent properties specified via the --> <!-- file referenced by the parentProperties property to the wpconfig.properties file --> <!-- if SaveParentProperties is true. --> <taskdef name="propogate_properties" classname="com.ibm.wps.config.PropogatePropertiesTask" classpath="${WpsInstallLocation}/bin/wp.config.jar"/> <!-- ############################################################################## # Name: logmsg # # Description: taskdef for logging mechanism # writes translated message to logfile # # Usage: To provide human-readable logging for configuration: # By communicating progress of configuration. # (For example, entry or exit from an action.) # By communicating information used by a task or action. # (For example, parameters or calculated inputs.) # # Syntax: # <logmsg level="{LEVEL}" # task="{TASK}" # [subtask="{SUBTASK}" # message="{MESSAGE}" # param1="{PARAM1}" # param2="{PARAM2}" # param3="{PARAM3}" /> # # Inputs: LEVEL = { INFO | WARNING | SEVERE } # TASK = name of task calling logmsg # SUBTASK = subtask, if any (Optional) # MESSAGE = property key name of message to log # PARAM1 = parameter to place in first position # (Optional, denoted by {0} in property value) # PARAM2 = parameter to place in second position # (Optional, denoted by {1} in property value) # PARAM3 = parameter to place in third position # (Optional, denoted by {2} in property value) # # Assumptions/Prerequisites: None # # Error conditions: # MESSAGE not found in properties file. Result: MESSAGE property name # logged as not found, with PARAMs, if any. ############################################################################## --> <taskdef name="logmsg" classname="com.ibm.wps.config.logging.ant.LogMessageTask" classpath="${WpsInstallLocation}/bin/wp.config.jar"/> <!-- ############################################################################## # Name: ldapcheck # # Description: taskdef for checking LDAP properties # # Usage: call this task to validate input via properties file before # making any configuration changes that involve LDAP settings # # Syntax: # <ldapcheck ldapURL="${LDAPHostName}:${LDAPPort}" # ldapUser="${LDAPBindID}" # ldapPassword="${LDAPBindPassword}" # objectDn="${LDAPSuffix}" # ldapSslEnabled="${LDAPsslEnabled}"/> # # Inputs: ldapURL = <ldap.server.name>:<port> # ldapUser = (Optional) if specified, user must exist in LDAP, # and ldapPassword must match user. # ldapPassword = (Optional) if specified, must match ldapUser # objectDn = Distinguished Name of object task will search for # in directory. # ldapSslEnabled = true, if using SSL to connect to directory, # false otherwise. # # Assumptions/Prerequisites: None # # Error conditions: # Codes returned by underlying class: # RC_SUCCESS = 0 # check succeeded, no error(s) to report # RC_NO_CONNECTION = 1 # Connection to LDAP server failed. Check URL, userid/password # RC_OBJECT_NOT_FOUND = 2 # objectDn could not be found in directory # RC_INVALID_NAME = 3 # javax.naming.NameNotFoundException # RC_INVALID_AUTH = 4; # javax.naming.AuthenticationException # ############################################################################## --> <taskdef name="ldapcheck" classname="com.ibm.wps.config.LdapCheckTask" classpath="${WpsInstallLocation}/bin/wp.config.jar"/> <!-- ############################################################################## # Name: ldapcheckcontainer # # Description: taskdef for checking LDAP containers # # Usage: call this task to validate user/group container properties before # making any configuration changes that involve LDAP settings # # Syntax: # <ldapcheckcontainer ldapURL="${LDAPHostName}:${LDAPPort}" # ldapUser="${LDAPBindID}" # ldapPassword="${LDAPBindPassword}" # container="${LDAPUserSuffix}" # suffix="${LDAPSuffix}" # ldapSslEnabled="${LDAPsslEnabled}"/> # # Inputs: ldapURL = <ldap.server.name>:<port> # ldapUser = (Optional) if specified, user must exist in LDAP, # and ldapPassword must match user. # ldapPassword = (Optional) if specified, must match ldapUser # container = user/group container # baseDn = (optional) overall directory suffix # ldapSslEnabled = true, if using SSL to connect to directory, # false otherwise. # # Assumptions/Prerequisites: None # # Error conditions: # Codes returned by underlying class: # RC_SUCCESS = 0 # check succeeded, no error(s) to report # RC_NO_CONNECTION = 1 # Connection to LDAP server failed. Check URL, userid/password # RC_OBJECT_NOT_FOUND = 2 # objectDn could not be found in directory # RC_INVALID_NAME = 3 # javax.naming.NameNotFoundException # RC_INVALID_AUTH = 4; # javax.naming.AuthenticationException # ############################################################################## --> <taskdef name="ldapcheckcontainer" classname="com.ibm.wps.config.LdapCheckContainerTask" classpath="${WpsInstallLocation}/bin/wp.config.jar"/> <!-- ############################################################################## # Name: ldapcheckfilter # # Description: taskdef for checking LDAP properties # # Usage: call this task to validate user/group filterss before # making any configuration changes that involve LDAP settings # # Syntax: # <ldapcheckfilter ldapURL="${LDAPHostName}:${LDAPPort}" # ldapUser="${LDAPBindID}" # ldapPassword="${LDAPBindPassword}" # idToCheck="${PortalAdminIdShort}" # baseDn="${LDAPSuffix}" # filter="${LDAPUserFilter}" # ldapSslEnabled="${LDAPsslEnabled}" # requireUnique="true"/> # # Inputs: ldapURL = <ldap.server.name>:<port> # ldapUser = User must exist and ldapPassword must match user. # ldapPassword = Must match ldapUser # idToCheck = short name for user/group to check # baseDn = directory subtree to search within # (optional in some directory implementations) # filter = LDAP search filter as specified for WAS # ldapSslEnabled = true, if using SSL to connect to directory, # false otherwise. # requireUnique = fail if search-by-filter returns more than one # result. 'true' for user searches, may be false # for some group searches. # # Assumptions/Prerequisites: None # # Error conditions: # Codes returned by underlying class: # RC_SUCCESS = 0 # check succeeded, no error(s) to report # RC_NO_CONNECTION = 1 # Connection to LDAP server failed. Check URL, userid/password # RC_OBJECT_NOT_FOUND = 2 # objectDn could not be found in directory # RC_INVALID_NAME = 3 # javax.naming.NameNotFoundException # RC_INVALID_AUTH = 4; # javax.naming.AuthenticationException # RC_INDETERMINATE_RESULT = 5; # search-by-filter returned more than one result # ############################################################################## --> <taskdef name="ldapcheckfilter" classname="com.ibm.wps.config.LdapCheckFilterTask" classpath="${WpsInstallLocation}/bin/wp.config.jar"/> <!-- ############################################################################## # Name: shorten-path # # Description: taskdef for getting short path names on Windows systems # # Usage: use to get the short version of a path # # Syntax: # <shorten-path source="before" target="after" [slashConvert="true"] /> # # Inputs: # source = property containing path to be shortened # target = property to contain shortened path # slashConvert = convert '\' to '/' for use by ant (optional), # conversion is only performed on Windows systems, # default is true. # # Assumptions/Prerequisites: # - returns input string on non-Windows systems # - returns input string if source path does not exist on Windows # - if target property exists, the value it contains will be overwritten # # Error conditions: # source and target properties cannot be null (throws BuildException) # ############################################################################## --> <taskdef name="shorten-path" classname="com.ibm.wps.config.ShortPathTask"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> <pathelement location="${WpsInstallLocation}/bin/itkdepcheck.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: http-check # # Description: taskdef for checking HTTP connections # # Usage: use to check availability of specific URL # # Syntax: # <http-check url="<URL_to_check>" waitSeconds="5" tryCount="10" /> # # Inputs: # url = URL to check connection to (required) # waitSeconds = number of seconds to wait before retrying # (optional, default is 1) # tryCount = number of times to attempt connection # (optional, default is 1) # # Assumptions/Prerequisites: # # Error conditions: # url property cannot be null (throws BuildException) # url refers to unknown host (throws BuildException) # ############################################################################## --> <taskdef name="http-check" classname="com.ibm.wps.config.HttpCheckTask"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: admin-check # # Description: taskdef for checking user/passwd for Portal admin authority # # Usage: use to check Portal admin user/passwd before attempting admin # functions # # Syntax: # <http-check uid="<user_to_check>" # pwd="<password>" # configUrl="http://<hostname>/<base_URI>/config" /> # # Inputs: # uid = user id to check # pwd = password for uid # configUrl = URL to connect to Portal # # Assumptions/Prerequisites: # # Error conditions: # user not found or does not have admin authority # passwd does not match user # Portal does not respond on supplied configUrl # ############################################################################## --> <taskdef name="admin-check" classname="com.ibm.wps.config.PortalAdminCheckTask"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: isboolean # # Description: taskdef for checking to see if value/property is boolean # # Usage: Used mainly for validating user supplied boolean property values. # Basically works just like a condition, except in task form. # # Syntax: # <isboolean value="<string | property>" # casesensitive="<true | false>" # property="<property_name>" /> # # Inputs: # value = String value or property to test if also boolean value # casesensitive = (optional) Perform a case sensitive comparison. true respects case. false (default) ignores case. # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # if value or property parameters not set throw a BuildException # ############################################################################## --> <taskdef name="isboolean" classname="com.ibm.wps.config.util.IsBoolean"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: istrue # # Description: taskdef for checking to see if value/property is "true", "yes", "on" # # Usage: Used mainly for validating user supplied boolean property values. # Basically works just like the condition in Ant 1.5, except in task form. # Also added a casesensitive flag. # # Syntax: # <istrue value="<string | property>" # casesensitive="<true | false>" # property="<property_name>" /> # # Inputs: # value = String value or property to test if also "true", "yes", or "on" # casesensitive = (optional) Perform a case sensitive comparison. true respects case. false (default) ignores case. # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # if value or property parameters not set throw a BuildException # ############################################################################## --> <taskdef name="istrue" classname="com.ibm.wps.config.util.IsTrue"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: isfalse # # Description: taskdef for checking to see if value/property is "false" # # Usage: Used mainly for validating user supplied boolean property values. # Basically works just like the condition in Ant 1.5, except in task form. # Also added a casesensitive flag. # # Syntax: # <istrue value="<string | property>" # casesensitive="<true | false>" # property="<property_name>" /> # # Inputs: # value = String value or property to test if also "false" # casesensitive = (optional) Perform a case sensitive comparison. true respects case. false (default) ignores case. # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # if value or property parameters not set throw a BuildException # ############################################################################## --> <taskdef name="isfalse" classname="com.ibm.wps.config.util.IsFalse"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: socketexists # # Description: taskdef for checking to see if a connection can be made to server:port # # Usage: Used mainly for validating user supplied values for server and port. # This is a task implementation of the condition in Ant1.5 # # Syntax: # <socketExists server="<string | property>" # port="<int | property>" # property="<property_name>" /> # # Inputs: # server = The hostname or IP address of the server to query # port = The port number to connect to # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # if server, port, or property parameters not set throw a BuildException # ############################################################################## --> <taskdef name="socketexists" classname="com.ibm.wps.config.util.SocketExists"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: isinteger # # Description: taskdef for checking to see if a string is an integer # # Usage: Used mainly for validating user supplied values # # Syntax: # <isinteger value="<string | property>" # property="<property_name>" /> # # Inputs: # value = The string to test for an integer value # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # If value and property parameters not set, throw new BuildException. # ############################################################################## --> <taskdef name="isinteger" classname="com.ibm.wps.config.util.IsInteger"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: equalsignorecase # # Description: taskdef for checking to see if two strings are equal # ignoring case # # Usage: Used for checking equality of two strings # # Syntax: # <equalsignorecase arg1="<string | property>" # arg2="<string | property>" # property="<property_name>" /> # # Inputs: # arg1 = The 1st string to compare # arg2 = The 2nd string to compare # property = Property name to set if test is successful # # Assumptions/Prerequisites: None. # # Error conditions: # If arg1, arg2, and property parameters not set, throw new BuildException. # ############################################################################## --> <taskdef name="equalsignorecase" classname="com.ibm.wps.config.util.EqualsIgnoreCase"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <target name="action-propogate-properties" if="HavePropertiesToPropogate"> <antcall target="backup-main-cfg-file"/> <propogate_properties /> </target> <target name="action-extract-file-from-jar"> <echo message="ExtractFileFromJarSrc is ${ExtractFileFromJarSrc}"/> <echo message="ExtractFileFromJarName is ${ExtractFileFromJarName}"/> <echo message="ExtractFileFromJarDestDir is ${ExtractFileFromJarDestDir}"/> <shorten-path source="ExtractFileFromJarSrc" target="ExtractFileFromJarSrcShort" /> <shorten-path source="ExtractFileFromJarDestDir" target="ExtractFileFromJarDestDirShort" /> <exec executable="${JavaHome}/bin/jar" dir="${ExtractFileFromJarDestDirShort}" failonerror="yes" convertoutput="true"> <arg value="-xvf" /> <arg value="${ExtractFileFromJarSrcShort}" /> <arg value="${ExtractFileFromJarName}" /> </exec> </target> <target name="action-update-jar"> <echo message="UpdateFileSrc is ${UpdateFileSrc}"/> <echo message="UpdateFileName is ${UpdateFileName}"/> <echo message="UpdateFileDestDir is ${UpdateFileDestDir}"/> <shorten-path source="UpdateFileSrc" target="UpdateFileSrcShort" /> <shorten-path source="UpdateFileDestDir" target="UpdateFileDestDirShort" /> <exec executable="${JavaHome}/bin/jar" dir="${UpdateFileDestDirShort}" failonerror="yes" convertoutput="true"> <arg value="-uvfM" /> <arg value="${UpdateFileSrcShort}" /> <arg value="${UpdateFileName}" /> </exec> </target> <!-- ############################################################################## # Name: wpwsadmin # # Description: # This task that interacts with WAS Application Management. It supports a Standalone # applicaiton process as well as Deployment Manager. The Deployment Manager may be # local or remote. # # When this task executes, will connect to the Application Manager and determine if # this is a Standalone vs Deployment Manager process and perform the specified action. # The supported actions are: # # EXTRACT - This action will request WAS AppManager to export the Enterprise Applciation # appName to earFile. # # Deployment Manager Processing The file is exported to the DMgr "serverStagingLocation" # location. Once exported the file will then be transferred to the local system as earFile. # The remote file will be deleted once the transfer is complete. # # REDEPLOY - This action will request WAS AppManager to redeploy the Enterprise Applciation # appName using the new/updated earFile EAR file. # # Deployment Manager Processing The local file earFile will be transferred to the # DMgr "serverStagingLocation" location, and then redeployed. After the ear file # is redeployed, the ear file in the DMgr "serverStagingLocation" location is removed. # # The current configuration of the Enterprise Application appName is read to ensure the # redeployment preserves the configuration. The configuraton settings set on redeployment # as defined in com.ibm.websphere.management.application.AppConstants are: # AppConstants.APPDEPL_MODULE_TO_SERVER - Maintains existing module to server mappings. # AppConstants.APPDEPL_INSTALL_DIR - So as not to change this location if redeplying in a cluser. # AppConstants.APPDEPL_CLASSLOADERPOLICY - Maintains the classLoader policy, usually MULTIPLE # AppConstants.APPDEPL_CLASSLOADINGMODE - Maintains class loading mode - PARENT_FIRTS vs PARNET_LAST. # AppConstants.APPDEPL_PRECOMPILE_JSP - Preserve configures JSPs precompile setting # AppConstants.APPDEPL_RELOADENABLED - Preserve application reload setting. # AppConstants.APPDEPL_RELOADINTERVAL - Preserve applicaiton reload interval. # # We only need to specify these settings because WAS redeployment does not automatically preserve them. # The other config settings for an enterprise applciation are preserved over a redeployment. # After the ear file is redeployed, the ear file in the DMgr "serverStagingLocation" location is removed. # # Syntax: # <wpwsadmin action="<string | property>" # appName="<string | property>" # earFile="<string | property>" # property="<property_name>" /> # # # Parameters # Attribute = Description Required # action = Specifies the action to be preformed. This can be one of { "EXPORT", "REDEPLOY" } # appName = The name of the Enterprise Application. # earFile = The name of the local earFile. For redeploy this file is sent to DMgr, and for extarct this # names the .ear file that will be generated as a result of the extraction. # wpHome = The WP install root, if not specified the value of WpsInstallLocation will be used. # ############################################################################## --> <taskdef name="wpwsadmin" classname="com.ibm.websphere.update.delta.adminconfig.tasks.WPWsAdminTask" classpath="${WpsInstallLocation}/bin/wp.config.jar" /> <!-- ############################################################################## # Name: wpwsadmin-filetransfer # # Description: # This task that interacts with WAS Deployment Manager. It can be used to transfer # files between the local system and the Deplpoyment Manager system. This task uses # the WAS FileTransferClient API to move the files. # # Note: that the describe mention local and remote files. In reality remote specifes # the file as Deployment Manager would see it. So even if DMgr is on the SAME system, # remote would still refer to DMgrs view. This allows for the use of this task # independant of wether DMgr is local or remote. # # When this task executes, will connect to the Deployment Manager and perform the # specified action. The supported actions are: # # UPLOAD - The local file localFile will be transferred to the # DMgr "serverStagingLocation" location. # If specified the property named in resultFile will contain the full filename # of the uploaded file. # DOWNLOAD - The remote file remoteFile, which must be in the # DMgr "serverStagingLocation" location transferred form DMgr to the local # system as localFile. # If the deleteRemoteFile parameter is set to true, the file in the DMgr # staging location will be deleted is the transferis sucessful. # If specified the property named in resultFile will contain the filename # of the downloaded file. # GetRemoteLocation - This action will return the staging directory for DMgr # ( the DMgr "serverStagingLocation" location ). All files transferred # to/from DMgr will be relative to this location. # The property named in the resultFile parameter will conatin this # directory location after the task completes. # # Syntax: # <wpwsadmin-filetransfer # action="<string | property>" # localFile="<string | property>" # remoteFile="<string | property>" # deleteRemoteFile="<true | false">" # resultFile="<property_name>" /> # # # Parameters: # action Specifies the action to be preformed. This can be one of # { "upload", "download", or "getRemoteLocation" } # localFile The name of the local file. See the action definitions to see # how this param is used. # remoteFile The name of the file on the DMgr system. See the action # definitions to see how this param is used. # deleteRemoteFile This is a boolean parameter, that is used to tell the # FileTransferClient to remote the remote file after it is downloaded. # This parameter is only used by the downlaod action. # wpHome The WP install root, if not specified the value of WpsInstallLocation # will be used. # resultFile OUTPUT This specifies a propeerty name that can be used to get # information fromthe action. See the action definitions to see how this # param is used. # ############################################################################## --> <taskdef name="wpwsadmin-filetransfer" classname="com.ibm.websphere.update.delta.adminconfig.tasks.WPWsAdminFileTransferTask" classpath="${WpsInstallLocation}/bin/wp.config.jar" /> <!-- ############################################################################## # Name: if # # Description: This task profides an if mechanism. # # Usage: # # Syntax: # <if firstValue="Otto" operator="==" secondValue="Otto"> # <then> # ... some tasks .. # </then> # <else> # ... some tasks .. # </else> # </if> # possible Operators: # == - equal # &lt; - less-than # &gt; - more-than # &lt;= - <= # &gt;= - >= # # Inputs: # firstValue = The first string to compare # secondValue = The second string to compare # operator = The operation for comparison # # Assumptions/Prerequisites: None. # # Error conditions: # The task will fail if the wrong operator is used.. # ############################################################################## --> <taskdef name="if" classname="com.ibm.wps.config.If"> <classpath> <pathelement location="${WpsInstallLocation}/bin/wp.config.jar"/> </classpath> </taskdef> <!-- ############################################################################## # Name: action-set-managed-node-flag # # Description: # This action sets the property "IsManagedNode" if this node is managed by # WAS DM. If not, the node is NOT managed by DM. # # Usage: # To make a task run ONLY IF DM: # <sample-target depends="action-set-managed-node-flag" unless="IsManagedNode"> # # To make a task run ONLY IF NOT DM: # <sample-target depends="action-set-managed-node-flag" if="IsManagedNode"> # # ############################################################################## --> <target name="action-set-managed-node-flag"> <wpwsadmin action="ISMANAGEDNODE" managedNode="IsManagedNode_retval"/> <echo>Is this a Managed Node ? ${IsManagedNode_retval}</echo> <condition property="IsManagedNode"> <equals arg1="${IsManagedNode_retval}" arg2="true" /> </condition> </target> <!-- ############################################################################## # Name: action-print-portal-url # # Description: # This action prints the URL of the portal server # ############################################################################## --> <target name="action-print-portal-url"> <condition property="TmpWpsHostPortForPrint" value="${WpsHostPortForPrint}"> <isset property="WpsHostPortForPrint"/> </condition> <condition property="TmpWpsHostPortForPrint" value="${WpsHostPort}"> <not> <isset property="WpsHostPortForPrint"/> </not> </condition> <echo message="The URL of your WebSphere Portal is http://${WpsHostName}:${TmpWpsHostPortForPrint}/${WpsContextRoot}/${WpsDefaultHome}"/> </target>
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.