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

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

Introduction

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

Prototype

public static boolean isNotBlank(String str) 

Source Link

Document

Checks if a String is not empty (""), not null and not whitespace only.

Usage

From source file:com.ultrapower.eoms.common.plugin.ecside.view.html.RowBuilder.java

public void rowStart() {
    html.tr(0);/*from w  ww.  j ava 2s .  co m*/
    if (StringUtils.isNotBlank(row.getId())){
       html.append(" id=\""+row.getId()+"\" ");
    }
    styleClass();
    style();
    onclick();
    ondblclick();
    onmouseover();
    onmouseout();
        
    html.append(" ").append(ECSideUtils.nullToBlank(row.getTagAttributes())).append(" ");
    html.append(row.getAttribute(TableConstants.EXTEND_ATTRIBUTES));
        
    String recordKey=row.getRecordKey();
    if (StringUtils.isNotBlank(recordKey)){
       html.append(" recordKey=\"").append(recordKey).append("\" ");
    }
    html.close();
}

From source file:com.sfs.whichdoctor.checker.PersonChecker.java

/**
 * Check to see if the supplied person details are similar to others.
 *
 * @param person the person//  w  w w.  ja  v  a 2s  .c  om
 * @return the list
 */
public Collection<PersonBean> similar(final PersonBean person) {

    Collection<PersonBean> people = new ArrayList<PersonBean>();

    boolean checkRequired = false;

    if (person != null) {
        if (person.getPersonIdentifier() > 0 || StringUtils.isNotBlank(person.getFirstName())
                || StringUtils.isNotBlank(person.getLastName())) {
            checkRequired = true;
        }
    }

    if (checkRequired) {
        // Setup initial search object
        SearchBean search = searchDAO.initiate("person", new UserBean());

        PersonBean criteria = (PersonBean) search.getSearchCriteria();

        if (person.getPersonIdentifier() > 0) {
            criteria.setPersonIdentifier(person.getPersonIdentifier());
        }
        if (StringUtils.isNotBlank(person.getFirstName())) {
            criteria.setFirstName(person.getFirstName());
        }
        if (StringUtils.isNotBlank(person.getLastName())) {
            criteria.setLastName(person.getLastName());
        }

        search.setSearchCriteria(criteria);

        try {
            SearchResultsBean results = searchDAO.search(search);

            if (results != null && results.getSearchResults() != null) {
                for (Object result : results.getSearchResults()) {
                    PersonBean foundPerson = (PersonBean) result;
                    // Ensure that the GUIDs do not match, i.e. it isn't the source
                    if (person.getGUID() != foundPerson.getGUID()) {
                        people.add(foundPerson);
                    }
                }
            }

        } catch (WhichDoctorSearchDaoException wdse) {
            dataLogger.error("Error performing the similar person search: " + wdse.getMessage());
        }
    }
    return people;
}

From source file:gr.abiss.calipso.wicket.components.validators.SimpleDateFormatValidator.java

/**
 * Checks a value is a valid SimpleDateFormat Expression.
 * /*from  w  ww  .  j  av a2s .co m*/
 * @param validatable
 *            the <code>IValidatable</code> to check
 */
protected void onValidate(IValidatable validatable) {
    boolean isValid = true;
    String expression = (String) validatable.getValue();
    if (StringUtils.isNotBlank(expression)) {
        try {
            new SimpleDateFormat(expression);
        } catch (PatternSyntaxException e) {
            isValid = false;
        }
    } else {
        isValid = false;
    }

    if (!isValid) {
        error(validatable);
    }
}

From source file:com.agiletec.aps.tags.PageWithWidgetTag.java

@Override
public int doStartTag() throws JspException {
    IPageManager pageManager = (IPageManager) ApsWebApplicationUtils.getBean(SystemConstants.PAGE_MANAGER,
            this.pageContext);
    try {//from   w  w w.  j  a  va 2 s  . c o  m
        List<IPage> pages = pageManager.getWidgetUtilizers(this.getWidgetTypeCode());
        if (StringUtils.isNotBlank(this.getFilterParamName())
                && StringUtils.isNotBlank(this.getFilterParamValue())) {
            pages = this.filterByConfigParamValue(pages);
        }
        if (this.isListResult()) {
            this.pageContext.setAttribute(this.getVar(), pages);
        } else if (null != pages && pages.size() > 0) {
            this.pageContext.setAttribute(this.getVar(), pages.get(0));
        }
    } catch (Throwable t) {
        _logger.error("Error in doStartTag", t);
        //ApsSystemUtils.logThrowable(t, this, "doStartTag");
        throw new JspException("Error in doStartTag", t);
    }
    return super.doStartTag();
}

From source file:com.bsb.cms.content.service.utils.PublishUtil.java

public static String getCtURL(String contentId) {
    Calendar date = Calendar.getInstance();
    int month = date.get(Calendar.MONTH) + 1;

    if (StringUtils.isNotBlank(contentId)) {
        return "/" + date.get(Calendar.YEAR) + "/" + (month < 10 ? ("0" + month) : month) + "/" + contentId
                + ".html";
    } else {//from   w w w. j  a va2s. c  om
        return "/" + date.get(Calendar.YEAR) + "/" + (month < 10 ? ("0" + month) : month) + "/";
    }

}

From source file:fr.paris.lutece.plugins.workflow.service.taskinfo.TaskInfoManager.java

/**
 * Get the provider from a given provider key
 * @param strProviderKey the provider key
 * @return the provider//from   w  w w. jav  a2s.  co  m
 */
public static ITaskInfoProvider getProvider(String strProviderKey) {
    if (StringUtils.isNotBlank(strProviderKey)) {
        for (ITaskInfoProvider provider : getProvidersList()) {
            if ((provider != null) && (provider.getTaskType() != null)
                    && strProviderKey.equals(provider.getTaskType().getKey())) {
                return provider;
            }
        }
    }

    return null;
}

From source file:net.sf.zekr.engine.network.NetworkController.java

public NetworkController(PropertiesConfiguration props) {
    this.props = props;

    if (!props.getBoolean("network.proxy.internal.disableJvmUseSystemProxy", false)) {
        System.setProperty("java.net.useSystemProxies", "true");
    }/*w  w  w. j a v  a2  s . c o m*/

    proxySelector = ProxySelector.getDefault();
    defaultProxy = props.getString("network.proxy", "system");
    proxyType = props.getString("network.proxy.type", "HTTP");
    proxyServer = props.getString("network.proxy.server", "127.0.0.1");
    String port = props.getString("network.proxy.port");
    if (StringUtils.isNotBlank(port)) {
        proxyPort = Integer.parseInt(port);
    } else {
        proxyPort = 80;
    }
}

From source file:com.pscnlab.member.daos.impls.RoleDaoImpl.java

@Override
public Page<Role> findByRoleOrPosition(String role, String position, Integer offset, Integer size) {

    FilterMap filterMap = new FilterMap();
    if (StringUtils.isNotBlank(role)) {
        filterMap.eq("role", role);
    }//from  w ww.  j a  v  a 2  s  . c  om
    if (StringUtils.isNotBlank(position)) {
        FilterMap filterMap1 = new FilterMap();
        filterMap1.eq("position", position);
        filterMap.or(filterMap1);
    }
    return super.page(filterMap, offset, size);
}

From source file:gov.nih.nci.calims2.business.common.document.DocumentCRUDEventListener.java

/**
 * {@inheritDoc}/* ww  w  . j  a  va 2  s.  c o  m*/
 */
public Document beforeUpdate(Document inputEntity, Document existingEntity) {
    Document document = super.beforeUpdate(inputEntity, existingEntity);
    try {
        if (StringUtils.isNotBlank(inputEntity.getUniversalResourceLocator())) {
            File file = new File(inputEntity.getUniversalResourceLocator());
            Document tempDocument = storageService.save(file);
            file.delete();
            document.setUniversalResourceLocator(tempDocument.getUniversalResourceLocator());
        }
    } catch (StorageServiceException e) {
        throw new RuntimeException(e);
    }
    return document;
}