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


Java Validator類代碼示例

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


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

示例1: doProcessAction

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    _log.info("doProcessAction()");
    
    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    _log.info("cmd = " + cmd);

    if (cmd.equals(Constants.DELETE)) {
        deleteBackgroundTasks(actionRequest, actionResponse);
    } else if (cmd.equals(Constants.EXPORT)) {
        exportTaskRecords(actionRequest, actionResponse);
    }

    String redirect = ParamUtil.getString(actionRequest, "redirect");

    if (Validator.isNotNull(redirect)) {
        sendRedirect(actionRequest, actionResponse, redirect);
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:22,代碼來源:ExportTaskRecordsMVCActionCommand.java

示例2: getStatusMessageKey

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
protected String getStatusMessageKey() {
    if (Validator.isNotNull(_messageKey)) {
        return _messageKey;
    }

    _messageKey = StringPool.BLANK;

    if (hasRemoteMessage()) {
        _messageKey = "please-wait-as-the-publication-processes-on-the-remote-site";
    } else if (hasStagedModelMessage()) {
        _messageKey = "exporting";

        if (Objects.equals(_cmd, Constants.IMPORT)) {
            _messageKey = "importing";
        } else if (Objects.equals(_cmd, Constants.PUBLISH_TO_LIVE)
                || Objects.equals(_cmd, Constants.PUBLISH_TO_REMOTE)) {

            _messageKey = "publishing";
        }
    }

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

示例3: postProcessSearchQuery

import com.liferay.portal.kernel.util.Validator; //導入依賴的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

示例4: updateProcessStep

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Override
public ProcessStep updateProcessStep(long groupId, String oldStepCode, String newStepCode, String stepName,
		long serviceProcessId, String sequenceNo, String dossierStatus, String dossierSubStatus, int durationCount,
		String customProcessUrl, String stepInstruction, String briefNote, boolean editable, ServiceContext context)
		throws PortalException {
	
	ProcessStep step = ProcessStepLocalServiceUtil.fetchBySC_GID(oldStepCode, groupId, serviceProcessId);
	
	long processStepId = 0;
	
	if (Validator.isNotNull(step)) {
		processStepId = step.getProcessStepId();
	}
	
	return ProcessStepLocalServiceUtil.updateProcessStep(groupId, processStepId, newStepCode, stepName,
			serviceProcessId, sequenceNo, dossierStatus, dossierSubStatus, durationCount, customProcessUrl,
			stepInstruction, briefNote, editable, context);
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:19,代碼來源:ServiceProcessActionsImpl.java

示例5: getLink

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public String getLink()
	throws Exception {

	String link = null;

	link = getAssetRenderer().getURLViewInContext(
		(LiferayPortletRequest) _portletRequest,
		(LiferayPortletResponse) _portletResponse, null);

	if (Validator.isNull(link)) {
		link = getNotLayoutBoundJournalArticleUrl();
	}

	return link;
}
 
開發者ID:peerkar,項目名稱:liferay-gsearch,代碼行數:20,代碼來源:JournalArticleItemBuilder.java

示例6: validateAdd

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
/**
 * @param appicantName
 * @param applicantIdType
 * @param applicantIdNo
 * @param applicantIdDate
 * @throws PortalException
 */
private void validateAdd(String applicantName, String applicantIdType, String applicantIdNo, String applicantIdDate)
		throws PortalException {
	if (Validator.isNull(applicantName)) {
		throw new NoApplicantNameException("NoApplicantNameException");
	}

	if (Validator.isNull(applicantIdType))
		throw new NoApplicantIdTypeException("NoApplicantIdTypeException");

	if (Validator.isNull(applicantIdNo))
		throw new NoApplicantIdNoException("NoApplicantIdNoException");

	if (Validator.isNull(applicantIdDate))
		throw new NoApplicantIdDateException("NoApplicantIdDateException");
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:23,代碼來源:ApplicantLocalServiceImpl.java

示例7: validateUpdate

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Deprecated
private void validateUpdate(long groupId, long serviceProcessId, String processNo, String processName,
		boolean generateDossierNo, String dossierNoPattern, boolean generateDueDate, String dueDatePattern,
		ServiceContext context) throws PortalException {

	ServiceProcess spUpdate = serviceProcessPersistence.fetchByPrimaryKey(serviceProcessId);

	if (!spUpdate.getProcessNo().equals(processNo) || !spUpdate.getProcessName().equals(processName)) {
		validateAdd(groupId, serviceProcessId, processNo, processName, generateDossierNo, dossierNoPattern,
				generateDueDate, dueDatePattern, context);
	}

	if (generateDossierNo && Validator.isNull(dossierNoPattern)) {
		throw new RequiredDossierNoPatternException("RequiredDossierNoPatternException");
	}

	if (generateDueDate && Validator.isNull(dueDatePattern)) {
		throw new RequiredDueDatePatternException("RequiredDueDatePatternException");
	}

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

示例8: doGetDocument

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Override
protected Document doGetDocument(DictGroup dictGroup) throws Exception {
	Document document = getBaseModelDocument(CLASS_NAME, dictGroup);

	document.addKeywordSortable(Field.COMPANY_ID, String.valueOf(dictGroup.getCompanyId()));
	document.addDateSortable(Field.MODIFIED_DATE, dictGroup.getModifiedDate());
	document.addKeywordSortable(Field.USER_ID, String.valueOf(dictGroup.getUserId()));
	document.addKeywordSortable(Field.USER_NAME, String.valueOf(dictGroup.getUserName()));

	document.addNumberSortable(DictGroupTerm.GROUP_ID, dictGroup.getGroupId());
	document.addNumberSortable(DictGroupTerm.DICT_GROUPID, dictGroup.getDictGroupId());
	document.addNumberSortable(DictGroupTerm.DICT_COLLECTIONID, dictGroup.getDictCollectionId());
	document.addTextSortable(DictGroupTerm.GROUP_CODE, dictGroup.getGroupCode());
	document.addTextSortable(DictGroupTerm.GROUP_NAME, dictGroup.getGroupName());
	document.addTextSortable(DictGroupTerm.GROUP_NAME_EN, dictGroup.getGroupNameEN());
	document.addTextSortable(DictGroupTerm.GROUP_DESCRIPTION, dictGroup.getGroupDescription());
	
	DictCollection dictCollection = DictCollectionLocalServiceUtil.fetchDictCollection(dictGroup.getDictCollectionId());
	
	String dictCollectionCode = Validator.isNotNull(dictCollection)?dictCollection.getCollectionCode():StringPool.BLANK;
	
	document.addTextSortable(DictGroupTerm.DICT_COLLECTION_CODE, dictCollectionCode);
	
	return document;
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:26,代碼來源:DictGroupIndexer.java

示例9: validateUpdate

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Deprecated
private void validateUpdate(long groupId, long processStepId, String stepCode, long serviceProcessId,
		String sequenceNo, String dossierStatus, String dossierSubStatus, String customProcessUrl)
		throws PortalException {

	ProcessStep processStep = processStepPersistence.findByPrimaryKey(processStepId);

	if (!processStep.getStepCode().toLowerCase().contentEquals(stepCode.toLowerCase())) {
		validateAdd(groupId, processStepId, stepCode, serviceProcessId, sequenceNo, dossierStatus, dossierSubStatus,
				customProcessUrl);
	}

	if (Validator.isNotNull(customProcessUrl) && !Validator.isUrl(customProcessUrl)) {
		throw new DossierURLException("InvalidCustomProcessURL");
	}
}
 
開發者ID:VietOpenCPS,項目名稱:opencps-v2,代碼行數:17,代碼來源:ProcessStepLocalServiceImpl.java

示例10: mapperUserProfileModel

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
public static UserProfileModel mapperUserProfileModel(Document document) {

		UserProfileModel ett = new UserProfileModel();

		try {

			ett.setClassName(document.get("className"));
			ett.setClassPK(document.get("classPK"));
			ett.setScreenName(document.get("screenName"));
			ett.setEmail(document.get("email"));
			ett.setFullName(document.get("fullName"));
			ett.setContactEmail(document.get("contactEmail"));
			ett.setContactTelNo(document.get("contactTelNo"));
			ett.setGender(document.get("gender"));
			ett.setBirthdate(Validator.isNotNull(document.getDate("birthdate")) ? APIDateTimeUtils
					.convertDateToString(document.getDate("birthdate"), APIDateTimeUtils._TIMESTAMP)
					: StringPool.BLANK);

		} catch (Exception e) {
			_log.error(e);
		}

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

示例11: getDictItemName

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
protected String getDictItemName(long groupId, String collectionCode, String itemCode) {

		DictCollection dc = DictCollectionLocalServiceUtil.fetchByF_dictCollectionCode(collectionCode, groupId);

		String itemName = StringPool.BLANK;

		if (Validator.isNotNull(dc)) {
			DictItem it = DictItemLocalServiceUtil.fetchByF_dictItemCode(itemCode, dc.getPrimaryKey(), groupId);
			if (Validator.isNotNull(it)) {
				itemName = it.getItemName();
			} else {
				itemName = StringPool.BLANK;
			}
		}

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

示例12: clone

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
@Override
public void clone(String className, String classPK, long userId, long companyId, long groupId, String sourcePK,
		ServiceContext serviceContext)
		throws NotFoundException, UnauthenticationException, UnauthorizationException, NoSuchUserException {
	List<ResourceUser> resourceUsers = new ArrayList<>(
			ResourceUserLocalServiceUtil.findByF_className_classPK(groupId, className, classPK));

	if (Validator.isNotNull(resourceUsers) && resourceUsers.size() > 0) {
		// Nothing to do here
	} else {

		List<ResourceUser> resourceUsersSourcePK = new ArrayList<>(
				ResourceUserLocalServiceUtil.findByF_className_classPK(groupId, className, sourcePK));

		for (ResourceUser resourceUser : resourceUsersSourcePK) {

			ResourceUserLocalServiceUtil.addResourceUser(userId, groupId, className, classPK,
					resourceUser.getToUserId(), resourceUser.getFullname(), resourceUser.getEmail(),
					resourceUser.getReadonly(), serviceContext);
		}

	}

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

示例13: pullFormData

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
private void pullFormData(long desGroupId, String fileRef, String dossierTemplateNo, long dossierId,
		String formData, DossierPart part, ServiceContext serviceContext) {
	try {
		DossierFile dossierFile = DossierFileLocalServiceUtil.getDossierFileByReferenceUid(dossierId, fileRef);

		if (Validator.isNull(dossierFile)) {
			// create dossierFile
			dossierFile = DossierFileLocalServiceUtil.addDossierFile(desGroupId, dossierId,
					PortalUUIDUtil.generate(), dossierTemplateNo, part.getPartNo(), part.getFileTemplateNo(),
					part.getPartName(), StringPool.BLANK, 0, null, StringPool.BLANK, StringPool.FALSE,
					serviceContext);
		}

		dossierFile.setFormData(formData);

		DossierFileLocalServiceUtil.updateDossierFile(dossierFile);

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

示例14: mapperDictCollectionModel

import com.liferay.portal.kernel.util.Validator; //導入依賴的package包/類
public static DictCollectionModel mapperDictCollectionModel(DictCollection dictCollection) {

		DictCollectionModel ett = new DictCollectionModel();

		try {

			ett.setDictCollectionId(dictCollection.getDictCollectionId());
			ett.setCollectionCode(dictCollection.getCollectionCode());
			ett.setCollectionName(dictCollection.getCollectionName());
			ett.setCollectionNameEN(dictCollection.getCollectionNameEN());
			ett.setDescription(dictCollection.getDescription());
			ett.setCreateDate(Validator.isNotNull(dictCollection.getCreateDate())
					? APIDateTimeUtils.convertDateToString(dictCollection.getCreateDate(), APIDateTimeUtils._TIMESTAMP)
					: StringPool.BLANK);
			ett.setModifiedDate(
					Validator.isNotNull(dictCollection.getModifiedDate()) ? APIDateTimeUtils.convertDateToString(
							dictCollection.getModifiedDate(), APIDateTimeUtils._TIMESTAMP) : StringPool.BLANK);

		} catch (Exception e) {
			_log.error(e);
		}

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

示例15: getSibling

import com.liferay.portal.kernel.util.Validator; //導入依賴的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;

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


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