- 浏览: 117937 次
- 性别:
- 来自: 武汉
最新评论
Introduction
This article is a tutorial taking the user through the steps necessary to create and run an Ant script for Windchill. Ant is a very useful tool to build source, but with some basic techniques shown here it can also be used to script a number of actions related to a administration of the customization. A typical usage would be installation of a PDMLink™ or ProjectLink™ customization where the ant script will need to add files, update XML files and compile resource bundles. A major advantage from using simple batch or shell files is that ,as Ant is platform independent, we can develop on Windows and and deploy using the same scripts on Unix.
- Running Ant in Windchill
- Setting up basic parameters
- Updating a Windchill property
- Compiling a resource bundle
Running Ant in Windchill
Ant is pre-installed in all Windchill Installations, so we do not need to install anything. Ant can be executed from a Windchill shell as follows
ant -f [script]In addition a very useful library is also pre-installed called ant-contrib which adds features, such as if-then-else, these allows us to use Ant outside it’s normal domain of managing the build process.
Setting up basic parameters
In order to setup our Ant script we often need to have various parameters available, some of which are OS dependent. So for this we can use a setup task
<target name="setup"> <echo message="Setting up environment"/> <!-- The Windchill home & codebase taken from the env --> <property environment="env"/> <property name="wcinstall" value="${env.WT_HOME}"/> <property name="codebase" value="${wcinstall}/codebase"/> <!-- The O/S dependent xconf command --> <condition property="xconfCommand" value="${wcinstall}/bin/xconfmanager.bat" > <os family="windows"/> </condition> <property name="xconfCommand" value="${wcinstall}/bin/xconfmanager"/> <!-- The O/S dependent ant command --> <condition property="antcmd" value="ant.bat" > <os family="windows"/> </condition> <property name="antcmd" value="ant" /> <!-- Custom task for updating XML with XPath --> <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" /> <!-- ant-contrib to allow us to use if-then-else --> <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> </target>
Updating a Windchill property
Windchill has a standard technique to update it’s many property files such as wt.properties. This is controlled by a master file called site.xconf that looks as follows
<Configuration xmlns:xlink="http://www.w3.org/1999/xlink"> <Property name="installedProduct.location.Apache" overridable="true" targetFile="codebase/WEB-INF/ieWebServerLocation.txt" value="w:\ptc\Apache"/> <Property name="wt.java.cmd" overridable="true" targetFile="codebase/wt.properties" value="w:\ptc\Java\jre\bin\java.exe"/> ..... </Configuration>
You can update it as follows using the xconfmanager command
<target name="addlistener" depends="setup"> <echo message="Adding listener wt.properties"/> <exec executable="${xconfCommand}"> <arg value="-tcodebase/wt.properties"/> <arg value="-p"/> <arg value="-s wt.services.service.5463=ext.myclient.MyClientListener/ext.myclient.MyClientListener" /> </exec> </target>
Note the the dependency to setup
Compiling a resource bundle
<target name="resourcebuild" depends="setup"> <echo message="Building resource bundles"/> <exec executable="${wcinstall}/ant/bin/${antcmd}"> <arg value="-f"/> <arg value="${wcinstall}/bin/tools.xml"/> <arg value="bundle"/> <arg value="-Dbundle.input=ext.myclient.MyClientRB"/> <arg value="-Dbundle.buildLocales=true"/> </exec> <delete file="${codebase}/tools.properties"/> </target>
发表评论
-
How to deactivate a user in Windchill?
2012-10-17 22:09 972Introduction Procedure base ... -
How to shorten display time for the inline message in Windchill 10.0
2012-09-03 00:24 1170标题 How to shorten display ... -
How to perform SaveAs on WTPart using API in Windchill PDMLink 10.0
2012-04-05 18:38 1531标题 How to perform SaveAs ... -
Manual Installation Steps For Archive Client Installation on Red Hat Linux 4.0
2012-03-31 19:18 972On Red hat Linus 4.0 (64-Bit), ... -
Windchill单点登录方案
2012-03-31 00:20 3016Windchill SSO 单点登录 可下载附件查看。 ... -
如何在Windchill PDMLink 9.1设定多个Background Method Server去执行特定的工作流
2012-03-31 00:17 2656标题 如何在Windchill PDMLink 9.1 ... -
通过IE8访问Windchill PDMLink 10.0,出现警告提示"Windchill 只支持标准模式下的浏览器".
2012-03-31 00:15 3034标题 通过IE8访问Windchill PDMLink ... -
JSP Authentication with the Method Server
2012-02-07 20:31 3054During development for a cus ... -
Solution for searching the latest revision object
2012-02-01 11:44 1008// Implement your query ... -
Solution for search object with IBA Attribute
2012-02-01 11:39 1466QuerySpec qs = new Quer ... -
Required Ports for Windchill
2011-10-29 18:53 1046Windchill utilizes multiple por ... -
[WIP] How to see the document creator full name instead of the login name in DTI
2011-09-07 14:23 850标题 [WIP] How to see the doc ... -
Windchill Project Daily Build
2011-08-26 22:54 678下载软件: ant svnant sliksvn htt ... -
How to set schedule for Synchronization from Replica to Master?
2011-08-23 10:17 1068To do this, please follow these ... -
copy user from team administrator to workflow team.
2011-07-16 12:14 1637The code can be used directly i ... -
How to Disallow Anonymous Access to Aphelion LDAP?
2011-06-12 17:34 1643Description This TPI add ... -
MethodServer Exits Prematurely With the Error *com.ptc.windchill.upgrade.history
2011-06-11 23:39 2890Description ---------------- ... -
从Aphelion迁移至WindchillDS
2011-06-11 23:00 916假设: 1. Aphelion ... -
How to Configure Windchill with Active Directory
2011-06-09 22:28 3773说明 This article describe ... -
Taking the Windchill System Offline
2011-06-09 22:20 1182Description This documen ...
相关推荐
windchill资料windchill资料windchill资料windchill资料
windchill12.1.0.0 安装
windchill学习windchill学习windchill学习windchill学习windchill学习windchill学习windchill学习windchill学习windchill学习windchill学习
windchill 远程调试详细介绍 windchill开发环境搭建 windchill服务端调试模式设置 windchill eclipse开发环境搭建详细介绍
WINDCHILL项目管理模块使用教程 WINDCHILL项目管理模块使用教程
JAVAECLIPSE下配置WINDCHILL远程调试WINDCHILL学习笔记.pdf
windchill客制化开发很好的资源,适用于windchill 10.0 的开发
windchill系统调优文档windchill
creo集成windchill工作区应用剖析。
ptc公司windchill11开发API,帮助查看,便于二次开发,随时查看方法,这个是英文版的api
导出命令需要在windchill shell中执行: windchill wt.load.LoadFromFile -d loadFiles/ext2/ExportType.xml -u wcadmin -p wcadmin
windchill的二次开发资料,主要介绍来了如何用java来进行windchill的客户化定制
NULL 博文链接:https://windchill9.iteye.com/blog/670301
windchill 中文备份恢复文档,支持版本Windchill® 10.0 Windchill PDMLink® Windchill ProjectLink™ Pro/INTRALINK® 10.0
Windchill+spring+mybatis 1、修改codebase/MVCDispatcher-servlet.xml新增如下内容,配置mybatis-spring
windchill 中文客制化
Windchill Remote Replication Servers
修改windchill host指南
Creo用户使用windchill手册,Creo用户使用windchill手册,Creo用户使用windchill手册,Creo用户使用windchill手册,Creo用户使用windchill手册
windchill8.0 kunming bomload