Product Design eXchange (PDX) Support for Export
Product Design eXchange (PDX) is a file format used for sharing of product design data between business partners. This allows you to share information about Documents, Parts, Product Structure and Bill of Materials (BOM).
You can export data from Windchill to PDX format including Agile. You can customize to export of BOM data to PDX format.
The OOTB PDX export allows you to export:
• Documents
• Parts
• EPM Documents
Sample product structure in Windchill system
Corresponding PDX output as seen in PDXplorer
Customization Points
Required Artifacts
• Class files: wt.ixb.pdx.*
• XSL path used for transformation: <Windchill>\codebase\registry\ixb\pdx
• DTD path: <Windchill>\codebase\registry\ixb\pdx\dtds
Default Behavior
• By default it would be Agile compatible.
• By default:
◦ “Agile_07.dtd” and “wcxml12pdx_agile.xsl” would be respective dtd and xsl corresponding to Agile format.
◦ “IPC_2571.dtd” and “wcxml2pdx.xsl” would be respective dtd and xsl corresponding to PDX format.
Overridable Properties for wt.properties
• pdx.export.dtdFilePath=$(wt.home)$(dir.sep)codebase$(dir.sep)registry$(dir.sep )ixb$(dir.sep)pdx$(dir.sep)dtds$(dir.sep) Agile_07.dtd
• pdx.export.xslFilePath=$(wt.home)$(dir.sep)codebase$(dir.sep)registry$(dir.sep) ixb$(dir.sep)pdx$(dir.sep) wcsml2pdx_agile.xsl
• pdx.AgileCompatible=true
• pdx.debug.enable=false
The xsl may also be modified as per requirement or to support PDX export of other exportable Windchill objects.
Supported APIs
• ExportPackage exportPackage= ExportPackageForPDX.createExportPackageForPDX(...)
• PDXExportHelper.doExportToPDX(...)
createExportPackageForPDX
There are four static public APIs (createExportPackageForPDX) in ExportPackageForPDX to support this functionality.
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX(
java.lang.String name, java.lang.String description,
java.lang.String exporter, java.langString[] generIds,
java.lang.String[] generParams, java.lang.String[] filterIds,
java.lang.String[] filterParams) throws wt.util.WTException
• Purpose: Create ExportPackage holding all information necessary for export in PDX format. The objects are collected using standard ixb collection mechanism (generators and filters).
• Parameters:
◦ name — Name of the export package
◦ description — Description of the export package
◦ exporter — Name of the user who makes export
◦ generIds — Array of Sting id for object set generator types, e.g. {”singleDocument”,”productStructureNavigatorWithEPM”}
◦ generParams — Array of local id for the corresponding seed objects
◦ filterIds — Array of String id for object set filters
◦ filterParams — Array of Strings representing parameters for filtering
• Throws: wt.util.WTException
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX(
java.lang.String name, java.lang.String description,
java.lang.String exporter, java.lang.String[] generIds,
java.lang.String[] generParams) throws wt.util.WTException
• Purpose: Convenience method for the common case when objects are collected without filtering
• Parameters:
◦ name — Name of the export package
◦ description — Description of the export package
◦ exporter — Name of the user who makes export
◦ generIds — Array of String id for object set generatory types, e.g. {”singleDocument”,”productStructureNavigatorWithEPM”}
◦ generParams — Array of local id for the corresponding seed objects
• Throws: wt.util.WTException
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX(
java.lang.String name, java.lang.String description,
java.lang.String exporter, java.lang.String[] generIds,
java.lang.String[] generParams) throws wt.util.WTException
• Purpose: Convenience method for the common case when objects are collected without filtering
• Parameters:
◦ name — Name of the export package
◦ description — Description of the export package
◦ exporter — Name of the user who makes export
◦ generIds — Array of String id for object set generatory types, e.g. {”singleDocument”,”productStructureNavigatorWithEPM”}
◦ generParams — Array of local id for the corresponding seed objects
• Throws: wt.util.WTException
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX
public static wt.ixb.objectset.ExportPackage createExportPackageForPDX(
wt.inf.container.WTContainerRef container,
java.lang.String name,
java.lang.String description,
java.lang.String exporter,
java.lang.String[] generIds,
java.lang.String[] generParams)
throws wt.util.WTException
• Purpose: Convenience method for the common case when objects are collected within a container without filtering
• Parameters:
◦ container — Object reference of container
◦ name — Name of the export package
◦ description — Description of the export package
◦ exporter — Name of the user who makes export
◦ generIds — Array of String id for object set generatory types, e.g. {”singleDocument”,”productStructureNavigatorWithEPM”}
◦ generParams — Array of local id for the corresponding seed objects
• Throws: wt.util.WTException
doExportToPDX
public static void doExportToPDX
public static void doExportToPDX(
ExportPackageForPDX expPackage, String attachmentOption,
File dirToSave, String zipName)
throws wt.util.WTException
• Purpose: Creates pdx file on server.
• Parameters:
◦ container — Source container
◦ expPackage — Export package
◦ attachmentOption — Attachments option. Possible values are:
▪ PDXExportHandler.XML_VALUE_ATTACHMENTS — content files are included into pdx package (default option)
▪ PDXExportHandler.XML_VALUE_NO_ATTACHMENTS — content files are ignored (not mentioned in pdx.xml)
▪ PDXExportHandler.XML_VALUE_ATTACHMENTS_AS_FILE_NAMES — contend files are mentioned in pdx.xml but are not included into zip
◦ dirToSave — directory on server where the resulting pdx file will be stored
◦ zipName — name for the resulting pdx file (pass name without extension since extension '.pdx' is added)
• Throws: wt.util.WTException
public static void doExportToPDX
public static void doExportToPDX(
ExportPackageForPDX expPackage, java.lang.String
java.io.File dirToSave, attachmentOption,
throws wt.util.WTException java.lang.String zipName)
• Purpose: Creates pdx file on server.
• Parameters:
◦ expPackage — Export package
◦ attachmentOption — Attachments option. Possible values are:
▪ PDXExportHandler.XML_VALUE_ATTACHMENTS — content files are included into pdx package (default option)
▪ PDXExportHandler.XML_VALUE_NO_ATTACHMENTS — content files are ignored (not mentioned in pdx.xml)
▪ PDXExportHandler.XML_VALUE_ATTACHMENTS_AS_FILE_NAMES — content files are mentioned in pdx.xml but are not included into zip
◦ dirToSave — directory on server where the resulting pdx file will be stored
◦ zipName — name for the resulting pdx file (pass without extension since extension '.pdx' is added)
• Throws: wt.util.WTException
Preparing Data to Export
File dir = new File(dirToSave);
WTCollection seedParts = // Get List of Parts as seed
if(!seedParts.isEmpty()) {
String [] genIds = new String[seedParts.sixe()];
String [] genParams = new String[seedParts.size()];
Iterator<WTReference> it = seedParts.referenceIterator();
int i = 0;
while(it.hasNext()) {
genIds[i] = "productStructureNavigator";
genParams[i] = it.next().toString();
i++;
}
WTContainerRef sourceContainer = WTContainerRef.newWTContainerRef(container);
Export to PDX Format
ExportPackage exportPackage =
ExportPackageForPDX.createExportPackageForPDX("name_of_exp_package", "description",
"author", genIds, genParams);
PDXExportHelper.doExportToPDX(sourceContainer,(ExportPackageForPDX)exportPackage,
PDXExportHandler.XML_ATTR_ATTACHMENTS_OPTION, dir, "zipName");