Introduce a new tab in WTDocument Page
Hello,
I want to introduce a new tab under a specific type of WTDocument page and populate it with some of the attributes, could you shed some light on how to approach this requirement?
Thanks,
Sha
Hello,
I want to introduce a new tab under a specific type of WTDocument page and populate it with some of the attributes, could you shed some light on how to approach this requirement?
Thanks,
Sha
I forgot mention very important point.
You should create own Validation class where you check if the action should be shown in the detailpage of your WTDocument subtype
definition in customaction
<action name="ownJSPPageTab" >
<component name="cz.aveng.NewDocTab.DetailTabBuilder" windowType="page" />
<includeFilter name="hideDocValidator"/>
</action>
definition in service.properties
wt.services/svc/default/com.ptc.core.ui.validation.SimpleValidationFilter/hideDocValidator/null/0=cz.aveng.NewDocTab.DocValidator/duplicate
this validator hide the action if the subtype document is not "DOCINTERNALSUBSTRING" internal name ends with this string
validator class
package cz.aveng.NewDocTab;
import com.ptc.core.ui.validation.DefaultSimpleValidationFilter;
import com.ptc.core.ui.validation.UIValidationCriteria;
import com.ptc.core.ui.validation.UIValidationKey;
import com.ptc.core.ui.validation.UIValidationStatus;
import wt.fc.Persistable;
import wt.fc.WTReference;
import wt.type.TypedUtilityServiceHelper;
import wt.util.WTException;
import wt.wvs.WVSLogger;
import java.rmi.RemoteException;
public class DocValidator extends DefaultSimpleValidationFilter
{
private static final WVSLogger logger = WVSLogger.getLogger(DocValidator.class, "cz.aveng.DocValidator");
public DocValidator()
{
}
public UIValidationStatus preValidateAction(UIValidationKey valKey, UIValidationCriteria criteria)
{
UIValidationStatus validatioNStatus = UIValidationStatus.ENABLED;
WTReference contextObject = criteria.getContextObject();
if (contextObject != null)
{
Persistable persistObject = contextObject.getObject();
String subtypeString = null;
try
{
// get object type
subtypeString = TypedUtilityServiceHelper.service.getExternalTypeIdentifier(persistObject);
//
if (!subtypeString.endsWith("DOCINTERNALSUBSTRING"))
{
validatioNStatus = UIValidationStatus.HIDDEN;
}
} catch (WTException | RemoteException e)
{
e.printStackTrace();
}
}
logger.debug("Exit DocValidator.preValidateAction() status=" + validatioNStatus);
return validatioNStatus;
}
}
PetrH
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.