本文整理汇总了Java中org.kuali.rice.krad.datadictionary.BusinessObjectEntry类的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectEntry类的具体用法?Java BusinessObjectEntry怎么用?Java BusinessObjectEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BusinessObjectEntry类属于org.kuali.rice.krad.datadictionary包,在下文中一共展示了BusinessObjectEntry类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSearchResultsForEBO
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* Performs a search against an {@link org.kuali.rice.krad.bo.ExternalizableBusinessObject} by invoking the
* module service
*
* @param searchCriteria map of criteria currently set
* @param unbounded indicates whether the complete result should be returned. When set to false the result is
* limited (if necessary) to the max search result limit configured.
* @return list of result objects, possibly bounded
*/
protected List<?> getSearchResultsForEBO(Map<String, String> searchCriteria, boolean unbounded) {
ModuleService eboModuleService = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(
getDataObjectClass());
BusinessObjectEntry ddEntry = eboModuleService.getExternalizableBusinessObjectDictionaryEntry(
getDataObjectClass());
Map<String, String> filteredFieldValues = new HashMap<String, String>();
for (String fieldName : searchCriteria.keySet()) {
if (ddEntry.getAttributeNames().contains(fieldName)) {
filteredFieldValues.put(fieldName, searchCriteria.get(fieldName));
}
}
Map<String, Object> translatedValues = KRADUtils.coerceRequestParameterTypes(
(Class<? extends ExternalizableBusinessObject>) getDataObjectClass(), filteredFieldValues);
List<?> searchResults = eboModuleService.getExternalizableBusinessObjectsListForLookup(
(Class<? extends ExternalizableBusinessObject>) getDataObjectClass(), (Map) translatedValues,
unbounded);
return searchResults;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:33,
代码来源:LookupableImpl.java
示例2: getCollectionElementLabel
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DataDictionaryService#getCollectionElementLabel(java.lang.Class,
* java.lang.String)
*/
@Override
public String getCollectionElementLabel(String entryName, String collectionName, Class dataObjectClass) {
String elementLabel = "";
CollectionDefinition collectionDefinition = getCollectionDefinition(entryName, collectionName);
if (collectionDefinition != null) {
elementLabel = collectionDefinition.getElementLabel();
if (StringUtils.isEmpty(elementLabel)) {
BusinessObjectEntry boe = getDataDictionary().getBusinessObjectEntry(dataObjectClass.getName());
if (boe != null) {
elementLabel = boe.getObjectLabel();
}
}
}
return elementLabel;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:22,
代码来源:TestDataDictionaryService.java
示例3: setUp
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
postalCodeNumericPatternConstraint = new NumericPatternConstraint();
postalCodeNumericPatternConstraint.setMessageKey("validate.dummykey");
postalCodeNumericPatternConstraint.setValidationMessageParams( new ArrayList<String>());
postalCodeDefinition = new AttributeDefinition();
postalCodeDefinition.setName("postalCode");
postalCodeDefinition.setValidCharactersConstraint(postalCodeNumericPatternConstraint);
attributes.add(postalCodeDefinition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:24,
代码来源:NumericPatternConstraintTest.java
示例4: setUp
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
String regex = getProperty(PATTERN_CONSTRAINT);
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
postalCodePatternConstraint = new ConfigurationBasedRegexPatternConstraint();
postalCodePatternConstraint.setMessageKey("validate.dummykey");
postalCodePatternConstraint.setValidationMessageParams( new ArrayList<String>());
postalCodePatternConstraint.setValue(regex);
postalCodeDefinition = new AttributeDefinition();
postalCodeDefinition.setName("postalCode");
postalCodeDefinition.setValidCharactersConstraint(postalCodePatternConstraint);
attributes.add(postalCodeDefinition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:27,
代码来源:ZipcodePatternConstraintTest.java
示例5: getCollectionElementLabel
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DataDictionaryService#getCollectionElementLabel(java.lang.Class,
* java.lang.String)
*/
@Override
public String getCollectionElementLabel(String entryName, String collectionName, Class dataObjectClass) {
String elementLabel = "";
CollectionDefinition collectionDefinition = getCollectionDefinition(entryName, collectionName);
if (collectionDefinition != null) {
elementLabel = collectionDefinition.getElementLabel();
if (StringUtils.isEmpty(elementLabel)) {
BusinessObjectEntry boe = getDataDictionary().getBusinessObjectEntry(dataObjectClass.getName());
if (boe != null) {
elementLabel = boe.getObjectLabel();
}
}
}
return elementLabel;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:22,
代码来源:DataDictionaryServiceImpl.java
示例6: export
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* Handles exporting the BusinessObject for this Inquiry to XML if it has a custom XML exporter available.
*/
public ActionForward export(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
InquiryForm inquiryForm = (InquiryForm) form;
if (inquiryForm.isCanExport()) {
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
if (bo != null) {
BusinessObjectEntry businessObjectEntry = KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(inquiryForm.getBusinessObjectClassName());
Class<? extends Exporter> exporterClass = businessObjectEntry.getExporterClass();
if (exporterClass != null) {
Exporter exporter = exporterClass.newInstance();
response.setContentType(KRADConstants.XML_MIME_TYPE);
response.setHeader("Content-disposition", "attachment; filename=export.xml");
exporter.export(businessObjectEntry.getBusinessObjectClass(), Collections.singletonList(bo), KRADConstants.XML_FORMAT, response.getOutputStream());
}
} else {
//show the empty section with error
populateSections(mapping, request, inquiryForm, bo);
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
}
return null;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:27,
代码来源:KualiInquiryAction.java
示例7: getSearchResultsForEBO
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* Get the search results of an {@linkExternalizableBusinessObject}
*
* @param searchCriteria map of criteria currently set
* @param unbounded indicates whether the complete result should be returned. When set to false the result is
* limited (if necessary) to the max search result limit configured.
* @return list of result objects, possibly bounded
*/
protected List<?> getSearchResultsForEBO(Map<String, String> searchCriteria, boolean unbounded) {
ModuleService eboModuleService = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(
getDataObjectClass());
BusinessObjectEntry ddEntry = eboModuleService.getExternalizableBusinessObjectDictionaryEntry(
getDataObjectClass());
Map<String, String> filteredFieldValues = new HashMap<String, String>();
for (String fieldName : searchCriteria.keySet()) {
if (ddEntry.getAttributeNames().contains(fieldName)) {
filteredFieldValues.put(fieldName, searchCriteria.get(fieldName));
}
}
List<?> searchResults = eboModuleService.getExternalizableBusinessObjectsListForLookup(
(Class<? extends ExternalizableBusinessObject>) getDataObjectClass(), (Map) filteredFieldValues,
unbounded);
return searchResults;
}
开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:28,
代码来源:OleLookupableImpl.java
示例8: validate
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* determines if a reference number has been added to the Accounting Line
* <strong>Expects an accounting line as the first a parameter</strong>
* @see org.kuali.ole.sys.document.validation.Validation#validate(java.lang.Object[])
*/
public boolean validate(AttributedDocumentEvent event) {
NonCheckDisbursementDocument document = (NonCheckDisbursementDocument)event.getDocument();
boolean valid = true;
Class alclass = null;
BusinessObjectEntry boe;
if (accountingLineForValidation.isSourceAccountingLine()) {
alclass = document.getSourceAccountingLineClass();
}
else if (accountingLineForValidation.isTargetAccountingLine()) {
alclass = document.getTargetAccountingLineClass();
}
boe = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(alclass.getName());
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceNumber())) {
putRequiredPropertyError(boe, REFERENCE_NUMBER);
valid = false;
}
return valid;
}
开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:31,
代码来源:NonCheckDisbursementRequiredReferenceFieldValidation.java
示例9: checkForSystemParametersExistence
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
protected boolean checkForSystemParametersExistence() {
LOG.info("checkForSystemParametersExistence called");
boolean success = true;
Collection<String> feinParameterValues = new ArrayList<String>( SpringContext.getBean(ParameterService.class).getParameterValuesAsString(VendorDetail.class, VendorParameterConstants.FEIN_ALLOWED_OWNERSHIP_TYPES) );
Collection<String> ssnParameterValues = new ArrayList<String>( SpringContext.getBean(ParameterService.class).getParameterValuesAsString(VendorDetail.class, VendorParameterConstants.SSN_ALLOWED_OWNERSHIP_TYPES) );
OwnershipType newBo = (OwnershipType)getNewBo();
OwnershipType oldBo = (OwnershipType) getOldBo();
if ((feinParameterValues.contains(newBo.getVendorOwnershipCode()) || ssnParameterValues.contains(newBo.getVendorOwnershipCode())) && ! newBo.isActive() && oldBo.isActive()) {
success = false;
final BusinessObjectEntry ownershipTypeEntry = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(OwnershipType.class.getName());
final String documentLabel = ownershipTypeEntry == null ? DEFAULT_OWNERSHIP_TYPE_LABEL : ownershipTypeEntry.getObjectLabel();
putGlobalError(OLEKeyConstants.ERROR_CANNOT_INACTIVATE_USED_IN_SYSTEM_PARAMETERS, documentLabel);
}
return success;
}
开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:17,
代码来源:OwnershipTypeRule.java
示例10: prepareForSave
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* KFSMI-4606 Set GLPE descriptions to persons name. Take care that this needs to overwrite prepareForSave so that it
* catches pending entries generated by generateLaborLedgerPendingEntries and generateLaborLedgerBenefitClearingPendingEntries.
* @see org.kuali.kfs.module.ld.document.LaborLedgerPostingDocumentBase#prepareForSave(org.kuali.rice.kns.rule.event.KualiDocumentEvent)
*/
@Override
public void prepareForSave(KualiDocumentEvent event) {
super.prepareForSave(event);
for (Iterator<LaborLedgerPendingEntry> iterator = this.getLaborLedgerPendingEntries().iterator(); iterator.hasNext();) {
LaborLedgerPendingEntry laborLedgerPendingEntry = iterator.next();
String personName = SpringContext.getBean(FinancialSystemUserService.class).getPersonNameByEmployeeId(this.getEmplid());
// Get the maxlength of the description field we are setting
BusinessObjectEntry laborLedgerPendingEntryBusinessObjectEntry = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(LaborLedgerPendingEntry.class.getName());
AttributeDefinition laborLedgerPendingEntryAttribute = laborLedgerPendingEntryBusinessObjectEntry.getAttributeDefinition(KFSPropertyConstants.TRANSACTION_LEDGER_ENTRY_DESC);
int descriptionLength = laborLedgerPendingEntryAttribute.getMaxLength();
// Set the description field truncating name if necessary
laborLedgerPendingEntry.setTransactionLedgerEntryDescription(personName.length() > descriptionLength ? personName.substring(0, descriptionLength - 1) : personName);
}
// KFSCNTRB-846 Need to set doc number on Error Certification object because it's the primary key; otherwise OJB complains
if (errorCertification != null) {
errorCertification.setDocumentNumber(this.documentNumber);
}
}
开发者ID:kuali,
项目名称:kfs,
代码行数:29,
代码来源:SalaryExpenseTransferDocument.java
示例11: getDataMappingFieldDefinition
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Override
public DataMappingFieldDefinition getDataMappingFieldDefinition(FunctionalFieldDescription functionalFieldDescription) {
BusinessObjectEntry businessObjectEntry = dataDictionaryService.getDataDictionary().getBusinessObjectEntry(functionalFieldDescription.getComponentClass());
String propertyType = "";
try {
propertyType = PropertyUtils.getPropertyType(businessObjectEntry.getBusinessObjectClass().newInstance(), functionalFieldDescription.getPropertyName()).getSimpleName();
}
catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug("KfsBusinessObjectMetaDataServiceImpl unable to get type of property: " + functionalFieldDescription.getPropertyName(), e);
}
}
return new DataMappingFieldDefinition(functionalFieldDescription, (org.kuali.rice.kns.datadictionary.BusinessObjectEntry) businessObjectEntry,
businessObjectEntry.getAttributeDefinition(functionalFieldDescription.getPropertyName()),
businessObjectMetaDataDao.getFieldMetaData(businessObjectEntry.getBusinessObjectClass(), functionalFieldDescription.getPropertyName()),
propertyType,
getReferenceComponentLabel(businessObjectEntry.getBusinessObjectClass(), functionalFieldDescription.getPropertyName()));
}
开发者ID:kuali,
项目名称:kfs,
代码行数:19,
代码来源:KfsBusinessObjectMetaDataServiceImpl.java
示例12: findBusinessObjectComponents
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Override
public List<BusinessObjectComponent> findBusinessObjectComponents(String namespaceCode, String componentLabel) {
Map<Class, BusinessObjectComponent> matchingBusinessObjectComponents = new HashMap<Class, BusinessObjectComponent>();
Pattern componentLabelRegex = null;
if (StringUtils.isNotBlank(componentLabel)) {
String patternStr = componentLabel.replace("*", ".*").toUpperCase();
try {
componentLabelRegex = Pattern.compile(patternStr);
}
catch (PatternSyntaxException ex) {
LOG.error("KfsBusinessObjectMetaDataServiceImpl unable to parse componentLabel pattern, ignoring.", ex);
}
}
for (BusinessObjectEntry businessObjectEntry : dataDictionaryService.getDataDictionary().getBusinessObjectEntries().values()) {
if ((StringUtils.isBlank(namespaceCode) || namespaceCode.equals(KRADServiceLocatorWeb.getKualiModuleService().getNamespaceCode(businessObjectEntry.getBusinessObjectClass())))
&& ((componentLabelRegex == null) || (StringUtils.isNotBlank(businessObjectEntry.getObjectLabel()) && componentLabelRegex.matcher(businessObjectEntry.getObjectLabel().toUpperCase()).matches()))) {
matchingBusinessObjectComponents.put(businessObjectEntry.getBusinessObjectClass(), new BusinessObjectComponent(KRADServiceLocatorWeb.getKualiModuleService().getNamespaceCode(businessObjectEntry.getBusinessObjectClass()), (org.kuali.rice.kns.datadictionary.BusinessObjectEntry) businessObjectEntry));
}
}
return new ArrayList<BusinessObjectComponent>(matchingBusinessObjectComponents.values());
}
开发者ID:kuali,
项目名称:kfs,
代码行数:22,
代码来源:KfsBusinessObjectMetaDataServiceImpl.java
示例13: validate
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* determines if a reference number has been added to the Accounting Line
* <strong>Expects an accounting line as the first a parameter</strong>
* @see org.kuali.kfs.sys.document.validation.Validation#validate(java.lang.Object[])
*/
public boolean validate(AttributedDocumentEvent event) {
NonCheckDisbursementDocument document = (NonCheckDisbursementDocument)event.getDocument();
boolean valid = true;
Class alclass = null;
BusinessObjectEntry boe;
if (accountingLineForValidation.isSourceAccountingLine()) {
alclass = document.getSourceAccountingLineClass();
}
else if (accountingLineForValidation.isTargetAccountingLine()) {
alclass = document.getTargetAccountingLineClass();
}
boe = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(alclass.getName());
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceNumber())) {
putRequiredPropertyError(boe, REFERENCE_NUMBER);
valid = false;
}
return valid;
}
开发者ID:kuali,
项目名称:kfs,
代码行数:31,
代码来源:NonCheckDisbursementRequiredReferenceFieldValidation.java
示例14: checkForSystemParametersExistence
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
protected boolean checkForSystemParametersExistence() {
LOG.info("checkForSystemParametersExistence called");
boolean success = true;
Collection<String> feinParameterValues = new ArrayList<String>( SpringContext.getBean(ParameterService.class).getParameterValuesAsString(VendorDetail.class, VendorParameterConstants.FEIN_ALLOWED_OWNERSHIP_TYPES) );
Collection<String> ssnParameterValues = new ArrayList<String>( SpringContext.getBean(ParameterService.class).getParameterValuesAsString(VendorDetail.class, VendorParameterConstants.SSN_ALLOWED_OWNERSHIP_TYPES) );
OwnershipType newBo = (OwnershipType)getNewBo();
OwnershipType oldBo = (OwnershipType) getOldBo();
if ((feinParameterValues.contains(newBo.getVendorOwnershipCode()) || ssnParameterValues.contains(newBo.getVendorOwnershipCode())) && ! newBo.isActive() && oldBo.isActive()) {
success = false;
final BusinessObjectEntry ownershipTypeEntry = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(OwnershipType.class.getName());
final String documentLabel = ownershipTypeEntry == null ? DEFAULT_OWNERSHIP_TYPE_LABEL : ownershipTypeEntry.getObjectLabel();
putGlobalError(KFSKeyConstants.ERROR_CANNOT_INACTIVATE_USED_IN_SYSTEM_PARAMETERS, documentLabel);
}
return success;
}
开发者ID:kuali,
项目名称:kfs,
代码行数:17,
代码来源:OwnershipTypeRule.java
示例15: getCollectionElementLabel
点赞 3
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DataDictionaryService#getCollectionElementLabel(java.lang.Class,
* java.lang.String)
*/
public String getCollectionElementLabel(String entryName, String collectionName, Class dataObjectClass) {
String elementLabel = "";
CollectionDefinition collectionDefinition = getCollectionDefinition(entryName, collectionName);
if (collectionDefinition != null) {
elementLabel = collectionDefinition.getElementLabel();
if (StringUtils.isEmpty(elementLabel)) {
BusinessObjectEntry boe = getDataDictionary().getBusinessObjectEntry(dataObjectClass.getName());
if (boe != null) {
elementLabel = boe.getObjectLabel();
}
}
}
return elementLabel;
}
开发者ID:aapotts,
项目名称:kuali_rice,
代码行数:21,
代码来源:DataDictionaryServiceImpl.java
示例16: getExternalizableBusinessObjectDictionaryEntry
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.service.ModuleService#getExternalizableBusinessObjectDictionaryEntry(java.lang.Class)
*/
@Override
public BusinessObjectEntry getExternalizableBusinessObjectDictionaryEntry(Class businessObjectInterfaceClass) {
Class boClass = getExternalizableBusinessObjectImplementation(businessObjectInterfaceClass);
return boClass == null ? null : KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary()
.getBusinessObjectEntryForConcreteClass(boClass.getName());
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:11,
代码来源:RemoteModuleServiceBase.java
示例17: retrieveExternalizableBusinessObjectsList
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* This method assumes that the externalizableClazz is an interface
* and gets the concrete implementation for it
*
* {@inheritDoc}
*/
@Override
public List<? extends ExternalizableBusinessObject> retrieveExternalizableBusinessObjectsList(
BusinessObject businessObject, String externalizableRelationshipName, Class externalizableClazz) {
if (businessObject == null) {
return null;
}
//Get the business object entry for this business object from data dictionary
//using the class name (without the package) as key
String className = businessObject.getClass().getName();
String key = className.substring(className.lastIndexOf(".") + 1);
BusinessObjectEntry entry =
KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntries().get(
key);
RelationshipDefinition relationshipDefinition = entry.getRelationshipDefinition(externalizableRelationshipName);
List<PrimitiveAttributeDefinition> primitiveAttributeDefinitions =
relationshipDefinition.getPrimitiveAttributes();
Map<String, Object> fieldValuesInEBO = new HashMap<String, Object>();
Object sourcePropertyValue;
for (PrimitiveAttributeDefinition primitiveAttributeDefinition : primitiveAttributeDefinitions) {
sourcePropertyValue = KradDataServiceLocator.getDataObjectService().wrap(businessObject).getPropertyValueNullSafe(
primitiveAttributeDefinition.getSourceName());
if (sourcePropertyValue == null) {
return null;
}
fieldValuesInEBO.put(primitiveAttributeDefinition.getTargetName(), sourcePropertyValue);
}
return getExternalizableBusinessObjectsList(getExternalizableBusinessObjectImplementation(externalizableClazz),
fieldValuesInEBO);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:37,
代码来源:RemoteModuleServiceBase.java
示例18: setUp
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
String regex = getProperty(PATTERN_CONSTRAINT);
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
validPhoneEmployee.setContactPhone("056-012-1200");
invalidPhoneEmployeeEmpty.setContactPhone("");
invalidPhoneEmployee.setContactPhone("09712248474");
invalidPhoneEmployee1.setContactPhone("+19712248474");
invalidPhoneEmployee2.setContactPhone("+1-972-232-3333");
invalidPhoneEmployee3.setContactPhone("+1-(972)-23334444");
invalidPhoneEmployee4.setContactPhone("+1-(972)-1223444 xtn.222");
invalidPhoneEmployee5.setContactPhone("+1 056 012 1200");
invalidPhoneEmployee6.setContactPhone("056\\-012\\-1200");
contactPhoneNumberPatternConstraint = new ConfigurationBasedRegexPatternConstraint();
contactPhoneNumberPatternConstraint.setMessageKey("validate.dummykey");
contactPhoneNumberPatternConstraint.setValidationMessageParams( new ArrayList<String>());
contactPhoneNumberPatternConstraint.setValue(regex);
contactPhoneDefinition = new AttributeDefinition();
contactPhoneDefinition.setName("contactPhone");
contactPhoneDefinition.setValidCharactersConstraint(contactPhoneNumberPatternConstraint);
attributes.add(contactPhoneDefinition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:37,
代码来源:PhoneNumberPatternConstraintTest.java
示例19: setUp
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
countryCharsetPatternConstraint = new CharsetPatternConstraint();
countryCharsetPatternConstraint.setMessageKey("validate.dummykey");
countryCharsetPatternConstraint.setValidationMessageParams( new ArrayList<String>());
countryCharsetPatternConstraint.setValidChars("USA");
countryDefinition = new AttributeDefinition();
countryDefinition.setName("country");
countryDefinition.setValidCharactersConstraint(countryCharsetPatternConstraint);
attributes.add(countryDefinition);
postalCodeCharsetPatternConstraint = new CharsetPatternConstraint();
countryCharsetPatternConstraint.setMessageKey("validate.dummykey");
countryCharsetPatternConstraint.setValidationMessageParams( new ArrayList<String>());
postalCodeCharsetPatternConstraint.setValidChars("(ZH-123456)");
postalCodeDefinition = new AttributeDefinition();
postalCodeDefinition.setName("postalCode");
postalCodeDefinition.setValidCharactersConstraint(postalCodeCharsetPatternConstraint);
attributes.add(postalCodeDefinition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:36,
代码来源:CharsetPatternConstraintTest.java
示例20: setUp
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
street1AnyCharacterPatternConstraint = new AnyCharacterPatternConstraint();
street1AnyCharacterPatternConstraint.setMessageKey("validate.dummykey");
street1AnyCharacterPatternConstraint.setValidationMessageParams( new ArrayList<String>());
street1AnyCharacterPatternConstraint.setAllowWhitespace(true);
street1Definition = new AttributeDefinition();
street1Definition.setName("street1");
street1Definition.setValidCharactersConstraint(street1AnyCharacterPatternConstraint);
attributes.add(street1Definition);
street2AnyCharacterPatternConstraint = new AnyCharacterPatternConstraint();
street2AnyCharacterPatternConstraint.setMessageKey("validate.dummykey");
street2AnyCharacterPatternConstraint.setValidationMessageParams( new ArrayList<String>());
street2Definition = new AttributeDefinition();
street2Definition.setName("street2");
street2Definition.setValidCharactersConstraint(street2AnyCharacterPatternConstraint);
attributes.add(street2Definition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:35,
代码来源:AnyCharacterPatternConstraintTest.java
示例21: setUp
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
cityAlphaPatternConstraint = new AlphaPatternConstraint();
cityAlphaPatternConstraint.setMessageKey("validate.dummykey");
cityAlphaPatternConstraint.setValidationMessageParams( new ArrayList<String>());
cityDefinition = new AttributeDefinition();
cityDefinition.setName("city");
cityDefinition.setValidCharactersConstraint(cityAlphaPatternConstraint);
attributes.add(cityDefinition);
street1AlphaPatternConstraint = new AlphaPatternConstraint();
street1AlphaPatternConstraint.setMessageKey("validate.dummykey");
street1AlphaPatternConstraint.setValidationMessageParams( new ArrayList<String>());
street1AlphaPatternConstraint.setAllowWhitespace(true);
street1Definition = new AttributeDefinition();
street1Definition.setName("street1");
street1Definition.setValidCharactersConstraint(street1AlphaPatternConstraint);
attributes.add(street1Definition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:34,
代码来源:AlphaPatternConstraintTest.java
示例22: setUp
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
String regex = getProperty(PATTERN_CONSTRAINT);
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
addressEntry = new BusinessObjectEntry();
List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>();
totalBalanceFloatingPointPatternConstraint = new FloatingPointPatternConstraint();
totalBalanceFloatingPointPatternConstraint.setMessageKey("validate.dummykey");
totalBalanceFloatingPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
totalBalanceFloatingPointPatternConstraint.setValue(regex);
totalBalanceDefinition = new AttributeDefinition();
totalBalanceDefinition.setName("totalBalance");
totalBalanceDefinition.setValidCharactersConstraint(totalBalanceFloatingPointPatternConstraint);
attributes.add(totalBalanceDefinition);
debitBalanceFloatingPointPatternConstraint = new FloatingPointPatternConstraint();
debitBalanceFloatingPointPatternConstraint.setMessageKey("validate.dummykey");
debitBalanceFloatingPointPatternConstraint.setValidationMessageParams( new ArrayList<String>());
debitBalanceFloatingPointPatternConstraint.setValue("-?"+regex);
debitBalanceFloatingPointPatternConstraint.setAllowNegative(true);
debitBalanceDefinition = new AttributeDefinition();
debitBalanceDefinition.setName("debitBalance");
debitBalanceDefinition.setValidCharactersConstraint(debitBalanceFloatingPointPatternConstraint);
attributes.add(debitBalanceDefinition);
addressEntry.setAttributes(attributes);
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:39,
代码来源:FloatingPointPatternConstraintTest.java
示例23: process
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
private ConstraintValidationResult process(DictionaryValidationResult dictionaryValidationResult, Object object,
AttributeDefinition definition, String attributeName) {
BusinessObjectEntry entry = new BusinessObjectEntry();
entry.setAttributes(Collections.singletonList(definition));
AttributeValueReader attributeValueReader = new DictionaryObjectAttributeValueReader(object,
"org.kuali.rice.kns.datadictionary.validation.MockCompany", entry);
attributeValueReader.setAttributeName(attributeName);
Object value = attributeValueReader.getValue();
return processor.process(dictionaryValidationResult, value, definition.getSimpleConstraint(),
attributeValueReader).getFirstConstraintValidationResult();
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:15,
代码来源:LengthConstraintProcessorTest.java
示例24: process
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
private ConstraintValidationResult process(DictionaryValidationResult dictionaryValidationResult, Object object, CollectionDefinition definition, String attributeName) {
BusinessObjectEntry entry = new BusinessObjectEntry();
entry.setCollections(Collections.singletonList((CollectionDefinition)definition));
AttributeValueReader attributeValueReader = new DictionaryObjectAttributeValueReader(object, "org.kuali.rice.kns.datadictionary.validation.Company", entry);
attributeValueReader.setAttributeName(attributeName);
Collection<?> value = (Collection<?>)attributeValueReader.getValue();
return processor.process(dictionaryValidationResult, value, definition, attributeValueReader).getFirstConstraintValidationResult();
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:CollectionSizeConstraintProcessorTest.java
示例25: loadBusinessObjectEntry
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
protected BusinessObjectEntry loadBusinessObjectEntry() {
KualiForm kualiForm = KNSGlobalVariables.getKualiForm();
if (kualiForm instanceof LookupForm) {
LookupForm lookupForm = (LookupForm) kualiForm;
if (!StringUtils.isBlank(lookupForm.getBusinessObjectClassName())) {
return KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(lookupForm.getBusinessObjectClassName());
}
}
return null;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:11,
代码来源:ExportViewHelper.java
示例26: getBusinessObjectEntry
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* @param businessObjectClass - class of business object to return entry for
* @return BusinessObjectEntry for the given dataObjectClass, or null if
* there is none
*/
protected BusinessObjectEntry getBusinessObjectEntry(Class businessObjectClass) {
validateBusinessObjectClass(businessObjectClass);
BusinessObjectEntry entry = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(
businessObjectClass.getName());
return entry;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:13,
代码来源:DataObjectMetaDataServiceImpl.java
示例27: createFieldRowsForBusinessObject
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* Creates a list of search fields, one for each primary key of the maintained business object
* @param businessObjectClass the class of the maintained business object
* @return a List of KEW search fields
*/
protected List<Row> createFieldRowsForBusinessObject(Class<? extends BusinessObject> businessObjectClass) {
List<Row> searchFields = new ArrayList<Row>();
final List primaryKeyNamesAsObjects = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(businessObjectClass);
final BusinessObjectEntry boEntry = KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(businessObjectClass.getName());
final WorkflowAttributePropertyResolutionService propertyResolutionService = KNSServiceLocator
.getWorkflowAttributePropertyResolutionService();
for (Object primaryKeyNameAsObject : primaryKeyNamesAsObjects) {
String attributeName = (String)primaryKeyNameAsObject;
BusinessObject businessObject = null;
try {
businessObject = businessObjectClass.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
Field searchField = FieldUtils.getPropertyField(businessObjectClass, attributeName, false);
String dataType = propertyResolutionService.determineFieldDataType(businessObjectClass, attributeName);
searchField.setFieldDataType(dataType);
List<Field> fieldList = new ArrayList<Field>();
List displayedFieldNames = new ArrayList();
displayedFieldNames.add(attributeName);
LookupUtils.setFieldQuickfinder(businessObject, attributeName, searchField, displayedFieldNames);
fieldList.add(searchField);
searchFields.add(new Row(fieldList));
}
return searchFields;
}
开发者ID:kuali,
项目名称:kc-rice,
代码行数:38,
代码来源:DataDictionarySearchableAttribute.java
示例28: validate
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* determines if object code sub types are valid with the object type code.
* <strong>Expects an accounting line as the first a parameter</strong>
* @see org.kuali.ole.sys.document.validation.Validation#validate(java.lang.Object[])
*/
public boolean validate(AttributedDocumentEvent event) {
GeneralErrorCorrectionDocument document = (GeneralErrorCorrectionDocument)event.getDocument();
boolean valid = true;
Class alclass = null;
BusinessObjectEntry boe;
if (accountingLineForValidation.isSourceAccountingLine()) {
alclass = document.getSourceAccountingLineClass();
}
else if (accountingLineForValidation.isTargetAccountingLine()) {
alclass = document.getTargetAccountingLineClass();
}
boe = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(alclass.getName());
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceOriginCode())) {
putRequiredPropertyError(boe, REFERENCE_ORIGIN_CODE);
valid = false;
}
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceNumber())) {
putRequiredPropertyError(boe, REFERENCE_NUMBER);
valid = false;
}
return valid;
}
开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:36,
代码来源:GeneralErrorCorrectionRequiredReferenceFieldValidation.java
示例29: validate
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
public boolean validate(AttributedDocumentEvent event) {
boolean valid = true;
if (this.getAccountingLineForValidation().isTargetAccountingLine()) {
final BusinessObjectEntry boe = getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(getAccountingLineForValidation().getClass().getName());
if (StringUtils.isEmpty(getAccountingLineForValidation().getReferenceNumber())) {
putRequiredPropertyError(boe, OLEPropertyConstants.REFERENCE_NUMBER);
valid = false;
}
}
return valid;
}
开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:13,
代码来源:PreEncumbranceRequiredReferenceFieldValidation.java
示例30: validate
点赞 2
import org.kuali.rice.krad.datadictionary.BusinessObjectEntry; //导入依赖的package包/类
/**
* determines if object code sub types are valid with the object type code.
* <strong>Expects an accounting line as the first a parameter</strong>
* @see org.kuali.kfs.sys.document.validation.Validation#validate(java.lang.Object[])
*/
public boolean validate(AttributedDocumentEvent event) {
GeneralErrorCorrectionDocument document = (GeneralErrorCorrectionDocument)event.getDocument();
boolean valid = true;
Class alclass = null;
BusinessObjectEntry boe;
if (accountingLineForValidation.isSourceAccountingLine()) {
alclass = document.getSourceAccountingLineClass();
}
else if (accountingLineForValidation.isTargetAccountingLine()) {
alclass = document.getTargetAccountingLineClass();
}
boe = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(alclass.getName());
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceOriginCode())) {
putRequiredPropertyError(boe, REFERENCE_ORIGIN_CODE);
valid = false;
}
if (StringUtils.isEmpty(accountingLineForValidation.getReferenceNumber())) {
putRequiredPropertyError(boe, REFERENCE_NUMBER);
valid = false;
}
return valid;
}
开发者ID:kuali,
项目名称:kfs,
代码行数:36,
代码来源:GeneralErrorCorrectionRequiredReferenceFieldValidation.java