Add a new menu option using Ant

Introduction

This tutorial show how to use Ant to update the Windchill PDMLink or ProjectLink menu system. It will include a script that will install and uninstall a new menu option to the WTPart actions menu.

Add a new menu option using Ant

Getting started

We have some requirements

  • Fully automated script
  • Will work on any 9.x Windchill version
  • Will both install and uninstall the option
  • No manual editing

First you need to be familiar with how to create a Ant script for Windchill. We will use the same techniques here, but the primary difference is that will need to automatically update XML, this is not a feature available with ootb Ant

For us to update the XML we will use .an ant extension from the OOPS Consultancy Ltd called XML Task that can be downloaded here . It uses a query language called XPath with is very powerful way of specifying locations in an XML document.. You should be familiar with XPath syntax if you do any XML coding, a good starting point is the wiki page

Technical Objectives

To add the menu we will need to do the following

  • Update the actions xmls
  • Add a new resource bundle

Add the new XML task to the script

We need to copy the new task jar to our ant lib directory

The we start the script, add the new task

<target name="setup">
...
  <taskdef name="xmltask classname="com.oopsconsultancy.xmltask.ant.XmlTask" />
...
</target>

Add the new XML task to the script

To be continued… please add a comment if you want us to finish this article sooner rather than later

你可能感兴趣的:(xml,ant)