Adding a Custom Service Provider Property File
Some site customizations involve creating a new service provider property file. Service provider property files must be declared in one of the following <Windchill>/codebase/wt.properties entries:
wt.services.applicationcontext.WTServiceProviderFromProperties.customPropertyFiles
wt.services.applicationcontext.WTServiceProviderFromProperties.defaultPropertyFiles
wt.services.applicationcontext.TypeBasedServiceProviderFromProperties.defaultPropertyFiles
wt.services.applicationcontext.TypeBasedServiceProviderFromProperties.customPropertyFiles
See the “service.properties” section in Property Files for information on these properties.
These properties are handled in a special fashion with xconfmanager Utility. Rather than directly specifying a new property value for any of these properties, you should instead establish a new declarative XCONF file that causes your new service provider file to be used. A key benefit to doing this is that it will avoid conflicts with these property values if you later install other PTC products that require their own service provider property values. This is illustrated with the following example.
Suppose your new service provider file name is named codebase/ext/sitepart/sitepart.properties. It contains the entries that define your new services. In order to get this property listed as one of the files in the following wt.properties entry:
wt.services.applicationcontext.WTServiceProviderFromProperties.customProp
ertyFiles
You should create a new declarative XCONF file, for example, codebase/ext/sitepart/sitepart.xconf. It would look like the following:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Configuration SYSTEM "xconf.dtd">
<Configuration targetFile="codebase/wt.properties">
<!-- Ensure that the file ext/sitepart/sitepart.properties is
appended to the list of custom property files.
-->
<Property default="ext/sitepart/sitepart.properties" name="wt.services
applicationcontext.WTServiceProviderFromProperties.customPropertyFiles"/>
</Configuration>
The Property statement (formatted on two lines for this guide) is one line in the file that declares that the file ext/sitepart/sitepart.properties (a path relative to the codebase directory) should be added as a value for the property:
wt.services.applicationcontext.WTServiceProviderFromProperties.customProp
ertyFiles
This property is in the codebase/wt.properties file.
Store a copy of new XCONF files in your source directories as described in Best Practices for Customizing Files Supplied by PTC.
To install the codebase/ext/sitepart/sitepart.xconf file and generate the sitepart.properties file, execute the xconfmanager Utility from a windchill shell, as follows:
xconfmanager -i codebase/ext/sitepart/sitepart.xconf -p
After running the above command, the wt.properties file is updated to reference your service provider file, codebase/ext/sitepart/sitepart.properties.
Compiling Custom Classes
The syntax to compile custom java classes to the Windchill codebase is: ant -f bin/tools.xml class -Dclass.includes=*.java -Dclass.source=<Windchill>/wtCustom/<custom-subdirectories>
Было ли это полезно?