public void setI18nPath(String i18nPath) { _i18nPath = i18nPath; if (Validator.isNotNull(i18nPath)) { _i18n = true; } else { _i18n = false; } }
public void setI18nLanguageId(String i18nLanguageId) { _i18nLanguageId = i18nLanguageId; if (Validator.isNotNull(i18nLanguageId)) { _i18n = true; } else { _i18n = false; } }
public static void setDefault(String timeZoneId) { if (Validator.isNotNull(timeZoneId)) { _timeZone = TimeZone.getTimeZone(timeZoneId); } }
public static boolean isNull(List<?> list) { if ((list == null) || list.isEmpty()) { return true; } for (Object bean : list) { if (Validator.isNotNull(bean)) { return false; } } return true; }
protected String getOpenSearchURL( String searchPath, ThemeDisplay themeDisplay) { if (Validator.isNotNull(_openSearchURL)) { return _openSearchURL; } return themeDisplay.getPortalURL() + searchPath; }
protected String getURI(HttpServletRequest request, String originalURI) { if (Validator.isNotNull(_contextPath) && !_contextPath.equals(StringPool.SLASH) && originalURI.startsWith(_contextPath)) { originalURI = originalURI.substring(_contextPath.length()); } return HttpUtil.normalizePath(originalURI); }
public static String getOriginalTempFileName(String tempFileName) { String extension = FileUtil.getExtension(tempFileName); int pos = tempFileName.lastIndexOf(TEMP_RANDOM_SUFFIX); if (pos != -1) { tempFileName = tempFileName.substring(0, pos); if (Validator.isNotNull(extension)) { tempFileName = tempFileName + StringPool.PERIOD + extension; } } return tempFileName; }
public static boolean isTestMode() { String liferayMode = SystemProperties.get("liferay.mode"); if (Validator.isNotNull(liferayMode) && liferayMode.equals("test")) { return true; } return false; }
public String getContent() { if (Validator.isNotNull(_label)) { return _label; } return _bodySB.toString(); }
public static String getFeedTypeFormat(String feedType) { if (Validator.isNotNull(feedType)) { String[] parts = StringUtil.split(feedType, StringPool.UNDERLINE); if (parts.length == 2) { return GetterUtil.getString(parts[0], FORMAT_DEFAULT); } } return FORMAT_DEFAULT; }
public String getResourcePortletName() { if (_resourcePortletName == null) { String portletResource = getPortletResource(); if (Validator.isNotNull(portletResource)) { _resourcePortletName = portletResource; } else { _resourcePortletName = getPortletName(); } } return _resourcePortletName; }
protected void sendRedirect( ActionRequest actionRequest, ActionResponse actionResponse) throws IOException { String redirect = getRedirect(actionRequest, actionResponse); if (Validator.isNotNull(redirect)) { actionResponse.sendRedirect(redirect); } }
public static boolean isValidLanguageKey(Locale locale, String key) { String value = getLanguage().get(locale, key, StringPool.BLANK); return Validator.isNotNull(value); }
protected void setClassName(String className) { _className = className; _classSimpleName = getSimpleName(_className); if (Validator.isNotNull(className)) { _classNameId = PortalUtil.getClassNameId(className); } else { _classNameId = 0; } }
@Override public Settings getSettings() throws SettingsException { Settings settings = _settingsLocator.getSettings(); ParameterMapSettings parameterMapSettings = new ParameterMapSettings( _parameterMap, settings); if (Validator.isNotNull(_parameterNamePrefix)) { parameterMapSettings.setParameterNamePrefix(_parameterNamePrefix); } return parameterMapSettings; }
protected ServletContext getServletContext(HttpServletRequest request) { if (_servletContext != null) { return _servletContext; } String portletId = PortalUtil.getPortletId(request); if (Validator.isNotNull(portletId)) { String rootPortletId = PortletIdCodec.decodePortletName(portletId); PortletBag portletBag = PortletBagPool.get(rootPortletId); return portletBag.getServletContext(); } return (ServletContext)request.getAttribute(WebKeys.CTX); }
protected boolean isPanelSelectedPortlet(Layout layout, String portletId) { String panelSelectedPortlets = layout.getTypeSettingsProperty( "panelSelectedPortlets"); if (Validator.isNotNull(panelSelectedPortlets)) { String[] panelSelectedPortletsArray = StringUtil.split( panelSelectedPortlets); return ArrayUtil.contains(panelSelectedPortletsArray, portletId); } return false; }
public String getResourcePortletId() { if (_resourcePortletId == null) { String portletResource = getPortletResource(); if (Validator.isNotNull(portletResource)) { _resourcePortletId = getPortletResource(); } else { _resourcePortletId = getPortletId(); } } return _resourcePortletId; }
@Override public void validate(FileContentReference fileContentReference) throws PortalException { if (Validator.isNotNull( fileContentReference.getSourceFileName())) { DLValidatorUtil.validateFileName( fileContentReference.getSourceFileName()); } }
protected String getThumbnailTempFilePath(String id, String type) { StringBundler sb = new StringBundler(4); sb.append(THUMBNAIL_TMP_PATH); sb.append(id); if (Validator.isNotNull(type)) { sb.append(StringPool.PERIOD); sb.append(type); } return sb.toString(); }