當前位置: 首頁>>代碼示例>>Java>>正文


Java GetterUtil類代碼示例

本文整理匯總了Java中com.liferay.portal.kernel.util.GetterUtil的典型用法代碼示例。如果您正苦於以下問題:Java GetterUtil類的具體用法?Java GetterUtil怎麽用?Java GetterUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GetterUtil類屬於com.liferay.portal.kernel.util包,在下文中一共展示了GetterUtil類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateDeliverableTypeMappingData

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public Response updateDeliverableTypeMappingData(HttpServletRequest request, HttpHeaders header, Company company,
		Locale locale, User user, ServiceContext serviceContext, long deliverableTypeId, String mappingData) {
	// TODO Update FormReport of Deliverable Type
	BackendAuth auth = new BackendAuthImpl();

	long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));

	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}

		DeliverableTypesActions action = new DeliverableTypesActionsImpl();

		DeliverableType deliverableType = action.updateDeliverableTypeMappingData(groupId, deliverableTypeId,
				mappingData, serviceContext);

		DeliverableTypeDetailModel result = DeliverableTypesUtils.mappingToDeliverableTypesModel(deliverableType);

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		return processException(e);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:DeliverableTypesManagementImpl.java

示例2: postProcessSearchQuery

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public void postProcessSearchQuery(BooleanQuery searchQuery, BooleanFilter fullQueryBooleanFilter,
        SearchContext searchContext) throws Exception {
            
    boolean advancedSearch = GetterUtil.getBoolean(searchContext.getAttribute("advancedSearch"), false);

    addSearchTerm(searchQuery, searchContext, "description", false);
    if (!advancedSearch) {
        addSearchTerm(searchQuery, searchContext, "workPackage", true);
    }
    
    // TODO: add ticketURL

    LinkedHashMap<String, Object> params = (LinkedHashMap<String, Object>) searchContext.getAttribute("params");

    if (params != null) {
        String expandoAttributes = (String) params.get("expandoAttributes");

        if (Validator.isNotNull(expandoAttributes)) {
            addSearchExpando(searchQuery, searchContext, expandoAttributes);
        }
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:24,代碼來源:TaskRecordIndexer.java

示例3: getTaskRecords

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public static List<TaskRecord> getTaskRecords(Hits hits) {

        List<Document> documents = ListUtil.toList(hits.getDocs());

        List<TaskRecord> taskRecords = new ArrayList<TaskRecord>();

        for (Document document : documents) {
            try {
                long taskRecordId = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));

                TaskRecord taskRecord = TaskRecordLocalServiceUtil.getTaskRecord(taskRecordId);
                taskRecords.add(taskRecord);

            } catch (Exception e) {

                if (_log.isErrorEnabled()) {
                    _log.error(e.getMessage());
                }
            }
        }

        return taskRecords;
    }
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:24,代碼來源:TimetrackerUtil.java

示例4: 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);
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:22,代碼來源:ContactDisplayTerms.java

示例5: 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);
    }
 
開發者ID:inofix,項目名稱:ch-inofix-data-manager,代碼行數:21,代碼來源:MeasurementDisplayTerms.java

示例6: buildSplittedQuery

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public BooleanQuery buildSplittedQuery(
	JSONObject configurationObject, QueryParams queryParams)
	throws Exception {

	BooleanQuery query = new BooleanQueryImpl();
	
	String keywordSplitter = configurationObject.getString("keywordSplitter");

	String [] keywords = queryParams.getKeywords().split(keywordSplitter);
		
	for (String keyword : keywords) {
		WildcardQuery q = buildClause(configurationObject, keyword);
		query.add(q, BooleanClauseOccur.SHOULD);
	}
	
	float boost = GetterUtil.getFloat(configurationObject.get("boost"), 1.0f);
	query.setBoost(boost);
	
	return query;
}
 
開發者ID:peerkar,項目名稱:liferay-gsearch,代碼行數:25,代碼來源:WildcardQueryBuilderImpl.java

示例7: getFormReportByRegistrationTemplateId

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public Response getFormReportByRegistrationTemplateId(HttpServletRequest request, HttpHeaders header,
		Company company, Locale locale, User user, ServiceContext serviceContext, long registrationTemplateId) {
	// TODO Get FormReport of RegistrationTemplates
	BackendAuth auth = new BackendAuthImpl();

	RegistrationTemplateFormReportInputUpdateModel result = new RegistrationTemplateFormReportInputUpdateModel();

	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}
		long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
		RegistrationTemplates registrationTemplate = RegistrationTemplatesLocalServiceUtil
				.getRegTempbyRegId(groupId, registrationTemplateId);

		result.setFormReport(registrationTemplate.getFormReport());

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		_log.error(e);
		return processException(e);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:RegistrationTemplatesManagementImpl.java

示例8: mappingToStepRole

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public static List<RoleDataModel> mappingToStepRole(List<ProcessStepRole> stepRoles) {
	List<RoleDataModel> outputs = new ArrayList<RoleDataModel>();

	for (ProcessStepRole role : stepRoles) {

		RoleDataModel model = new RoleDataModel();

		model.setRoleId(GetterUtil.getInteger(role.getRoleId()));
		model.setRoleName(_getRoleName(role.getRoleId()));
		model.setCondition(role.getCondition());
		model.setModerator(Boolean.toString(role.getModerator()));

		outputs.add(model);
	}

	return outputs;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:18,代碼來源:ServiceProcessUtils.java

示例9: mappingToDossierTemplateList

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public static List<DossierTemplateDataModel> mappingToDossierTemplateList(List<Document> documents) {
	List<DossierTemplateDataModel> outputs = new ArrayList<DossierTemplateDataModel>();

	for (Document doc : documents) {
		DossierTemplateDataModel model = new DossierTemplateDataModel();

		model.setDossierTemplateId(GetterUtil.getLong(doc.get(Field.ENTRY_CLASS_PK)));
		model.setCreateDate(doc.get(Field.CREATE_DATE));
		model.setModifiedDate(doc.get(Field.MODIFIED_DATE));
		model.setTemplateName(doc.get(DossierTemplateTerm.TEMPLATE_NAME));
		model.setTemplateNo(doc.get(DossierTemplateTerm.TEMPLATE_NO));
		model.setDescription(doc.get(DossierTemplateTerm.DESCRIPTION));

		outputs.add(model);
	}

	return outputs;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:19,代碼來源:DossierTemplateUtils.java

示例10: getSampleDataByRegistrationTemplateId

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public Response getSampleDataByRegistrationTemplateId(HttpServletRequest request, HttpHeaders header,
		Company company, Locale locale, User user, ServiceContext serviceContext, long registrationTemplateId) {
	// TODO Get SampleData of RegistrationTemplates
	BackendAuth auth = new BackendAuthImpl();

	RegistrationTemplateSampleDataInputUpdateModel result = new RegistrationTemplateSampleDataInputUpdateModel();

	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}
		long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
		RegistrationTemplates registrationTemplate = RegistrationTemplatesLocalServiceUtil
				.getRegTempbyRegId(groupId, registrationTemplateId);

		result.setSampleData(registrationTemplate.getSampleData());

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		_log.error(e);
		return processException(e);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:RegistrationTemplatesManagementImpl.java

示例11: mappingToRegistrationTemplateModel

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public static RegistrationTemplateDetailModel mappingToRegistrationTemplateModel(
		RegistrationTemplates registrationTemplates) {

	if (registrationTemplates == null) {
		return null;
	}
	long registrationTemplateId = GetterUtil.getLong(registrationTemplates.getRegistrationTemplateId());
	RegistrationTemplateDetailModel model = new RegistrationTemplateDetailModel();

	model.setRegistrationTemplateId(registrationTemplateId);
	model.setGovAgencyCode(registrationTemplates.getGovAgencyCode());
	model.setFormName(registrationTemplates.getFormName());
	model.setFormNo(registrationTemplates.getFormNo());
	model.setMultiple(registrationTemplates.getMultiple());

	return model;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:18,代碼來源:RegistrationTemplatesUtils.java

示例12: mappingToDeliverableTypesSearchByIdResultsModel

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
public static List<DossierLogSearchIdModel> mappingToDeliverableTypesSearchByIdResultsModel(
		List<Document> documents) {

	List<DossierLogSearchIdModel> outputs = new ArrayList<DossierLogSearchIdModel>();

	for (Document document : documents) {

		DossierLogSearchIdModel model = new DossierLogSearchIdModel();

		long dossierLogId = GetterUtil.getLong(document.get("entryClassPK"));
		// int notificationType =
		// GetterUtil.getInteger(document.get(DossierLogTerm.NOTIFICATION_TYPE));

		model.setDossierLogId(dossierLogId);
		model.setAuthor(document.get(DossierLogTerm.AUTHOR));
		model.setContent(document.get(DossierLogTerm.CONTENT));
		model.setCreateDate(document.get(DossierLogTerm.CREATE_DATE));
		model.setNotificationType(document.get(DossierLogTerm.NOTIFICATION_TYPE));
		model.setPayload(document.get(DossierLogTerm.PAYLOAD));

		outputs.add(model);
	}

	return outputs;

}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:RegistrationTemplatesUtils.java

示例13: getformdatabyRegidRefid

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public Response getformdatabyRegidRefid(HttpServletRequest request, HttpHeaders header, Company company,
		Locale locale, User user, ServiceContext serviceContext, long registrationId, String referenceUid)
		throws PortalException {
	BackendAuth auth = new BackendAuthImpl();
	try {
		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}
		long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
		RegistrationForm registrationForm = RegistrationFormLocalServiceUtil.findFormbyRegidRefid(groupId,
				registrationId, referenceUid);

		return Response.status(200).entity(registrationForm.getFormData()).build();

	} catch (Exception e) {
		return processException(e);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:20,代碼來源:RegistrationFormManagementImpl.java

示例14: getStatisticByAgency

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public Response getStatisticByAgency(HttpServletRequest request, HttpHeaders header, Company company, Locale locale,
		User user, ServiceContext serviceContext) {
	ServiceInfoActions actions = new ServiceInfoActionsImpl();
	
	long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
	
	JSONObject results = JSONFactoryUtil.createJSONObject();
	
	try {
		results = actions.getStatisticByAdministration(serviceContext, groupId);
		
		_log.info(results);
		
		return Response.status(200).entity(JSONFactoryUtil.looseSerialize(results)).build();

	} catch (Exception e) {
		ErrorMsg error = new ErrorMsg();

			error.setMessage("Forbidden.");
			error.setCode(HttpURLConnection.HTTP_FORBIDDEN);
			error.setDescription("Forbidden.");

			return Response.status(HttpURLConnection.HTTP_FORBIDDEN).entity(error).build();
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:27,代碼來源:ServiceInfoManagementImpl.java

示例15: getRegistrationTemplatebyId

import com.liferay.portal.kernel.util.GetterUtil; //導入依賴的package包/類
@Override
public Response getRegistrationTemplatebyId(HttpServletRequest request, HttpHeaders header, Company company,
		Locale locale, User user, ServiceContext serviceContext, String id) {
	// TODO Get RegistrationTemplates by Id
	BackendAuth auth = new BackendAuthImpl();
	long groupId = GetterUtil.getLong(header.getHeaderString("groupId"));
	try {

		if (!auth.isAuth(serviceContext)) {
			throw new UnauthenticationException();
		}

		RegistrationTemplates registrationTemplates = RegistrationTemplatesLocalServiceUtil
				.getRegistrationTemplatebyId(groupId, id);

		RegistrationTemplateDetailModel result = RegistrationTemplatesUtils
				.mappingToRegistrationTemplateModel(registrationTemplates);

		return Response.status(200).entity(result).build();

	} catch (Exception e) {
		_log.error(e);
		return processException(e);
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:26,代碼來源:RegistrationTemplatesManagementImpl.java


注:本文中的com.liferay.portal.kernel.util.GetterUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。