Example usage for com.liferay.portal.kernel.util StringPool POUND

List of usage examples for com.liferay.portal.kernel.util StringPool POUND

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringPool POUND.

Prototype

String POUND

To view the source code for com.liferay.portal.kernel.util StringPool POUND.

Click Source Link

Usage

From source file:com.liferay.alloy.mvc.AlloyPermission.java

License:Open Source License

protected static String formatActionId(String controller, String action) {
    StringBuilder sb = new StringBuilder(StringUtil.toUpperCase(action));

    for (int i = 0; i < action.length(); i++) {
        char c = action.charAt(i);

        if (Character.isUpperCase(c) && (i > 0)) {
            int delta = sb.length() - action.length();

            sb.insert(i + delta, CharPool.UNDERLINE);
        }/*from w w  w. java2 s .c  om*/
    }

    sb.append(StringPool.POUND);
    sb.append(StringUtil.toUpperCase(controller));

    return sb.toString();
}

From source file:com.liferay.alloy.mvc.BaseAlloyControllerImpl.java

License:Open Source License

protected String getMethodKey(String methodName, Class<?>... parameterTypes) {

    StringBundler sb = new StringBundler(parameterTypes.length * 2 + 2);

    sb.append(methodName);//from w w  w.j av a2 s.com
    sb.append(StringPool.POUND);

    for (Class<?> parameterType : parameterTypes) {
        sb.append(parameterType.getName());
        sb.append(StringPool.POUND);
    }

    return sb.toString();
}

From source file:com.liferay.bookmarks.uad.aggregator.BookmarksEntryUADEntityAggregator.java

License:Open Source License

private long _getEntryId(String uadEntityId) {
    String[] uadEntityIdParts = uadEntityId.split(StringPool.POUND);

    return Long.parseLong(uadEntityIdParts[0]);
}

From source file:com.liferay.bookmarks.uad.aggregator.BookmarksEntryUADEntityAggregator.java

License:Open Source License

private String _getUADEntityId(long userId, BookmarksEntry bookmarksEntry) {
    return String.valueOf(bookmarksEntry.getEntryId()) + StringPool.POUND + String.valueOf(userId);
}

From source file:com.liferay.bookmarks.uad.aggregator.BookmarksEntryUADEntityAggregator.java

License:Open Source License

private long _getUserId(String uadEntityId) {
    String[] uadEntityIdParts = uadEntityId.split(StringPool.POUND);

    return Long.parseLong(uadEntityIdParts[1]);
}

From source file:com.liferay.calendar.util.ColorUtil.java

License:Open Source License

public static String toHexString(int color) {
    return StringPool.POUND.concat(String.format("%06X", (0xFFFFFF & color)));
}

From source file:com.liferay.ci.portlet.JenkinsIntegrationPortlet.java

License:Open Source License

protected void buildSeries(RenderRequest request) {
    PortletPreferences portletPreferences = request.getPreferences();

    String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);

    String jobName = portletPreferences.getValue("jobname", StringPool.BLANK);

    _log.debug("Getting builds for " + jobName);

    String buildsNumber = portletPreferences.getValue("buildsnumber", StringPool.BLANK);

    try {//from  w  ww  . j  a  v  a 2 s .co m
        int maxBuildNumber = 0;

        if (Validator.isNotNull(buildsNumber)) {
            maxBuildNumber = Integer.parseInt(buildsNumber);

            _log.debug("Max BuildNumber for build: " + maxBuildNumber);
        }

        String jobCacheKey = jobName + StringPool.POUND + buildsNumber;

        if (!_cache.containsKey(portletId, jobCacheKey)) {
            JSONArray testResults = JenkinsConnectUtil.getBuilds(getConnectionParams(portletPreferences),
                    jobName, maxBuildNumber);

            _cache.put(portletId, jobCacheKey, testResults);
        }

        request.setAttribute("TEST_RESULTS", _cache.get(portletId, jobCacheKey));
    } catch (IOException ioe) {
        SessionErrors.add(request, ioe.getClass());

        _log.error("The job was not available", ioe);
    } catch (JSONException e) {
        _log.error("The job is not well-formed", e);
    }
}

From source file:com.liferay.document.library.repository.cmis.internal.CMISRepository.java

License:Open Source License

@Override
public void initRepository() throws PortalException {
    try {/*from w  ww. j a  v a  2s  .  c  o  m*/
        _sessionKey = Session.class.getName().concat(StringPool.POUND)
                .concat(String.valueOf(getRepositoryId()));

        Session session = getSession();

        session.getRepositoryInfo();
    } catch (PortalException | SystemException e) {
        throw e;
    } catch (Exception e) {
        processException(e);

        throw new RepositoryException("Unable to initialize CMIS session for repository with "
                + "{repositoryId=" + getRepositoryId() + "}", e);
    }
}

From source file:com.liferay.document.library.repository.external.cache.ConnectionCache.java

License:Open Source License

public ConnectionCache(Class<T> connectionClass, long repositoryId, ConnectionBuilder<T> connectionBuilder) {

    _connectionBuilder = connectionBuilder;

    _sessionKey = ConnectionCache.class.getName() + StringPool.POUND + repositoryId;

    _connectionThreadLocal = new AutoResetThreadLocal<>(connectionClass.getName());
}

From source file:com.liferay.dynamic.data.mapping.form.analytics.internal.servlet.taglib.DDMFormAnalyticsDynamicInclude.java

License:Open Source License

@Override
public void include(HttpServletRequest request, HttpServletResponse response, String key) throws IOException {

    Map<String, String> values = new HashMap<>();

    values.put("analyticsGatewayUrl", getAnalyticsGatewayUrl());

    ScriptData scriptData = new ScriptData();

    scriptData.append(null,/*from   www.j  a  v  a 2  s. c  o  m*/
            StringUtil.replaceToStringBundler(_TMPL_CONTENT, StringPool.POUND, StringPool.POUND, values), null,
            ScriptData.ModulesType.AUI);

    scriptData.writeTo(response.getWriter());
}