List of usage examples for com.liferay.portal.kernel.util ServerDetector isResin
@Deprecated public static boolean isResin()
From source file:com.liferay.asset.taglib.servlet.taglib.AssetCategoriesAvailableTag.java
License:Open Source License
@Override public int doStartTag() throws JspException { try {/*from w w w .java2 s. c o m*/ _assetCategories = AssetCategoryServiceUtil.getCategories(_className, _classPK); if (!_assetCategories.isEmpty()) { return EVAL_BODY_INCLUDE; } return SKIP_BODY; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _className = null; _classPK = 0; } } }
From source file:com.liferay.asset.taglib.servlet.taglib.AssetDisplayTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { try {/*from ww w. j ava 2 s . c om*/ callSetAttributes(); doInclude(null, false); return EVAL_PAGE; } catch (Exception e) { throw new JspException(e); } finally { clearDynamicAttributes(); clearParams(); clearProperties(); cleanUpSetAttributes(); if (!ServerDetector.isResin()) { setPage(null); setUseCustomPage(true); cleanUp(); } } }
From source file:com.liferay.asset.taglib.servlet.taglib.AssetTagsAvailableTag.java
License:Open Source License
@Override public int doStartTag() throws JspException { try {/* www . ja v a2s .c om*/ _assetTags = AssetTagServiceUtil.getTags(_className, _classPK); if (!_assetTags.isEmpty()) { return EVAL_BODY_INCLUDE; } return SKIP_BODY; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _className = null; _classPK = 0; } } }
From source file:com.liferay.expando.taglib.servlet.taglib.CustomAttributesAvailableTag.java
License:Open Source License
@Override public int doStartTag() throws JspException { try {/*from ww w .j a va2 s . co m*/ HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); long companyId = _companyId; if (companyId == 0) { companyId = themeDisplay.getCompanyId(); } ExpandoBridge expandoBridge = null; if (_classPK == 0) { expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(companyId, _className); } else { expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(companyId, _className, _classPK); } List<String> attributeNames = ListUtil.remove(Collections.list(expandoBridge.getAttributeNames()), ListUtil.fromString(_ignoreAttributeNames, StringPool.COMMA)); if (attributeNames.isEmpty()) { return SKIP_BODY; } if (_classPK == 0) { return EVAL_BODY_INCLUDE; } PermissionChecker permissionChecker = themeDisplay.getPermissionChecker(); for (String attributeName : attributeNames) { Serializable value = expandoBridge.getAttribute(attributeName); if (Validator.isNull(value)) { continue; } UnicodeProperties properties = expandoBridge.getAttributeProperties(attributeName); boolean propertyHidden = GetterUtil .getBoolean(properties.get(ExpandoColumnConstants.PROPERTY_HIDDEN)); boolean propertyVisibleWithUpdatePermission = GetterUtil .getBoolean(properties.get(ExpandoColumnConstants.PROPERTY_VISIBLE_WITH_UPDATE_PERMISSION)); if (_editable && propertyVisibleWithUpdatePermission) { if (ExpandoColumnPermissionUtil.contains(permissionChecker, companyId, _className, ExpandoTableConstants.DEFAULT_TABLE_NAME, attributeName, ActionKeys.UPDATE)) { propertyHidden = false; } else { propertyHidden = true; } } if (!propertyHidden && ExpandoColumnPermissionUtil.contains(permissionChecker, companyId, _className, ExpandoTableConstants.DEFAULT_TABLE_NAME, attributeName, ActionKeys.VIEW)) { return EVAL_BODY_INCLUDE; } } return SKIP_BODY; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _className = null; _classPK = 0; _companyId = 0; _editable = false; _ignoreAttributeNames = null; } } }
From source file:com.liferay.frontend.taglib.soy.servlet.taglib.TemplateRendererTag.java
License:Open Source License
protected void cleanUp() { if (!ServerDetector.isResin()) { _componentId = null; _context = null; _module = null; _templateNamespace = null; } }
From source file:com.liferay.taglib.aui.ScriptTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); boolean positionInline = isPositionInLine(); try {/*w w w .java 2s . c o m*/ StringBundler bodyContentSB = getBodyContentAsStringBundler(); String use = getUse(); if (positionInline) { ScriptData scriptData = new ScriptData(); request.setAttribute(ScriptTag.class.getName(), scriptData); scriptData.append(bodyContentSB, use); String page = getPage(); if (FileAvailabilityUtil.isAvailable(pageContext.getServletContext(), page)) { PortalIncludeUtil.include(pageContext, page); } else { processEndTag(scriptData); } } else { ScriptData scriptData = (ScriptData) request.getAttribute(WebKeys.AUI_SCRIPT_DATA); if (scriptData == null) { scriptData = new ScriptData(); request.setAttribute(WebKeys.AUI_SCRIPT_DATA, scriptData); } scriptData.append(bodyContentSB, use); } return EVAL_PAGE; } catch (Exception e) { throw new JspException(e); } finally { if (positionInline) { request.removeAttribute(ScriptTag.class.getName()); } if (!ServerDetector.isResin()) { cleanUp(); } } }
From source file:com.liferay.taglib.ui.CustomAttributesAvailableTag.java
License:Open Source License
@Override public int doStartTag() throws JspException { try {//from w ww . j av a 2s .com HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); long companyId = _companyId; if (companyId == 0) { companyId = themeDisplay.getCompanyId(); } ExpandoBridge expandoBridge = null; if (_classPK == 0) { expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(companyId, _className); } else { expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(companyId, _className, _classPK); } Enumeration<String> enu = expandoBridge.getAttributeNames(); if (!enu.hasMoreElements()) { return SKIP_BODY; } if (_classPK == 0) { return EVAL_BODY_INCLUDE; } PermissionChecker permissionChecker = themeDisplay.getPermissionChecker(); while (enu.hasMoreElements()) { String attributeName = enu.nextElement(); Serializable value = expandoBridge.getAttribute(attributeName); if (Validator.isNull(value)) { continue; } UnicodeProperties properties = expandoBridge.getAttributeProperties(attributeName); boolean propertyHidden = GetterUtil .getBoolean(properties.get(ExpandoColumnConstants.PROPERTY_HIDDEN)); boolean propertyVisibleWithUpdatePermission = GetterUtil .getBoolean(properties.get(ExpandoColumnConstants.PROPERTY_VISIBLE_WITH_UPDATE_PERMISSION)); if (_editable && propertyVisibleWithUpdatePermission) { if (ExpandoColumnPermissionUtil.contains(permissionChecker, companyId, _className, ExpandoTableConstants.DEFAULT_TABLE_NAME, attributeName, ActionKeys.UPDATE)) { propertyHidden = false; } else { propertyHidden = true; } } if (!propertyHidden && ExpandoColumnPermissionUtil.contains(permissionChecker, companyId, _className, ExpandoTableConstants.DEFAULT_TABLE_NAME, attributeName, ActionKeys.VIEW)) { return EVAL_BODY_INCLUDE; } } return SKIP_BODY; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _className = null; _classPK = 0; _companyId = 0; _editable = false; } } }
From source file:com.liferay.taglib.ui.IconListTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { try {//from w ww . ja v a2s . c o m HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); IntegerWrapper iconCount = (IntegerWrapper) request.getAttribute("liferay-ui:icon-list:icon-count"); request.removeAttribute("liferay-ui:icon-list:icon-count"); Boolean singleIcon = (Boolean) request.getAttribute("liferay-ui:icon-list:single-icon"); request.removeAttribute("liferay-ui:icon-list:single-icon"); JspWriter jspWriter = pageContext.getOut(); if ((iconCount != null) && (iconCount.getValue() > 1) && ((singleIcon == null) || _showWhenSingleIcon)) { if (!FileAvailabilityUtil.isAvailable(pageContext.getServletContext(), getStartPage())) { jspWriter.write("<ul class=\"lfr-component taglib-icon-list\">"); } else { PortalIncludeUtil.include(pageContext, _startPage); } } writeBodyContent(jspWriter); if ((iconCount != null) && (iconCount.getValue() > 1) && ((singleIcon == null) || _showWhenSingleIcon)) { if (!FileAvailabilityUtil.isAvailable(pageContext.getServletContext(), getEndPage())) { jspWriter.write("</ul>"); } else { PortalIncludeUtil.include(pageContext, _endPage); } } request.removeAttribute("liferay-ui:icon-list:showWhenSingleIcon"); return EVAL_PAGE; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _endPage = null; _showWhenSingleIcon = false; _startPage = null; } } }
From source file:com.liferay.taglib.ui.IconMenuTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { try {// ww w .j a v a 2 s . c o m return processEndTag(); } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _align = "right"; _cssClass = null; _direction = null; _endPage = null; _extended = true; _icon = null; _id = null; _maxDisplayItems = _DEFAULT_MAX_DISPLAY_ITEMS; _message = "actions"; _showArrow = true; _showExpanded = false; _showWhenSingleIcon = false; _startPage = null; } } }
From source file:com.liferay.taglib.ui.MessageTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { try {//w w w . j av a 2s .c o m String value = StringPool.BLANK; if (_arguments == null) { if (_unicode) { value = UnicodeLanguageUtil.get(pageContext, _key); } else { value = LanguageUtil.get(pageContext, _key); } } else { if (_unicode) { value = UnicodeLanguageUtil.format(pageContext, _key, _arguments, _translateArguments); } else { value = LanguageUtil.format(pageContext, _key, _arguments, _translateArguments); } } JspWriter jspWriter = pageContext.getOut(); jspWriter.write(value); return EVAL_PAGE; } catch (Exception e) { throw new JspException(e); } finally { if (!ServerDetector.isResin()) { _arguments = null; _key = null; _translateArguments = true; _unicode = false; } } }