Adding Custom Filter to an OOTB Action
Solution Elements
Element
Type
Description
Action customization definition
XML
XML file for holding the definition of the action customization
Location in the module: <customizationRootDirectory>/<module>/main/resources
Action filter class
Java
Java class that defines the filter
Location in the module: main/src
com.ptc.netmarkets.util.misc.customActions property
XCONF
Property that contains a list of action customization XML files relative to <customizationRootDirectory>/<module>/main/resources folder. This property should be registered in configurations/xconf/custom.site.xconf
*service.properties.xconf
XCONF
Registry for the filter
Location in the module: main/xconf
Modular Structure for Customization
<customizationRootDirectory>
├── configurations
│ └── xconf
│ └── custom.site.xconf
└── module1
├── descriptor.xml
├── main
├── xconf
| └── acme.service.properties.xconf
├── src
│ └── com
│ └── acme
│ └── filter
│ └── YourActionFilter.java
└── resources
└── acme
└── module1
└── module1-actions.xml
Procedure
1. Create the action customization XML file if it is not already created. For more information, see Creating the Action Customization File.
* 
You can define customizations for multiple OOTB actions in the same file.
2. Define your action filter in a Java file in the src folder of the same module. For more information, see UI Validation.
3. Register this filter in the *service.properties.xconf file within this module. The filter name provided in the selector must be unique.
* 
Provide a short, meaningful name to the filter, which indicates the parameters based on which you want to hide an action. For example: hideForOrgAdmins.
4. Add the includeFilter attribute to the action tag in your custom XML file. For more information, see Defining a New Custom Action.
5. Add the name of this XML file to the property com.ptc.netmarkets.util.misc.customActions in the configurations/xconf/custom.site.xconf file using AddToProperty tag.
<AddToProperty name="com.ptc.netmarkets.util.misc.customActions" value="module1-actions.xml"/>
Was this helpful?