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

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

Introduction

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

Prototype

String SPACE

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

Click Source Link

Usage

From source file:com.liferay.wol.jira.social.JIRAActivityInterpreter.java

License:Open Source License

protected String interpretJIRAChangeItem(JSONObject jiraChangeItem, ThemeDisplay themeDisplay) {

    String field = jiraChangeItem.getString("field");

    field = StringUtil.replace(field.toLowerCase(), StringPool.SPACE, StringPool.DASH);

    String newString = jiraChangeItem.getString("newString");
    String newValue = jiraChangeItem.getString("newValue");

    if (Validator.isNull(newString)) {
        return StringPool.BLANK;
    }/*  www. j a va2s .c o  m*/

    StringBuilder sb = new StringBuilder();

    if (field.equals("description") || field.equals("summary")) {
        sb.append(themeDisplay.translate("activity-wol-jira-add-change-" + field));
        sb.append("<br />");
    } else if (field.equals("assignee") || field.equals("attachment") || field.equals("fix-version")
            || field.equals("issuetype") || field.equals("priority") || field.equals("resolution")
            || field.equals("status") || field.equals("version")) {

        sb.append(themeDisplay.translate("activity-wol-jira-add-change-" + field, new Object[] { newString }));
        sb.append("<br />");
    } else if (field.equals("link") && newValue.startsWith("LEP-")) {
        sb.append(themeDisplay.translate("activity-wol-jira-add-change-" + field, new Object[] { newValue }));
        sb.append("<br />");
    }

    return sb.toString();
}

From source file:com.liferay.wol.model.impl.SVNRevisionImpl.java

License:Open Source License

public Object[] getJIRAIssueAndComments() {
    JIRAIssue jiraIssue = null;//from ww w  .  jav  a2  s .  com
    String comments = getComments();

    if (

    // LEP

    comments.startsWith(_LEP_PREFIX_1) || comments.startsWith(_LEP_PREFIX_2)
            || comments.startsWith(_LEP_PREFIX_3) ||

            // LPE

            comments.startsWith(_LPE_PREFIX_1) || comments.startsWith(_LPE_PREFIX_2)
            || comments.startsWith(_LPE_PREFIX_3) ||

            // LPS

            comments.startsWith(_LPS_PREFIX_1) || comments.startsWith(_LPS_PREFIX_2)
            || comments.startsWith(_LPS_PREFIX_3)) {

        comments = StringUtil.replace(comments, StringPool.NEW_LINE, StringPool.SPACE);

        int pos = comments.indexOf(StringPool.SPACE);

        if (pos == -1) {
            pos = comments.length();
        }

        String keyPrefix = null;
        String keyId = null;

        // LPE

        if (comments.startsWith(_LEP_PREFIX_1)) {
            keyPrefix = "LEP";
            keyId = comments.substring(_LEP_PREFIX_1.length(), pos);
        } else if (comments.startsWith(_LEP_PREFIX_2)) {
            keyPrefix = "LEP";
            keyId = comments.substring(_LEP_PREFIX_2.length(), pos);
        } else if (comments.startsWith(_LEP_PREFIX_3)) {
            keyPrefix = "LEP";
            keyId = comments.substring(_LEP_PREFIX_3.length(), pos);
        }

        // LPE

        if (comments.startsWith(_LPE_PREFIX_1)) {
            keyPrefix = "LPE";
            keyId = comments.substring(_LPE_PREFIX_1.length(), pos);
        } else if (comments.startsWith(_LPE_PREFIX_2)) {
            keyPrefix = "LPE";
            keyId = comments.substring(_LPE_PREFIX_2.length(), pos);
        } else if (comments.startsWith(_LPE_PREFIX_3)) {
            keyPrefix = "LPE";
            keyId = comments.substring(_LPE_PREFIX_3.length(), pos);
        }

        // LPS

        if (comments.startsWith(_LPS_PREFIX_1)) {
            keyPrefix = "LPS";
            keyId = comments.substring(_LPS_PREFIX_1.length(), pos);
        } else if (comments.startsWith(_LPS_PREFIX_2)) {
            keyPrefix = "LPS";
            keyId = comments.substring(_LPS_PREFIX_2.length(), pos);
        } else if (comments.startsWith(_LPS_PREFIX_3)) {
            keyPrefix = "LPS";
            keyId = comments.substring(_LPS_PREFIX_3.length(), pos);
        }

        comments = comments.substring(pos).trim();

        if (Validator.isNumber(keyId)) {
            try {
                jiraIssue = JIRAIssueLocalServiceUtil.getJIRAIssue(keyPrefix + "-" + keyId);
            } catch (Exception e) {
            }
        }

        if (jiraIssue != null) {
            return new Object[] { jiraIssue, comments };
        }
    }

    return null;
}

From source file:com.liferay.wsrp.service.impl.WSRPConsumerPortletLocalServiceImpl.java

License:Open Source License

protected void addPortletExtraInfo(Portlet portlet, PortletApp portletApp,
        PortletDescription portletDescription, String title) {

    MarkupType[] markupTypes = portletDescription.getMarkupTypes();

    for (MarkupType markupType : markupTypes) {
        Set<String> mimeTypePortletModes = new HashSet<String>();

        for (String portletMode : markupType.getModes()) {
            portletMode = StringUtil.toLowerCase(portletMode);

            if (portletMode.startsWith("wsrp:")) {
                portletMode = portletMode.substring(5);
            }/*from  w w  w  . ja v a  2  s . co m*/

            mimeTypePortletModes.add(portletMode);
        }

        portlet.getPortletModes().put(markupType.getMimeType(), mimeTypePortletModes);

        Set<String> mimeTypeWindowStates = new HashSet<String>();

        for (String windowState : markupType.getWindowStates()) {
            windowState = StringUtil.toLowerCase(windowState);

            if (windowState.startsWith("wsrp:")) {
                windowState = windowState.substring(5);
            }

            mimeTypeWindowStates.add(windowState);
        }

        portlet.getWindowStates().put(markupType.getMimeType(), mimeTypeWindowStates);
    }

    String shortTitle = LocalizedStringUtil.getLocalizedStringValue(portletDescription.getShortTitle(), title);
    String keywords = StringUtil.merge(
            LocalizedStringUtil.getLocalizedStringValues(portletDescription.getKeywords()), StringPool.SPACE);
    String description = LocalizedStringUtil.getLocalizedStringValue(portletDescription.getShortTitle());

    PortletInfo portletInfo = new PortletInfo(title, shortTitle, keywords, description);

    portlet.setPortletInfo(portletInfo);

    portlet.setFriendlyURLMapperClass(ConsumerFriendlyURLMapper.class.getName());

    ParameterDescription[] parameterDescriptions = portletDescription.getNavigationalPublicValueDescriptions();

    if (parameterDescriptions != null) {
        for (ParameterDescription parameterDescription : parameterDescriptions) {

            QName[] qNames = parameterDescription.getNames();

            if (ArrayUtil.isEmpty(qNames)) {
                continue;
            }

            com.liferay.portal.kernel.xml.QName qName = getQName(qNames[0]);

            String identifier = parameterDescription.getIdentifier();

            portletApp.addPublicRenderParameter(identifier, qName);

            portlet.addPublicRenderParameter(portletApp.getPublicRenderParameter(identifier));
        }
    }

    QName[] handledEvents = portletDescription.getHandledEvents();

    if (handledEvents != null) {
        for (QName handledEvent : handledEvents) {
            portlet.addProcessingEvent(getQName(handledEvent));
        }
    }

    QName[] publishedEvents = portletDescription.getPublishedEvents();

    if (publishedEvents != null) {
        for (QName publishedEvent : publishedEvents) {
            portlet.addPublishingEvent(getQName(publishedEvent));
        }
    }

    MessageElement[] messageElements = ExtensionHelperUtil
            .getMessageElements(portletDescription.getExtensions());

    if (messageElements != null) {
        for (MessageElement messageElement : messageElements) {
            setExtension(portlet, messageElement);
        }
    }
}

From source file:com.lostsys.lists.service.persistence.TaskListPK.java

License:Open Source License

public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("portlet");
    sb.append(StringPool.EQUAL);/*from   w ww  . ja v a  2  s . com*/
    sb.append(portlet);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("id");
    sb.append(StringPool.EQUAL);
    sb.append(id);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.ms.internet.message.service.persistence.MSMReceiverPK.java

License:Open Source License

public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("userId");
    sb.append(StringPool.EQUAL);//from  www .  ja v  a2  s.  c  o m
    sb.append(userId);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("messageId");
    sb.append(StringPool.EQUAL);
    sb.append(messageId);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.nyu.service.persistence.FavouriteLessonsPK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("userId");
    sb.append(StringPool.EQUAL);/*from w w  w  .java2 s . c  o m*/
    sb.append(userId);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("lessonId");
    sb.append(StringPool.EQUAL);
    sb.append(lessonId);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.nyu.service.persistence.Lesson_UsergroupsPK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("lessonId");
    sb.append(StringPool.EQUAL);/*ww w  . j ava 2 s.co m*/
    sb.append(lessonId);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("groupId");
    sb.append(StringPool.EQUAL);
    sb.append(groupId);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.rcs.dbservice.service.persistence.TweetPK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("groupId");
    sb.append(StringPool.EQUAL);/*from  www  . j  a  va2  s  . c  om*/
    sb.append(groupId);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("tweetId");
    sb.append(StringPool.EQUAL);
    sb.append(tweetId);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.rcs.service.service.persistence.ChatRoomGroupPK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("chatRoomId");
    sb.append(StringPool.EQUAL);/*from   w w  w .  j av  a 2 s  .c o m*/
    sb.append(chatRoomId);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("chatRoomGroupId");
    sb.append(StringPool.EQUAL);
    sb.append(chatRoomGroupId);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}

From source file:com.rcs.service.service.persistence.MessageSourcePK.java

License:Open Source License

@Override
public String toString() {
    StringBundler sb = new StringBundler(10);

    sb.append(StringPool.OPEN_CURLY_BRACE);

    sb.append("key");
    sb.append(StringPool.EQUAL);//from   w  ww.j a  v  a  2s. c o  m
    sb.append(key);

    sb.append(StringPool.COMMA);
    sb.append(StringPool.SPACE);
    sb.append("locale");
    sb.append(StringPool.EQUAL);
    sb.append(locale);

    sb.append(StringPool.CLOSE_CURLY_BRACE);

    return sb.toString();
}