Show related Smart Collections on Part info page
Best Practice Name and Classification
Show related smart collections on part info page.
Name
Show related smart collections on part info page.
Objective
Demonstrate customization guidelines for displaying related smart collections on part information page.
Problem Statement
You want to display related smart collections on part information page.
Solution
Use customization hooks to implement logic for displaying related smart collections on part information page.
Prerequisite knowledge
To achieve this objective, you need to have an understanding of the following:
• Basic MPMLink and BOM structure
• Basic development involving Java
• Management of *-actions.xml and *-actionmodels.xml file customizations
• Windchill JCA table builder
• OOTB smart collection create and edit
Solution Element
AccountabilityServiceImpl().getAccountabilityMaps(part) — This API returns all smart collections that contain the input part (as a value) as well as all smart collections that have the input part set as root context. All versions of a smart collection found will be returned.
1. Configure new table builder which extends AbstractComponentBuilder.
2. In the buildComponentData() of the table builder, acquire wtPart content object from params and use new AccountabilityServiceImpl().getAccountabilityMaps(part) API to obtain the smart collections related with the part.
3. In buildComponentConfig() method of the table builder, add appropriate columns such as Icon, Name, Number and so on.
4. Add class level annotation: @ComponentBuilder.
5. For the table component, create an action in *-actions.xml.
6. Add the new action entry in *actionmodels.xml so that the table is rendered on the part information page as shown below.