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

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

Introduction

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

Prototype

String BLANK

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

Click Source Link

Usage

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstanceModelImpl.java

License:Open Source License

@JSON
@Override/*  ww w .  j  a  va2  s.c o m*/
public String getAdminnode() {
    if (_adminnode == null) {
        return StringPool.BLANK;
    } else {
        return _adminnode;
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstanceModelImpl.java

License:Open Source License

@JSON
@Override/* w ww .  ja v  a  2  s .  c o m*/
public String getMaintenance() {
    if (_maintenance == null) {
        return StringPool.BLANK;
    } else {
        return _maintenance;
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstanceModelImpl.java

License:Open Source License

@JSON
@Override/*from  ww w .j a  v  a  2 s  .  c o  m*/
public String getInstalllog() {
    if (_installlog == null) {
        return StringPool.BLANK;
    } else {
        return _installlog;
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstancePortCacheModel.java

License:Open Source License

@Override
public ApplicationInstancePort toEntityModel() {
    ApplicationInstancePortImpl applicationInstancePortImpl = new ApplicationInstancePortImpl();

    applicationInstancePortImpl.setApplicationInstancePortId(applicationInstancePortId);
    applicationInstancePortImpl.setGroupId(groupId);
    applicationInstancePortImpl.setCompanyId(companyId);
    applicationInstancePortImpl.setUserId(userId);

    if (userName == null) {
        applicationInstancePortImpl.setUserName(StringPool.BLANK);
    } else {/*  w  ww  .  j  a  va2 s  . com*/
        applicationInstancePortImpl.setUserName(userName);
    }

    if (createDate == Long.MIN_VALUE) {
        applicationInstancePortImpl.setCreateDate(null);
    } else {
        applicationInstancePortImpl.setCreateDate(new Date(createDate));
    }

    if (modifiedDate == Long.MIN_VALUE) {
        applicationInstancePortImpl.setModifiedDate(null);
    } else {
        applicationInstancePortImpl.setModifiedDate(new Date(modifiedDate));
    }

    applicationInstancePortImpl.setPort(port);

    if (portId == null) {
        applicationInstancePortImpl.setPortId(StringPool.BLANK);
    } else {
        applicationInstancePortImpl.setPortId(portId);
    }

    applicationInstancePortImpl.setPrimary(primary);

    if (subdomain == null) {
        applicationInstancePortImpl.setSubdomain(StringPool.BLANK);
    } else {
        applicationInstancePortImpl.setSubdomain(subdomain);
    }

    applicationInstancePortImpl.setApplicationInstanceId(applicationInstanceId);

    applicationInstancePortImpl.resetOriginalValues();

    return applicationInstancePortImpl;
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstancePortCacheModel.java

License:Open Source License

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(applicationInstancePortId);

    objectOutput.writeLong(groupId);/*  w w w.j  a v a  2s . c om*/

    objectOutput.writeLong(companyId);

    objectOutput.writeLong(userId);

    if (userName == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(userName);
    }

    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);

    objectOutput.writeLong(port);

    if (portId == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(portId);
    }

    objectOutput.writeBoolean(primary);

    if (subdomain == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(subdomain);
    }

    objectOutput.writeLong(applicationInstanceId);
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstancePortModelImpl.java

License:Open Source License

@JSON
@Override/*from  ww w. j a  v  a  2  s  .co m*/
public String getPortId() {
    if (_portId == null) {
        return StringPool.BLANK;
    } else {
        return _portId;
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstancePortModelImpl.java

License:Open Source License

@JSON
@Override//from   w  w  w .j a va2  s. com
public String getSubdomain() {
    if (_subdomain == null) {
        return StringPool.BLANK;
    } else {
        return _subdomain;
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstanceStatusCacheModel.java

License:Open Source License

@Override
public ApplicationInstanceStatus toEntityModel() {
    ApplicationInstanceStatusImpl applicationInstanceStatusImpl = new ApplicationInstanceStatusImpl();

    applicationInstanceStatusImpl.setApplicationInstanceStatusId(applicationInstanceStatusId);
    applicationInstanceStatusImpl.setGroupId(groupId);
    applicationInstanceStatusImpl.setCompanyId(companyId);
    applicationInstanceStatusImpl.setUserId(userId);

    if (userName == null) {
        applicationInstanceStatusImpl.setUserName(StringPool.BLANK);
    } else {/*w w w  .  j av a2 s.  co  m*/
        applicationInstanceStatusImpl.setUserName(userName);
    }

    if (createDate == Long.MIN_VALUE) {
        applicationInstanceStatusImpl.setCreateDate(null);
    } else {
        applicationInstanceStatusImpl.setCreateDate(new Date(createDate));
    }

    if (modifiedDate == Long.MIN_VALUE) {
        applicationInstanceStatusImpl.setModifiedDate(null);
    } else {
        applicationInstanceStatusImpl.setModifiedDate(new Date(modifiedDate));
    }

    applicationInstanceStatusImpl.setApplicationInstanceId(applicationInstanceId);

    if (status == null) {
        applicationInstanceStatusImpl.setStatus(StringPool.BLANK);
    } else {
        applicationInstanceStatusImpl.setStatus(status);
    }

    applicationInstanceStatusImpl.resetOriginalValues();

    return applicationInstanceStatusImpl;
}

From source file:at.graz.meduni.bibbox.liferay.portlet.model.impl.ApplicationInstanceStatusCacheModel.java

License:Open Source License

@Override
public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeLong(applicationInstanceStatusId);

    objectOutput.writeLong(groupId);/*from w w w .  j  ava2 s  . co m*/

    objectOutput.writeLong(companyId);

    objectOutput.writeLong(userId);

    if (userName == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(userName);
    }

    objectOutput.writeLong(createDate);
    objectOutput.writeLong(modifiedDate);

    objectOutput.writeLong(applicationInstanceId);

    if (status == null) {
        objectOutput.writeUTF(StringPool.BLANK);
    } else {
        objectOutput.writeUTF(status);
    }
}

From source file:at.graz.meduni.bibbox.liferay.portlet.service.persistence.impl.ApplicationInstancePersistenceImpl.java

License:Open Source License

/**
 * Returns an ordered range of all the application instances where folderName = ?.
 *
 * <p>/*from  ww w. j a va  2  s .co  m*/
 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ApplicationInstanceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
 * </p>
 *
 * @param folderName the folder name
 * @param start the lower bound of the range of application instances
 * @param end the upper bound of the range of application instances (not inclusive)
 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
 * @param retrieveFromCache whether to retrieve from the finder cache
 * @return the ordered range of matching application instances
 */
@Override
public List<ApplicationInstance> findByFolderName(String folderName, int start, int end,
        OrderByComparator<ApplicationInstance> orderByComparator, boolean retrieveFromCache) {
    boolean pagination = true;
    FinderPath finderPath = null;
    Object[] finderArgs = null;

    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) && (orderByComparator == null)) {
        pagination = false;
        finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FOLDERNAME;
        finderArgs = new Object[] { folderName };
    } else {
        finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_FOLDERNAME;
        finderArgs = new Object[] { folderName, start, end, orderByComparator };
    }

    List<ApplicationInstance> list = null;

    if (retrieveFromCache) {
        list = (List<ApplicationInstance>) finderCache.getResult(finderPath, finderArgs, this);

        if ((list != null) && !list.isEmpty()) {
            for (ApplicationInstance applicationInstance : list) {
                if (!Objects.equals(folderName, applicationInstance.getFolderName())) {
                    list = null;

                    break;
                }
            }
        }
    }

    if (list == null) {
        StringBundler query = null;

        if (orderByComparator != null) {
            query = new StringBundler(3 + (orderByComparator.getOrderByFields().length * 2));
        } else {
            query = new StringBundler(3);
        }

        query.append(_SQL_SELECT_APPLICATIONINSTANCE_WHERE);

        boolean bindFolderName = false;

        if (folderName == null) {
            query.append(_FINDER_COLUMN_FOLDERNAME_FOLDERNAME_1);
        } else if (folderName.equals(StringPool.BLANK)) {
            query.append(_FINDER_COLUMN_FOLDERNAME_FOLDERNAME_3);
        } else {
            bindFolderName = true;

            query.append(_FINDER_COLUMN_FOLDERNAME_FOLDERNAME_2);
        }

        if (orderByComparator != null) {
            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, orderByComparator);
        } else if (pagination) {
            query.append(ApplicationInstanceModelImpl.ORDER_BY_JPQL);
        }

        String sql = query.toString();

        Session session = null;

        try {
            session = openSession();

            Query q = session.createQuery(sql);

            QueryPos qPos = QueryPos.getInstance(q);

            if (bindFolderName) {
                qPos.add(folderName);
            }

            if (!pagination) {
                list = (List<ApplicationInstance>) QueryUtil.list(q, getDialect(), start, end, false);

                Collections.sort(list);

                list = Collections.unmodifiableList(list);
            } else {
                list = (List<ApplicationInstance>) QueryUtil.list(q, getDialect(), start, end);
            }

            cacheResult(list);

            finderCache.putResult(finderPath, finderArgs, list);
        } catch (Exception e) {
            finderCache.removeResult(finderPath, finderArgs);

            throw processException(e);
        } finally {
            closeSession(session);
        }
    }

    return list;
}