List of usage examples for com.liferay.portal.kernel.util StringPool PERIOD
String PERIOD
To view the source code for com.liferay.portal.kernel.util StringPool PERIOD.
Click Source Link
From source file:com.liferay.rtl.servlet.filters.dynamiccss.DynamicCSSUtil.java
License:Open Source License
private static String _getRtlCustomFileName(String fileName) { int pos = fileName.lastIndexOf(StringPool.PERIOD); return fileName.substring(0, pos) + "_rtl" + fileName.substring(pos); }
From source file:com.liferay.rtl.tools.RtlCssBuilder.java
License:Open Source License
private String _getRtlFileName(String fileName) { int pos = fileName.lastIndexOf(StringPool.PERIOD); return fileName.substring(0, pos) + "_rtl" + fileName.substring(pos); }
From source file:com.liferay.stocks.util.StocksUtil.java
License:Open Source License
public static Stocks getStocks(String symbol) { WebCacheItem wci = new StocksWebCacheItem(symbol); String key = StocksUtil.class.getName() + StringPool.PERIOD + symbol; try {//ww w .j a v a2s . c o m return (Stocks) WebCachePoolUtil.get(key, wci); } catch (ClassCastException cce) { WebCachePoolUtil.remove(key); return (Stocks) WebCachePoolUtil.get(key, wci); } }
From source file:com.liferay.sync.hook.upgrade.v1_0_1.UpgradeSyncDLObject.java
License:Open Source License
protected void updateColumn(String tableName, String columnName1, String columnName2, String columnName3, String primaryKeyColumnName, Object columnDefaultValue, String[] types) throws Exception { StringBundler sb = new StringBundler(types.length * 4 + 24); sb.append("update SyncDLObject set "); sb.append(columnName1);//from w w w.ja v a 2 s .c o m sb.append(" = (select "); sb.append(columnName2); sb.append(" from "); sb.append(tableName); sb.append(" where ("); sb.append(tableName); sb.append(StringPool.PERIOD); sb.append(primaryKeyColumnName); sb.append(" = SyncDLObject.typePK"); if (columnName3 != null) { sb.append(" and "); sb.append(tableName); sb.append(StringPool.PERIOD); sb.append(columnName3); sb.append(" = SyncDLObject."); sb.append(columnName3); } sb.append(")) where ("); for (int i = 0; i < types.length; i++) { sb.append("type_ = '"); sb.append(types[i]); sb.append(StringPool.APOSTROPHE); if ((i + 1) < types.length) { sb.append(" or "); } } sb.append(") and ("); sb.append(columnName1); sb.append(" is null or "); sb.append(columnName1); sb.append(" = "); sb.append(columnDefaultValue); sb.append(StringPool.CLOSE_PARENTHESIS); runSQL(sb.toString()); }
From source file:com.liferay.sync.hook.upgrade.v1_0_2.UpgradeSyncDLObject.java
License:Open Source License
protected void updateColumn(String tableName, String primaryKeyColumnName, String[] types) throws Exception { StringBundler sb = new StringBundler(types.length * 4 + 7); sb.append("update SyncDLObject set treePath = (select treePath from "); sb.append(tableName);// ww w. ja v a 2 s . c o m sb.append(" where ("); sb.append(tableName); sb.append(StringPool.PERIOD); sb.append(primaryKeyColumnName); sb.append(" = SyncDLObject.typePK)) where ("); for (int i = 0; i < types.length; i++) { sb.append("type_ = '"); sb.append(types[i]); sb.append(StringPool.APOSTROPHE); if ((i + 1) < types.length) { sb.append(" or "); } } sb.append(")"); runSQL(sb.toString()); }
From source file:com.liferay.taglib.ui.FlashTag.java
License:Open Source License
@Override protected void cleanUp() { _align = "left"; _allowFullScreen = Boolean.FALSE.toString(); _allowScriptAccess = "sameDomain"; _base = StringPool.PERIOD; _bgcolor = "#FFFFFF"; _devicefont = Boolean.TRUE.toString(); _flashvars = StringPool.BLANK;// ww w .ja v a 2s . c o m _height = "500"; _id = StringPool.BLANK; _loop = Boolean.TRUE.toString(); _menu = Boolean.FALSE.toString(); _movie = StringPool.BLANK; _play = Boolean.FALSE.toString(); _quality = "best"; _salign = StringPool.BLANK; _scale = "showall"; _swliveconnect = Boolean.FALSE.toString(); _version = "7"; _width = "100%"; _wmode = "opaque"; }
From source file:com.liferay.taglib.util.GetUrlTag.java
License:Open Source License
@Override public int doEndTag() throws JspException { try {/*from ww w . j a v a 2s . c o m*/ WebCacheItem wci = new GetUrlWebCacheItem(_url, _expires); String content = (String) WebCachePoolUtil.get(GetUrlTag.class.getName() + StringPool.PERIOD + _url, wci); if (Validator.isNotNull(_var)) { pageContext.setAttribute(_var, content); } else { JspWriter jspWriter = pageContext.getOut(); jspWriter.print(content); } return EVAL_PAGE; } catch (Exception e) { throw new JspException(e); } }
From source file:com.liferay.tools.sourceformatter.BaseSourceProcessor.java
License:Open Source License
protected void checkLanguageKeys(String fileName, String content, Pattern pattern) throws IOException { String fileExtension = fileUtil.getExtension(fileName); if (!portalSource || fileExtension.equals("vm")) { return;/* w w w .j av a 2s . c o m*/ } if (_portalLanguageProperties == null) { _portalLanguageProperties = new Properties(); ClassLoader classLoader = BaseSourceProcessor.class.getClassLoader(); InputStream inputStream = classLoader.getResourceAsStream("content/Language.properties"); _portalLanguageProperties.load(inputStream); } Matcher matcher = pattern.matcher(content); while (matcher.find()) { String[] languageKeys = getLanguageKeys(matcher); for (String languageKey : languageKeys) { if (Validator.isNumber(languageKey) || languageKey.endsWith(StringPool.DASH) || languageKey.endsWith(StringPool.OPEN_BRACKET) || languageKey.endsWith(StringPool.PERIOD) || languageKey.endsWith(StringPool.UNDERLINE) || languageKey.startsWith(StringPool.DASH) || languageKey.startsWith(StringPool.OPEN_BRACKET) || languageKey.startsWith(StringPool.OPEN_CURLY_BRACE) || languageKey.startsWith(StringPool.PERIOD) || languageKey.startsWith(StringPool.UNDERLINE) || _portalLanguageProperties.containsKey(languageKey)) { continue; } Properties languageProperties = getLanguageProperties(fileName); if ((languageProperties == null) || !languageProperties.containsKey(languageKey)) { processErrorMessage(fileName, "missing language key: " + languageKey + StringPool.SPACE + fileName); } } } }
From source file:com.liferay.tools.sourceformatter.BaseSourceProcessor.java
License:Open Source License
protected Map<String, String> getCompatClassNamesMap() throws IOException { if (_compatClassNamesMap != null) { return _compatClassNamesMap; }// www . j av a2 s .c om Map<String, String> compatClassNamesMap = new HashMap<String, String>(); String[] includes = new String[] { "**\\portal-compat-shared\\src\\com\\liferay\\compat\\**\\*.java" }; String basedir = BASEDIR; List<String> fileNames = new ArrayList<String>(); for (int i = 0; i < 3; i++) { fileNames = getFileNames(basedir, new String[0], includes); if (!fileNames.isEmpty()) { break; } basedir = "../" + basedir; } for (String fileName : fileNames) { if (!fileName.startsWith("shared")) { break; } File file = new File(basedir + fileName); String content = fileUtil.read(file); fileName = StringUtil.replace(fileName, StringPool.BACK_SLASH, StringPool.SLASH); fileName = StringUtil.replace(fileName, StringPool.SLASH, StringPool.PERIOD); int pos = fileName.indexOf("com."); String compatClassName = fileName.substring(pos); compatClassName = compatClassName.substring(0, compatClassName.length() - 5); String extendedClassName = StringUtil.replace(compatClassName, "compat.", StringPool.BLANK); if (content.contains("extends " + extendedClassName)) { compatClassNamesMap.put(compatClassName, extendedClassName); } } _compatClassNamesMap = compatClassNamesMap; return _compatClassNamesMap; }
From source file:com.liferay.tools.sourceformatter.BaseSourceProcessor.java
License:Open Source License
protected String getMainReleaseVersion() { if (_mainReleaseVersion != null) { return _mainReleaseVersion; }/*from w w w .j a va2 s . c om*/ String releaseVersion = ReleaseInfo.getVersion(); int pos = releaseVersion.lastIndexOf(StringPool.PERIOD); _mainReleaseVersion = releaseVersion.substring(0, pos) + ".0"; return _mainReleaseVersion; }