windchill交流第一篇:增加自定义.xconf文件存储配置信息

[b][color=red]所有文章全部原创,如有不对,欢迎留言指正。[/color][/b]
请按照如下步骤进行:
第一步,新建任一后缀为.xconf的文件,存放于codebase目录下。我在codebase的ext文件夹里新建一个test.properties.xconf文件,路径为codebase/ext/test.properties.xconf。
第二步,向test.properties.xconf里添加基本的配置信息,内容如下:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd">
<!--配置自动生成的properties文件的位置 -->
<Configuration targetFile="codebase/ext/test.properties">
<!--
配置该文件内添加的客制化信息的默认存储位置,一般和生成的properties文件位置相同
-->
<Property default="ext/test.properties" name="wt.services.applicationcontext.WTServiceProviderFromProperties.customPropertyFiles" />
</Configuration>

第三步,打开windchill shell 执行如下命令:
xconfmanager -i codebase/ext/test.properties.xconf -p

成功执行完上述步骤后,进行如下验证:
1,观察codebase/ext目录,多了两个文件:test.properties和test.properties.annotated,这两个文件都是不可以手动修改的,只能使用命令将.xconf文件的内容添加进去。
2,打开<wt_home>/declarations.xconf,可以看到在文件的末尾添加了如下信息:
<ConfigurationRef xlink:href="codebase/ext/test.properties.xconf"/>


如果上述文件和内容都能正确创建添加,说明我们自定义的test.properties.xconf生效,同时可以向该文件添加需要的内容。
例如:
可修改test.properties.xconf文件,添加一条验证action的信息到<Configuration></Configuration>节点里,内容如下:
<Service context="default" name="com.ptc.core.ui.validation.UIComponentValidator">
<Option requestor="null" serviceClass="ext.portal.validation.MainTabValidator" selector="product" />
<Option requestor="null" serviceClass="extportal.validation.MainTabValidator" selector="project" />
</Service>

在这里我增加了客制化验证product(产品库菜单)和project(项目库菜单)显示或隐藏的内容。
当然,添加完毕,还需要执行命令
xconfmanager -i codebase/ext/test.properties.xconf -p

以便将test.properties.xconf里的内容写入test.properties和test.properties.annotated文件。

最后,重启windchill服务,添加的内容即可生效。

第一篇windchill相关的文章发布,以后会陆续发布经过准确测试的代码。 :D
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值