本文整理汇总了Java中com.liferay.portal.kernel.util.GetterUtil.getInteger方法的典型用法代码示例。如果您正苦于以下问题:Java GetterUtil.getInteger方法的具体用法?Java GetterUtil.getInteger怎么用?Java GetterUtil.getInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.liferay.portal.kernel.util.GetterUtil
的用法示例。
在下文中一共展示了GetterUtil.getInteger方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TaskRecordDisplayTerms
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public TaskRecordDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
description = ParamUtil.getString(portletRequest, DESCRIPTION);
duration = ParamUtil.getLong(portletRequest, DURATION);
fromDate = ParamUtil.getString(portletRequest, FROM_DATE);
groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
ownerUserId = ParamUtil.getLong(portletRequest, OWNER_USER_ID);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
ticketURL = ParamUtil.getString(portletRequest, TICKET_URL);
taskRecordId = ParamUtil.getLong(portletRequest, TASKRECORDID);
untilDate = ParamUtil.getString(portletRequest, UNTIL_DATE);
userName = ParamUtil.getString(portletRequest, USER_NAME);
workPackage = ParamUtil.getString(portletRequest, WORK_PACKAGE);
}
示例2: ContactDisplayTerms
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public ContactDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
company = ParamUtil.getString(portletRequest, COMPANY);
contactId = ParamUtil.getString(portletRequest, CONTACT_ID);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
email = ParamUtil.getString(portletRequest, EMAIL);
fax = ParamUtil.getString(portletRequest, FAX);
fullName = ParamUtil.getString(portletRequest, FULL_NAME);
// TODO: add default IMPP
name = ParamUtil.getString(portletRequest, NAME);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
phone = ParamUtil.getString(portletRequest, PHONE);
userName = ParamUtil.getString(portletRequest, USER_NAME);
}
示例3: getSibling
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
protected String getSibling(long groupId, long dictCollectionId, long parentItemId, String sibling, int level) {
if (parentItemId == 0) {
} else {
DictItem parentItem = dictItemPersistence.fetchByPrimaryKey(parentItemId);
level = Validator.isNotNull(parentItem) ? (parentItem.getLevel() + 1) : 0;
}
DictItem dictItem = dictItemPersistence.fetchByF_parentItemId_level_Last(groupId, dictCollectionId,
parentItemId, level, null);
if ((Validator.isNotNull(dictItem) && sibling.equals("0")) || sibling.equals("0")) {
try {
sibling = GetterUtil.getInteger(dictItem.getSibling(), 1) + 1 + StringPool.BLANK;
} catch (Exception e) {
sibling = String.valueOf(1);
}
}
return sibling;
}
示例4: MeasurementDisplayTerms
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public MeasurementDisplayTerms(PortletRequest portletRequest) {
super(portletRequest);
createDate = ParamUtil.getString(portletRequest, CREATE_DATE);
data = ParamUtil.getString(portletRequest, DATA);
from = ParamUtil.getLong(portletRequest, FROM);
groupId = ParamUtil.getLong(portletRequest, GROUP_ID);
id = ParamUtil.getString(portletRequest, ID);
measurementId = ParamUtil.getLong(portletRequest, MEASUREMENT_ID);
modifiedDate = ParamUtil.getString(portletRequest, MODIFIED_DATE);
name = ParamUtil.getString(portletRequest, NAME);
String statusString = ParamUtil.getString(portletRequest, STATUS);
if (Validator.isNotNull(statusString)) {
status = GetterUtil.getInteger(statusString);
}
until = ParamUtil.getLong(portletRequest, UNTIL);
userName = ParamUtil.getString(portletRequest, USER_NAME);
}
示例5: mappingToDossierLogResultsModel
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
public static List<DossierLogModel> mappingToDossierLogResultsModel(List<Document> documents) {
List<DossierLogModel> outputs = new ArrayList<DossierLogModel>();
for (Document document : documents) {
DossierLogModel model = new DossierLogModel();
long dossierLogId = GetterUtil.getLong(document.get("entryClassPK"));
long dossierId = GetterUtil.getLong(document.get(DossierLogTerm.DOSSIER_ID));
// String notificationType =
// GetterUtil.getInteger(document.get(DossierLogTerm.NOTIFICATION_TYPE));
int counter = GetterUtil.getInteger(document.get(DossierLogTerm.COUNTER));
model.setDossierLogId(dossierLogId);
String strDate = document.get(DossierLogTerm.CREATE_DATE);
Date date = null;
if (Validator.isNotNull(strDate)) {
date = APIDateTimeUtils.convertStringToDate(strDate, "yyyyMMddHHmmss");
}
model.setCreateDate(date != null ? APIDateTimeUtils.convertDateToString(date, APIDateTimeUtils._TIMESTAMP): strDate);
model.setAuthor(document.get(DossierLogTerm.AUTHOR));
model.setContent(document.get(DossierLogTerm.CONTENT));
model.setNotificationType(document.get(DossierLogTerm.NOTIFICATION_TYPE));
model.setPayload(document.get(DossierLogTerm.PAYLOAD));
model.setDossierId(dossierId);
model.setServiceCode(document.get(DossierLogTerm.SERVICE_CODE));
model.setServiceName(document.get(DossierLogTerm.SERVICE_NAME));
model.setGovAgencyCode(document.get(DossierLogTerm.GOVAGENCYCODE));
model.setGovAgencyName(document.get(DossierLogTerm.GOVAGENCYNAME));
model.setCounter(counter);
outputs.add(model);
}
return outputs;
}
示例6: resetDossier
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
private void resetDossier(long groupId, String refId, boolean isServer, ServiceContext serviceContext) {
InvokeREST rest = new InvokeREST();
HashMap<String, String> properties = new HashMap<String, String>();
properties.put("Content-Type", "application/x-www-form-urlencoded");
String path = "dossiers/" + refId + "/reset";
JSONObject resReset = rest.callAPI(groupId, HttpMethods.GET, "application/json",
isServer ? RESTFulConfiguration.SERVER_PATH_BASE : RESTFulConfiguration.CLIENT_PATH_BASE, path,
isServer ? RESTFulConfiguration.SERVER_USER : RESTFulConfiguration.CLIENT_USER,
isServer ? RESTFulConfiguration.SERVER_PASS : RESTFulConfiguration.CLIENT_PASS, properties,
serviceContext);
if (GetterUtil.getInteger(resReset.get(RESTFulConfiguration.STATUS)) != HttpURLConnection.HTTP_OK) {
_log.info("Can't reset DOSSIER has groupId=" + groupId + " and ref=" + refId
+ (isServer ? "in SERVER" : " in CLIENT"));
}
}
示例7: _getAmount
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
/**
* @param pattern
* @param content
* @return
*/
private static int _getAmount(String pattern, String content) {
int amount = 0;
String[] splitPattern = StringUtil.split(pattern, StringPool.SPACE);
for (String element : splitPattern) {
if (element.contains(content)) {
String[] splipElement = StringUtil.split(element, StringPool.EQUAL);
if (splipElement.length == 2) {
int tempAmount = GetterUtil.getInteger(splipElement[1], 0);
if (tempAmount < 0) {
tempAmount = 0;
}
amount = tempAmount;
}
break;
}
}
return amount;
}
示例8: getPhraseSuggester
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
/**
* Get phrase suggester.
*
* @param configuration
* @param locale
* @param keywords
* @return
* @throws Exception
*/
protected Suggester getPhraseSuggester(
JSONObject configuration, Locale locale, String keywords) throws Exception {
StringBundler sb = new StringBundler();
sb.append(configuration.getString("fieldPrefix"));
if (configuration.getBoolean(("isLocalized"))) {
sb.append(locale.toString());
}
sb.append(configuration.getString("fieldSuffix"));
PhraseSuggester suggester = new PhraseSuggester(
configuration.getString("suggesterName"), sb.toString(), keywords);
int size = GetterUtil.getInteger(configuration.get("numberOfSuggestions"), 5);
suggester.setSize(size);
float confidence = GetterUtil.getFloat(configuration.get("confidence"), 0.1f);
suggester.setConfidence(confidence);
int gramSize = GetterUtil.getInteger(configuration.get("gramSize"), 2);
suggester.setGramSize(gramSize);
float maxErrors = GetterUtil.getFloat(configuration.get("maxErrors"), 2.0f);
suggester.setMaxErrors(maxErrors);
float realWordErrorLikelihood = GetterUtil.getFloat(configuration.get("realWordErrorLikelihood"), 0.95f);
suggester.setRealWordErrorLikelihood(realWordErrorLikelihood);
return suggester;
}
示例9: getPaymentFiles
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
private void getPaymentFiles(long srcGroupId, long srcDossierId, List<JSONObject> lsPaymentsFileSync) {
try {
InvokeREST rest = new InvokeREST();
HashMap<String, String> properties = new HashMap<String, String>();
properties.put("Content-Type", "application/x-www-form-urlencoded");
String path = "dossiers/" + srcDossierId + "/payments";
ServiceContext serviceContext = new ServiceContext();
JSONObject resDossierFile = rest.callAPI(srcGroupId, HttpMethods.GET, "application/json",
RESTFulConfiguration.SERVER_PATH_BASE, path, RESTFulConfiguration.SERVER_USER,
RESTFulConfiguration.SERVER_PASS, properties, serviceContext);
if (GetterUtil.getInteger(resDossierFile.get(RESTFulConfiguration.STATUS)) != HttpURLConnection.HTTP_OK) {
throw new RuntimeException(
"Failed : HTTP error code : " + resDossierFile.get(RESTFulConfiguration.STATUS));
} else {
JSONObject jsData = JSONFactoryUtil
.createJSONObject(resDossierFile.getString(RESTFulConfiguration.MESSAGE));
JSONArray array = JSONFactoryUtil.createJSONArray(jsData.getString("data"));
for (int i = 0; i < array.length(); i++) {
JSONObject object = array.getJSONObject(i);
if (GetterUtil.getInteger(object.get("isNew")) == 1) {
lsPaymentsFileSync.add(object);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例10: getDossierFiles
import com.liferay.portal.kernel.util.GetterUtil; //导入方法依赖的package包/类
private void getDossierFiles(long groupId, long dossierId, List<JSONObject> lsFileSync) {
try {
InvokeREST rest = new InvokeREST();
HashMap<String, String> properties = new HashMap<String, String>();
properties.put("Content-Type", "application/x-www-form-urlencoded");
String path = "dossiers/" + dossierId + "/files";
ServiceContext serviceContext = new ServiceContext();
JSONObject resDossierFile = rest.callAPI(groupId, HttpMethods.GET, "application/json",
RESTFulConfiguration.SERVER_PATH_BASE, path, RESTFulConfiguration.SERVER_USER,
RESTFulConfiguration.SERVER_PASS, properties, serviceContext);
if (GetterUtil.getInteger(resDossierFile.get(RESTFulConfiguration.STATUS)) != HttpURLConnection.HTTP_OK) {
throw new RuntimeException(
"Failed : HTTP error code : " + resDossierFile.get(RESTFulConfiguration.STATUS));
} else {
JSONObject jsData = JSONFactoryUtil
.createJSONObject(resDossierFile.getString(RESTFulConfiguration.MESSAGE));
JSONArray array = JSONFactoryUtil.createJSONArray(jsData.getString("data"));
for (int i = 0; i < array.length(); i++) {
JSONObject object = array.getJSONObject(i);
if (GetterUtil.getBoolean(object.get("isNew"))) {
lsFileSync.add(object);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}