Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Version: Windchill 12.1
Use Case: Need to create a preference which only accepts a number as input
Description:
I can create string, type or boolean preferences using a loadfile with the right handler, but I cant find any example handler for Integer, does it exist?
e.g. Boolean
com.ptc.windchill.enterprise.preference.handler.BooleanPreferenceValueHandler:
e.g. String
com.ptc.windchill.enterprise.preference.handler.StringPreferenceValueHandler:400:400
e.g. Type Picker
com.ptc.windchill.enterprise.search.preference.handler.TypePreferenceValueHandler:/com/ptc/windchill/enterprise/search/allSearchTypes
e.g. Integer
??? where do you find it?
e.g. Preference loadfile
<?xml version="1.0"?>
<!DOCTYPE NmLoader SYSTEM "standardX10.dtd">
<NmLoader>
<!-- Clean up first-->
<csvUnlinkPreferenceClientDefinition
handler="wt.preference.LoadPreference.deleteClientDefinitionLink">
<csvname>/ext/ws/elecReportDocumentType</csvname>
<csvclientName>WINDCHILL</csvclientName>
</csvUnlinkPreferenceClientDefinition>
<csvDeletePreferenceDefinition
handler="wt.preference.LoadPreference.deletePreferenceDefinition">
<csvname>/ext/ws/elecReportDocumentType</csvname>
</csvDeletePreferenceDefinition>
<csvPreferenceDefinition handler = "wt.preference.LoadPreference.createPreferenceDefinition">
<csvname>/ext/ws/elecReportDocumentType</csvname>
<csvvisibility>ORGANIZATION</csvvisibility>
<csvcategoryName>COMPANYE_WS</csvcategoryName>
<csvdisplayName>ext.core.prefs.PreferenceRB:COMPAN_WS_ELEC_REPORT_DOC_TYPE</csvdisplayName>
<csvdescription>ext.core.prefs.PreferenceRB:COMPANY_WS_ELEC_REPORT_DOC_TYPE_SHORT_DESC</csvdescription>
<csvlongDescription>ext.core.prefs.PreferenceRB:COMPANY_WS_ELEC_REPORT_DOC_TYPE_LONG_DESC</csvlongDescription>
<csvdefaultValue>WCTYPE|wt.doc.WTDocument</csvdefaultValue>
<csvhandler>com.ptc.windchill.enterprise.search.preference.handler.TypePreferenceValueHandler:/com/ptc/windchill/enterprise/search/allSearchTypes</csvhandler>
</csvPreferenceDefinition>
<csvLinkPreferenceClientDefinition handler = "wt.preference.LoadPreference.setClientDefinitionLink">
<csvname>/ext/ws/elecReportDocumentType</csvname>
<csvclientName>WINDCHILL</csvclientName>
</csvLinkPreferenceClientDefinition>
</NmLoader>
Solved! Go to Solution.
Hi @rhart
If you try to search a csvPref definition in all files in the Windchill folder, you could find what you are looking for.
example with number
<csvPreferenceDefinition handler="wt.preference.LoadPreference.createPreferenceDefinition">
<csvname>/Tables/DataSourceClientSideLimit</csvname>
<csvvisibility>USER</csvvisibility>
<csvcategoryName>TABLES_CATEGORY</csvcategoryName>
<csvdisplayName>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_NAME</csvdisplayName>
<csvdescription>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_DESC</csvdescription>
<csvlongDescription>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_LONG_DESC</csvlongDescription>
<csvdefaultValue>2000</csvdefaultValue>
<csvhandler>com.ptc.windchill.enterprise.preference.handler.NumberPreferenceValueHandler:1:100000</csvhandler>
</csvPreferenceDefinition>
PetrH
Hi @rhart
If you try to search a csvPref definition in all files in the Windchill folder, you could find what you are looking for.
example with number
<csvPreferenceDefinition handler="wt.preference.LoadPreference.createPreferenceDefinition">
<csvname>/Tables/DataSourceClientSideLimit</csvname>
<csvvisibility>USER</csvvisibility>
<csvcategoryName>TABLES_CATEGORY</csvcategoryName>
<csvdisplayName>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_NAME</csvdisplayName>
<csvdescription>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_DESC</csvdescription>
<csvlongDescription>com.ptc.core.components.rendering.renderResource:CLIENT_SIDE_DATASOURCE_MAX_LIMIT_LONG_DESC</csvlongDescription>
<csvdefaultValue>2000</csvdefaultValue>
<csvhandler>com.ptc.windchill.enterprise.preference.handler.NumberPreferenceValueHandler:1:100000</csvhandler>
</csvPreferenceDefinition>
PetrH
Thanks @HelesicPetr I found it in there, it's called com.ptc.windchill.enterprise.preference.handler.NumberPreferenceValueHandler:1
I was searching Integer