*/
public class CheckValidWidgetTag extends TagSupport {
@Override
public int doStartTag() throws JspException {
IMyPortalConfigManager myPortalConfigManager = (IMyPortalConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.MYPORTAL_CONFIG_MANAGER, pageContext);
HttpServletRequest req = (HttpServletRequest) this.pageContext.getRequest();
try {
boolean check = false;
RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
Widget currentShowlet = (Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
if (null != currentShowlet && null != currentShowlet.getType()) {
String typeCode = currentShowlet.getType().getCode();
Set<String> showletTypeCodes = myPortalConfigManager.getConfig().getAllowedShowlets();
check = showletTypeCodes.contains(typeCode);
}
if (null != this.getVar()) {
this.pageContext.setAttribute(this.getVar(), new Boolean(check));
}