List of usage examples for com.liferay.portal.kernel.util PropsUtil get
public static String get(String key, Filter filter)
From source file:com.liferay.taglib.ui.SocialBookmarkTag.java
License:Open Source License
@Override protected void setAttributes(HttpServletRequest request) { String jspPath = _jspPaths.get(_type); if (jspPath == null) { jspPath = PropsUtil.get(PropsKeys.SOCIAL_BOOKMARK_JSP, new Filter(_type)); _jspPaths.put(_type, jspPath);//from w ww . ja va2s . com } _jspPath = jspPath; if (Validator.isNull(_jspPath)) { request.setAttribute("liferay-ui:social-bookmark:postUrl", getPostUrl()); } request.setAttribute("liferay-ui:social-bookmark:target", _target); request.setAttribute("liferay-ui:social-bookmark:title", _title); request.setAttribute("liferay-ui:social-bookmark:type", _type); request.setAttribute("liferay-ui:social-bookmark:url", _url); }
From source file:com.liferay.taglib.ui.SocialBookmarkTag.java
License:Open Source License
private String getPostUrl() { Map<String, String> vars = new HashMap<String, String>(); vars.put("liferay:social-bookmark:title", HttpUtil.encodeURL(_title)); vars.put("liferay:social-bookmark:url", _url); String postUrl = PropsUtil.get(PropsKeys.SOCIAL_BOOKMARK_POST_URL, new Filter(_type, vars)); return postUrl; }
From source file:com.twelve.capital.external.feed.util.HttpImpl.java
License:Open Source License
public HostConfiguration getHostConfiguration(String location) throws IOException { if (_log.isDebugEnabled()) { _log.debug("Location is " + location); }//from w ww . j a va2s . com HostConfiguration hostConfiguration = new HostConfiguration(); hostConfiguration.setHost(new URI(location, false)); if (isProxyHost(hostConfiguration.getHost())) { hostConfiguration.setProxy(_PROXY_HOST, _PROXY_PORT); } HttpConnectionManager httpConnectionManager = _httpClient.getHttpConnectionManager(); HttpConnectionManagerParams httpConnectionManagerParams = httpConnectionManager.getParams(); int defaultMaxConnectionsPerHost = httpConnectionManagerParams.getMaxConnectionsPerHost(hostConfiguration); int maxConnectionsPerHost = GetterUtil.getInteger(PropsUtil.get( HttpImpl.class.getName() + ".max.connections.per.host", new Filter(hostConfiguration.getHost()))); if ((maxConnectionsPerHost > 0) && (maxConnectionsPerHost != defaultMaxConnectionsPerHost)) { httpConnectionManagerParams.setMaxConnectionsPerHost(hostConfiguration, maxConnectionsPerHost); } int timeout = GetterUtil.getInteger( PropsUtil.get(HttpImpl.class.getName() + ".timeout", new Filter(hostConfiguration.getHost()))); if (timeout > 0) { HostParams hostParams = hostConfiguration.getParams(); hostParams.setIntParameter(HttpConnectionParams.CONNECTION_TIMEOUT, timeout); hostParams.setIntParameter(HttpConnectionParams.SO_TIMEOUT, timeout); } return hostConfiguration; }