cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Remove details page tabs for reference document sub type

kirkwemple
8-Gravel

Remove details page tabs for reference document sub type

We have configured a sub type of reference document and would like to remove some of the default tabs for this type.  The tabs we want to remove are Details, Structure, Content, Changes, and History.  We have done this previously but the tab we removed was applied to all types.  In this case, it is only for the sub type.   Is it possible to do this?

--Kirk Wemple

1 REPLY 1
BhushanNehe
14-Alexandrite
(To:kirkwemple)

Hi Kirk,

Instead of removing the tabs from action*.xml file, I would prefer using a validator to hide the tabs. You can refer to customization guide page 440 for more details

http://support.ptc.com/WCMS/files/165581/en/10_2_M030_WindchillCustomizationGuide.pdf

You can use the following java for your reference.

package ext.validators;

import java.util.Locale;

import wt.fc.Persistable;

import wt.fc.WTReference;

import wt.util.WTException;

import com.ptc.core.ui.validation.DefaultUIComponentValidator;

import com.ptc.core.ui.validation.UIValidationCriteria;

import com.ptc.core.ui.validation.UIValidationKey;

import com.ptc.core.ui.validation.UIValidationResult;

import com.ptc.core.ui.validation.UIValidationResultSet;

import com.ptc.core.ui.validation.UIValidationStatus;

public class HideTabsForDocSubType extends DefaultUIComponentValidator{

  @Override

  public UIValidationResultSet performFullPreValidation(UIValidationKey arg0,

  UIValidationCriteria arg1, Locale arg2) throws WTException {

  // TODO Auto-generated method stub

  UIValidationResultSet resultSet = UIValidationResultSet.newInstance();

  UIValidationStatus status = UIValidationStatus.ENABLED;

  WTReference contextObject = arg1.getContextObject();

  Persistable persistable = null;

  if(contextObject != null && (contextObject.getObject() instanceof Persistable)){

  persistable = contextObject.getObject();

  if (persistable.getClass().isAssignableFrom(wt.doc.WTDocument.class)) {

  String s = wt.type.TypedUtility.getTypeIdentifier((wt.doc.WTDocument)persistable).toExternalForm();

  if(s.equalsIgnoreCase("WCTYPE|wt.doc.WTDocument|com.ptc.MyType")){

  status = UIValidationStatus.HIDDEN;

  }

  }

  resultSet.addResult(UIValidationResult.newInstance(arg0, status, contextObject));

  return resultSet;

  }

  return super.performFullPreValidation(arg0, arg1, arg2);

  }

  @Override

  public UIValidationResultSet performLimitedPreValidation(

  UIValidationKey arg0, UIValidationCriteria arg1, Locale arg2)

  throws WTException {

  // TODO Auto-generated method stub

  return super.performLimitedPreValidation(arg0, arg1, arg2);

  }

}

regards,

Bhushan

Top Tags