Example usage for org.apache.commons.lang StringUtils lowerCase

List of usage examples for org.apache.commons.lang StringUtils lowerCase

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils lowerCase.

Prototype

public static String lowerCase(String str) 

Source Link

Document

Converts a String to lower case as per String#toLowerCase() .

Usage

From source file:id.ac.idu.webui.logging.loginlog.model.SecLoginlogListModelItemRenderer.java

@Override
public void render(Listitem item, Object data) throws Exception {

    final SecLoginlog log = (SecLoginlog) data;

    Listcell lc;//from   w ww .  j  a v a2  s  . co m
    final LoginStatus loginStatus = getLoginLoggingService().getTypById(log.getLglStatusid());

    lc = new Listcell(getDateTime(log.getLglLogtime()));

    if (log.getLglStatusid() == 0) {
        lc.setStyle("color:red");
    }
    lc.setParent(item);

    lc = new Listcell(log.getLglLoginname());
    if (log.getLglStatusid() == 0) {
        lc.setStyle("color:red");
    }
    lc.setParent(item);

    lc = new Listcell(loginStatus.getStpTypname());
    if (log.getLglStatusid() == 0) {
        lc.setStyle("color:red");
    }
    lc.setParent(item);

    // lc = new Listcell(log.getLglIp());
    // truncate the IP for privacy
    lc = new Listcell(truncateIPForPrivacy(log.getLglIp()));
    if (log.getLglStatusid() == 0) {
        lc.setStyle("color:red");
    }
    lc.setParent(item);

    /* Country Code / Flag+Short+Provider-City */
    final String currentIp = log.getLglIp();
    final Ip2Country ip2 = log.getIp2Country();

    if (ip2 != null) {
        lc = new Listcell();
        final Hbox hbox = new Hbox();
        hbox.setParent(lc);

        // Fill with the related data for CountryCode
        final CountryCode cc = ip2.getCountryCode();
        if (cc != null) {
            /* Flag-image */
            final Image img = new Image();
            final String path = "/images/countrycode_flags/";
            final String flag = StringUtils.lowerCase(cc.getCcdCode2()) + ".gif";
            img.setSrc(path + flag);
            hbox.appendChild(img);

            final Separator sep = new Separator();
            hbox.appendChild(sep);

            /* Country */
            final Label label = new Label();
            label.setValue(cc.getCcdCode2());
            hbox.appendChild(label);

            // show other stuff from the Ip2Country
            /* Provider-City */
            final Label label2 = new Label();
            if (StringUtils.isNotBlank(ip2.getI2cCity())) {
                label2.setValue("(" + ip2.getI2cCity() + ")");
            } else {
                label2.setValue("");
            }

            hbox.appendChild(label2);
        }

        lc.setParent(item);

    } else {
        lc = new Listcell();
        final Hbox hbox = new Hbox();
        hbox.setParent(lc);

        /* Flag-image */
        final Image img = new Image();
        final String path = "/images/countrycode_flags/";
        final String flag = "xx.gif";
        img.setSrc(path + flag);
        hbox.appendChild(img);
        final Label label = new Label();
        label.setValue("Unknown");
        hbox.appendChild(label);

        lc.setParent(item);

    }

    /* Session-ID */
    lc = new Listcell(log.getLglSessionid());
    if (log.getLglStatusid() == 0) {
        lc.setStyle("color:red");
    }
    lc.setParent(item);

    item.setAttribute("data", data);
    // ComponentsCtrl.applyForward(img, "onClick=onImageClicked");
    // ComponentsCtrl.applyForward(item, "onClick=onClicked");
    // ComponentsCtrl.applyForward(item, "onDoubleClick=onDoubleClicked");

}

From source file:cec.easyshop.storefront.controllers.cms.DefaultCMSComponentControllerTest.java

protected String getTestTypeView(final AbstractCMSComponentModel component) {
    return ControllerConstants.Views.Cms.ComponentPrefix + StringUtils.lowerCase(component.getItemtype());
}

From source file:hydrograph.ui.dataviewer.find.StyledTextEventListener.java

/**
 * The function will change selected text background color.
 * @param styledText//from  w  w w. j  av  a  2s . c  om
 * @param text
 * @param foreground
 * @param background
 */
public void allButtonListener(StyledText styledText, String text, Color foreground, Color background,
        Label label) {
    logger.debug("StyledText All button selected");
    int index = 0;
    int recordCount = 0;
    if (styledText == null) {
        return;
    }
    for (; index < styledText.getText().length();) {
        int lastIndex = StringUtils.indexOf(StringUtils.lowerCase(styledText.getText()),
                StringUtils.lowerCase(text), index);

        if (lastIndex < 0) {
            return;
        } else {
            setStyledRange(styledText, lastIndex, text.length(), null, background);
            index = lastIndex + 1;
            recordCount++;
            label.setVisible(true);
            label.setText("Matching count - " + recordCount);
        }
    }
}

From source file:com.lc.storefront.interceptors.beforeview.CmsPageBeforeViewHandler.java

@Override
public void beforeView(final HttpServletRequest request, final HttpServletResponse response,
        final ModelAndView modelAndView) {
    modelAndView.addObject("cmsSite", cmsSiteService.getCurrentSite());
    modelAndView.addObject("version", configurationService.getConfiguration().getProperty(STOREFRONT_VERSION));
    // Look for the page in the model
    final AbstractPageModel page = updateCmsPageInModelAndView(request, modelAndView);

    modelAndView.addObject("pageBodyCssClasses", buildCssClasses(page));
    if (page != null) {
        final Set<String> actonJsFiles = new HashSet();

        final Collection<ContentSlotData> contentSlotsForPage = cmsPageService.getContentSlotsForPage(page);
        for (final ContentSlotData contentSlotData : contentSlotsForPage) {
            final ContentSlotModel contentSlot = contentSlotData.getContentSlot();
            final List<AbstractCMSComponentModel> cmsComponents = contentSlot.getCmsComponents();
            for (final AbstractCMSComponentModel cmsComponent : cmsComponents) {
                final List<AbstractCMSActionModel> actions = cmsComponent.getActions();
                for (final AbstractCMSActionModel action : actions) {
                    actonJsFiles.add(StringUtils.lowerCase(action.getItemtype()) + ".js");
                }/*from   w  w w. j  a va2 s .com*/
            }
        }
        modelAndView.addObject("cmsActionsJsFiles", actonJsFiles);
    }

    // Create the restriction data
    final RequestContextData requestContextData = SpringHelper.getSpringBean(request, "requestContextData",
            RequestContextData.class, true);
    final RestrictionData restrictionData = requestContextRestrictionConverter.convert(requestContextData);

    // Initialise CMS support
    final CmsPageRequestContextData cmsPageRequestContextData = cmsPageContextService
            .updateCmsPageContextForPage(request, page, restrictionData);
    modelAndView.addObject("cmsPageRequestContextData", cmsPageRequestContextData);

    sessionService.setAttribute(LocalizableItem.LANGUAGE_FALLBACK_ENABLED, Boolean.TRUE);
    sessionService.setAttribute(AbstractItemModel.LANGUAGE_FALLBACK_ENABLED_SERVICE_LAYER, Boolean.TRUE);
}

From source file:br.ufpa.gercom.mtuldp.store.EdgeLinkStorageMgm.java

private String getId(ConnectPoint edgeLink) {

    // id = object:type:host:edge
    String id = "%s:%s:%s:%s";

    return StringUtils.lowerCase(String.format(id, EdgeLink.class.getSimpleName(), EdgeLink.Type.EDGE.name(),
            edgeLink.hostId().toString(), edgeLink.deviceId().toString()));
}

From source file:de.hybris.platform.addonsupport.renderer.impl.DefaultAddOnCMSComponentRenderer.java

protected String getUIExperienceFolder() {
    return StringUtils.lowerCase(getUiExperienceService().getUiExperienceLevel().getCode());
}

From source file:mitm.common.fetchmail.Poll.java

@Override
public int hashCode() {
    return new HashCodeBuilder().append(StringUtils.lowerCase(server)).append(port).append(protocol)
            .append(username).toHashCode();
}

From source file:com.streamreduce.core.model.ConnectionCredentials.java

@Override
public boolean equals(Object o) {
    if (o instanceof ConnectionCredentials) {
        ConnectionCredentials that = (ConnectionCredentials) o;
        return new EqualsBuilder()
                .append(StringUtils.lowerCase(this.identity), StringUtils.lowerCase(that.identity))
                .append(this.credential, that.credential).append(this.apiKey, that.apiKey)
                .append(this.oauthToken, that.oauthToken).append(this.oauthTokenSecret, that.oauthTokenSecret)
                .append(this.oauthVerifier, that.oauthVerifier)
                .append(this.oauthRefreshToken, that.oauthRefreshToken).isEquals();
    }/*from w w  w .ja  v  a  2s  .  c  o m*/
    return false;
}

From source file:de.hybris.platform.addonsupport.renderer.impl.DefaultAddOnCMSComponentRenderer.java

protected String getViewResourceName(final C component) {
    return StringUtils.lowerCase(getTypeCode(component));
}

From source file:com.alibaba.otter.node.etl.extract.extractor.ViewExtractor.java

private List<EventColumn> columnFilter(List<EventColumn> eventColumns, List<ColumnPair> columnPairs,
        ColumnPairMode mode) {//from  w w  w  .j  a va 2s.c om
    if (mode == null) {
        mode = ColumnPairMode.INCLUDE;
    }

    List<EventColumn> tempColumns = new ArrayList<EventColumn>();
    Map<String, ColumnPair> viewNames = new HashMap<String, ColumnPair>();
    for (ColumnPair columnPair : columnPairs) {
        viewNames.put(StringUtils.lowerCase(columnPair.getSourceColumn().getName()), columnPair);
    }

    for (EventColumn eventColumn : eventColumns) {
        if (mode.isInclude() && viewNames.containsKey(StringUtils.lowerCase(eventColumn.getColumnName()))) {
            tempColumns.add(eventColumn); // ??
        } else if (mode.isExclude()
                && !viewNames.containsKey(StringUtils.lowerCase(eventColumn.getColumnName()))) {
            // ??
            tempColumns.add(eventColumn);
        }

    }
    return tempColumns;
}