List of usage examples for com.liferay.portal.kernel.util StringPool COMMA
String COMMA
To view the source code for com.liferay.portal.kernel.util StringPool COMMA.
Click Source Link
From source file:com.inikah.slayer.model.impl.ProfileImpl.java
License:Open Source License
/** * /*from w w w . j a va 2 s . co m*/ * @return */ public String getDisplayAge() { if (getComputeAge() == 0.0d) return StringPool.BLANK; String[] parts = String.valueOf(getComputeAge()).split("\\."); StringBuilder sb = new StringBuilder(); sb.append(parts[0]).append(parts[0]); sb.append(StringPool.NBSP).append("Years"); int months = Integer.valueOf(parts[1]); if (months > 0) { sb.append(StringPool.COMMA).append(StringPool.NBSP); sb.append(parts[1]).append(StringPool.NBSP); sb.append("Month"); if (months > 1) { sb.append(CharPool.LOWER_CASE_S); } } return sb.toString(); }
From source file:com.inikah.slayer.model.impl.ProfileImpl.java
License:Open Source License
public String getAllowedMaritalStatus() { StringBuilder sb = new StringBuilder(); long singleStatus = BridgeServiceUtil.getListTypeId(IConstants.LIST_MARITAL_STATUS, "single"); long marriedStatus = BridgeServiceUtil.getListTypeId(IConstants.LIST_MARITAL_STATUS, "married"); long divorcedStatus = BridgeServiceUtil.getListTypeId(IConstants.LIST_MARITAL_STATUS, "divorced"); long widowStatus = BridgeServiceUtil.getListTypeId(IConstants.LIST_MARITAL_STATUS, "widow"); if (isSingle() && !isAllowNonSingleProposals()) { sb.append(singleStatus);/* w w w. j a v a 2 s. c om*/ } if (isSingle() && isAllowNonSingleProposals()) { sb.append(singleStatus); sb.append(StringPool.COMMA); sb.append(divorcedStatus); sb.append(StringPool.COMMA); sb.append(widowStatus); } if (!isSingle()) { if (isBride()) { sb.append(marriedStatus); sb.append(StringPool.COMMA); } sb.append(divorcedStatus); sb.append(StringPool.COMMA); sb.append(widowStatus); } return sb.toString(); }
From source file:com.inikah.slayer.model.impl.ProfileImpl.java
License:Open Source License
public List<KeyValuePair> getLanguagesSpokenRight() { List<KeyValuePair> itemsOnRight = new ArrayList<KeyValuePair>(); MatchCriteria matchCriteria = getMatchCriteria(); String motherTongueCSV = matchCriteria.getMotherTongue(); if (Validator.isNotNull(motherTongueCSV)) { String[] parts = motherTongueCSV.split(StringPool.COMMA); for (int i = 0; i < parts.length; i++) { String key = parts[i]; MyLanguage myLanguage = null; try { myLanguage = MyLanguageLocalServiceUtil.fetchMyLanguage(Long.valueOf(key)); } catch (NumberFormatException e) { e.printStackTrace();/*from w w w. j a va 2s . c o m*/ } catch (SystemException e) { e.printStackTrace(); } if (Validator.isNull(myLanguage)) continue; String value = myLanguage.getLanguage(); itemsOnRight.add(new KeyValuePair(key, value)); } } return itemsOnRight; }
From source file:com.inikah.slayer.service.impl.InvitationLocalServiceImpl.java
License:Open Source License
private String getChain(long inviterId) { StringBuilder sb = new StringBuilder(String.valueOf(inviterId)); try {/*from w w w .j ava 2 s . co m*/ Invitation invitation = invitationPersistence.fetchByInviteeNewUserId(inviterId); if (Validator.isNotNull(invitation)) { sb.append(StringPool.COMMA); sb.append(getChain(invitation.getUserId())); } } catch (SystemException e) { e.printStackTrace(); } return sb.toString(); }
From source file:com.inikah.slayer.service.impl.LocationLocalServiceImpl.java
License:Open Source License
public String getDisplayInfo(long cityId) { StringBuilder sb = new StringBuilder(); try {//from www.j ava 2 s .c o m Location location = locationPersistence.fetchByPrimaryKey(cityId); sb.append(location.getName()).append(StringPool.COMMA).append(StringPool.SPACE); location = locationPersistence.fetchByPrimaryKey(location.getParentId()); sb.append(location.getName()).append(StringPool.COMMA).append(StringPool.SPACE); Country country = CountryServiceUtil.fetchCountry(location.getParentId()); sb.append(country.getName()); } catch (SystemException e) { e.printStackTrace(); } return sb.toString(); }
From source file:com.inikah.slayer.service.impl.PaymentLocalServiceImpl.java
License:Open Source License
public void reward(long userId, long planId, double amount) { Invitation invitation = null;//from w w w. ja va 2s . c om try { invitation = invitationPersistence.fetchByInviteeNewUserId(userId); } catch (SystemException e) { e.printStackTrace(); } if (Validator.isNull(invitation)) return; String invitationChain = invitation.getInvitationChain(); if (Validator.isNull(invitationChain)) return; String[] inviters = invitationChain.split(StringPool.COMMA); String[] commission = null; try { Plan plan = planLocalService.fetchPlan(planId); String referralBonus = plan.getReferralBonus(); if (Validator.isNotNull(referralBonus)) { commission = referralBonus.split(StringPool.COMMA); } } catch (SystemException e) { e.printStackTrace(); } int loopCount = Math.min(inviters.length, commission.length); for (int i = 0; i < loopCount; i++) { int percent = Integer.valueOf(commission[i]); double incentive = amount * (percent / 100); earningService.credit(Long.valueOf(inviters[i]), incentive, "some details"); } }
From source file:com.inikah.slayer.service.impl.ProfileLocalServiceImpl.java
License:Open Source License
@SuppressWarnings("unchecked") public List<Profile> getProfilesWithStatus(String status) { List<Profile> profiles = null; long companyId = CompanyThreadLocal.getCompanyId(); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Profile.class, PortletClassLoaderUtil.getClassLoader()); dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); dynamicQuery.addOrder(OrderFactoryUtil.desc("modifiedDate")); String[] parts = status.split(StringPool.COMMA); if (parts.length == 1) { int _status = Integer.valueOf(parts[0]); if (_status < 19) { dynamicQuery.add(RestrictionsFactoryUtil.eq("status", _status)); } else {/*w ww . jav a2 s . c o m*/ dynamicQuery.add(RestrictionsFactoryUtil.eq("status", IConstants.PROFILE_STATUS_ACTIVE)); dynamicQuery.addOrder(OrderFactoryUtil.desc("status")); if (status.equalsIgnoreCase(IConstants.BACOFIS_STATUS_IN_PROGRESS)) { //dynamicQuery.add(RestrictionsFactoryUtil.) } } } else { List<Integer> values = new ArrayList<Integer>(); for (String value : parts) { values.add(Integer.parseInt(value)); } dynamicQuery.add(RestrictionsFactoryUtil.in("status", values)); } try { profiles = dynamicQuery(dynamicQuery); } catch (SystemException e) { e.printStackTrace(); } return profiles; }
From source file:com.iucn.whp.dbservice.service.persistence.assessment_lang_versionPK.java
License:Open Source License
@Override public String toString() { StringBundler sb = new StringBundler(10); sb.append(StringPool.OPEN_CURLY_BRACE); sb.append("assessmentid"); sb.append(StringPool.EQUAL);//from ww w . j a va2 s . c o m sb.append(assessmentid); sb.append(StringPool.COMMA); sb.append(StringPool.SPACE); sb.append("languageid"); sb.append(StringPool.EQUAL); sb.append(languageid); sb.append(StringPool.CLOSE_CURLY_BRACE); return sb.toString(); }
From source file:com.iucn.whp.dbservice.service.persistence.benefits_summaryPK.java
License:Open Source License
@Override public String toString() { StringBundler sb = new StringBundler(10); sb.append(StringPool.OPEN_CURLY_BRACE); sb.append("benefits_summary_id"); sb.append(StringPool.EQUAL);//from ww w. j a v a 2 s . c o m sb.append(benefits_summary_id); sb.append(StringPool.COMMA); sb.append(StringPool.SPACE); sb.append("assessment_version_id"); sb.append(StringPool.EQUAL); sb.append(assessment_version_id); sb.append(StringPool.CLOSE_CURLY_BRACE); return sb.toString(); }
From source file:com.kisti.science.platform.app.service.persistence.CommonLibraryPK.java
License:Open Source License
@Override public String toString() { StringBundler sb = new StringBundler(10); sb.append(StringPool.OPEN_CURLY_BRACE); sb.append("libName"); sb.append(StringPool.EQUAL);/*from w ww. j a v a 2 s. com*/ sb.append(libName); sb.append(StringPool.COMMA); sb.append(StringPool.SPACE); sb.append("libPath"); sb.append(StringPool.EQUAL); sb.append(libPath); sb.append(StringPool.CLOSE_CURLY_BRACE); return sb.toString(); }