public class MyPortalWidgetDecoratorContainer extends BaseFrameDecoratorContainer {
@Override
public boolean needsDecoration(Widget showlet, RequestContext reqCtx) {
try {
IPage page = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
Integer currentFrame = (Integer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME);
IMyPortalConfigManager myportalConfigManager =
(IMyPortalConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.MYPORTAL_CONFIG_MANAGER, reqCtx.getRequest());
Set<String> allowedShowlet = myportalConfigManager.getConfig().getAllowedShowlets();
MyPortalPageModel model = (MyPortalPageModel) page.getModel();
Frame currentFrameObject = model.getFrameConfigs()[currentFrame];
return (!currentFrameObject.isLocked() && allowedShowlet.contains(showlet.getType().getCode()));
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "needsDecoration", "Error checking widget decorators");
throw new RuntimeException("Error checking widget decorators", t);