当前位置: 首页>>代码示例>>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;未经允许,请勿转载。