This documentation is for WSO2 Carbon 4.4.3. View documentation for the latest release.
Adding and Removing XML Element Touchpoint Actions - Carbon 4.4.3 - WSO2 Documentation
Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.
Skip to end of metadata
Go to start of metadata

A p2 Installable Unit is installed using the facilities provided by touchpoint actions. There are two sets of touchpoints available, which are namely native touchpoints and eclipse touchpoints. In addition to the latter mentioned two touchpoints two new touchpoints actions have been introduced in Carbon, for adding and removing element to and from a XML file. There are touchpoints actions to copy, delete, rename and move files, but there wasn’t any touchpoint action to modify a file. The usage of these touchpoint actions are the same as other touchpoint actions and they can be executed in any p2 engine phase (such as, install, configure, uninstall, unconfigure). 

Touchpoint Formats

To add a touchpoint:

org.wso2.carbon.p2.touchpoint.addXMLElement(file:/path/to/xml/file,xpath:xpath/expression,element:<testElement name="sample"/>);

For example:

instructions.configure = \
org.wso2.carbon.p2.touchpoint.addXMLElement(file:${installFolder}/../../../repository/conf/tomcat/webapp-classloading-environments.xml,xpath:/Classloading/ExclusiveEnvironments,element:<ExclusiveEnvironment><Name>J2EE</Name></ExclusiveEnvironment>); \

To remove a touchpoint:


For example:

instructions.uninstall = \
org.wso2.carbon.p2.touchpoint.removeXMLElement(file:${installFolder}/../../../repository/conf/tomcat/webapp-classloading-environments.xml,xpath:/Classloading/ExclusiveEnvironments/ExclusiveEnvironment[Name/text()="J2EE"]); \
  • No labels