本文整理汇总了Java中org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo类的典型用法代码示例。如果您正苦于以下问题:Java ParameterTypeBo类的具体用法?Java ParameterTypeBo怎么用?Java ParameterTypeBo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterTypeBo类属于org.kuali.rice.coreservice.impl.parameter包,在下文中一共展示了ParameterTypeBo类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyValues
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Override
public List<KeyValue> getKeyValues() {
// get a list of all ParameterTypes
KeyValuesService boService = KNSServiceLocator.getKeyValuesService();
List<ParameterTypeBo> bos = (List<ParameterTypeBo>) boService.findAll(ParameterTypeBo.class);
// copy the list of codes before sorting, since we can't modify the results from this method
if (bos == null) {
return Collections.emptyList();
}
final List<ParameterTypeBo> toReturn = new ArrayList<ParameterTypeBo>(bos);
// sort using comparator.
Collections.sort(bos, ParameterTypeComparator.INSTANCE);
// create a new list (code, descriptive-name)
List<KeyValue> labels = new ArrayList<KeyValue>(bos.size());
for (ParameterTypeBo bo : bos) {
labels.add(new ConcreteKeyValue(bo.getCode(), bo.getName()));
}
return labels;
}
示例2: testPKObjectForEntity
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
/**
* Tests that MetadataManager.getEntityPrimaryKeyObject correctly pulls primary keys
* from a BO
*/
@Test
public void testPKObjectForEntity() {
ParameterTypeBo parameterType = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(ParameterTypeBo.class, "CONFG");
assertNotNull("ParameterType should not be null", parameterType);
Object pkValue = MetadataManager.getEntityPrimaryKeyObject(parameterType);
assertEquals("Single pkValue should be of class String", String.class, pkValue.getClass());
assertEquals("Single pkValue should be \"CONFG\"", "CONFG", pkValue);
Parameter parameter = CoreFrameworkServiceLocator.getParameterService().getParameter("KR-NS", "Lookup", "MULTIPLE_VALUE_RESULTS_PER_PAGE");
assertNotNull("State should not be null", parameter);
pkValue = MetadataManager.getEntityPrimaryKeyObject(ParameterBo.from(parameter));
org.junit.Assert.assertEquals("Composite pkValue for Parameter should have class of ParameterId", ParameterId.class, pkValue.getClass());
ParameterId parameterId = (ParameterId)pkValue;
assertEquals("namespace code was not correctly set", "KR-NS", parameterId.getNamespaceCode());
assertEquals("parameter detail type code was not correctly set", "Lookup", parameterId.getComponentCode());
assertEquals("parameter name was not correctly set", "MULTIPLE_VALUE_RESULTS_PER_PAGE", parameterId.getName());
assertEquals("parameterApplicationNamespaceCode was not correctly set", "KUALI", parameterId.getApplicationId());
}
示例3: getKeyValues
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Override
public List<KeyValue> getKeyValues() {
// get a list of all ParameterTypes
KeyValuesService boService = KRADServiceLocator.getKeyValuesService();
List<ParameterTypeBo> bos = (List<ParameterTypeBo>) boService.findAll(ParameterTypeBo.class);
// copy the list of codes before sorting, since we can't modify the results from this method
if (bos == null) {
return Collections.emptyList();
}
final List<ParameterTypeBo> toReturn = new ArrayList<ParameterTypeBo>(bos);
// sort using comparator.
Collections.sort(bos, ParameterTypeComparator.INSTANCE);
// create a new list (code, descriptive-name)
List<KeyValue> labels = new ArrayList<KeyValue>(bos.size());
for (ParameterTypeBo bo : bos) {
labels.add(new ConcreteKeyValue(bo.getCode(), bo.getName()));
}
return labels;
}
示例4: testParameterTypeBoDataObject
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Test
public void testParameterTypeBoDataObject() throws Exception{
assertTrue("ParameterTypeBo is mapped in JPA", KRADServiceLocator.getDataObjectService().supports(ParameterTypeBo.class));
setupParameterTypeBoDataObjectAndSave();
ParameterTypeBo parameterTypeBoFetched = KRADServiceLocator.getDataObjectService().find(ParameterTypeBo.class,"PTBO");
assertTrue("ParameterTypeBo refetched after save", parameterTypeBoFetched != null &&
StringUtils.equals(parameterTypeBoFetched.getName(),"Parameter Type"));
}
示例5: setupParameterBoDataObjectAndSave
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
private void setupParameterBoDataObjectAndSave(){
NamespaceBo namespaceBo = new NamespaceBo();
namespaceBo.setActive(true);
namespaceBo.setApplicationId("RICE");
namespaceBo.setCode("TST_NM_SPACE");
namespaceBo.setName("Another Test Namespace");
namespaceBo = KRADServiceLocator.getDataObjectService().save(namespaceBo, PersistenceOption.FLUSH);
ParameterTypeBo parameterTypeBo = new ParameterTypeBo();
parameterTypeBo.setActive(true);
parameterTypeBo.setCode("PT");
parameterTypeBo.setName("Another Test Parameter Type");
parameterTypeBo = KRADServiceLocator.getDataObjectService().save(parameterTypeBo, PersistenceOption.FLUSH);
ParameterBo parameterBo = new ParameterBo();
parameterBo.setApplicationId(APP_ID);
parameterBo.setValue("blah");
parameterBo.setDescription("descr");
parameterBo.setParameterTypeCode("PT");
parameterBo.setParameterType(parameterTypeBo);
parameterBo.setComponentCode("TST");
parameterBo.setNamespaceCode("TST_NM_SPACE");
parameterBo.setNamespace(namespaceBo);
parameterBo.setEvaluationOperatorCode("A");
parameterBo.setName("TST_PARAM");
CoreServiceApiServiceLocator.getParameterRepositoryService().
createParameter(ParameterBo.to(parameterBo));
}
示例6: setupParameterTypeBoDataObjectAndSave
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
private void setupParameterTypeBoDataObjectAndSave(){
ParameterTypeBo parameterTypeBo = new ParameterTypeBo();
parameterTypeBo.setActive(true);
parameterTypeBo.setCode("PTBO");
parameterTypeBo.setName("Parameter Type");
parameterTypeBo.setVersionNumber(null);
KRADServiceLocator.getDataObjectService().save(parameterTypeBo, PersistenceOption.FLUSH);
}
示例7: testGetParameterTypeEbo
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Test
public void testGetParameterTypeEbo() {
assertNotNull("coreServiceModuleService wasn't successfully configured", coreServiceModuleService);
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put("code","CONFG");
ParameterTypeBo parameterType = coreServiceModuleService.getExternalizableBusinessObject(ParameterTypeBo.class,fieldValues);
assertNotNull("parameterType wasn't successfully loaded", parameterType);
assertEquals("parameterType doesn't have the requested code",
parameterType.getCode(),"CONFG");
}
示例8: getExternalizableBusinessObject
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Override
public <T extends ExternalizableBusinessObject> T getExternalizableBusinessObject(Class<T> businessObjectClass,
Map<String, Object> fieldValues) {
T result = null;
if (NamespaceEbo.class.isAssignableFrom(businessObjectClass)) {
if(isNonBlankValueForKey(fieldValues, CODE)) {
Namespace namespace = getNamespaceService().getNamespace((String)fieldValues.get(CODE));
result = (T) NamespaceBo.from(namespace);
}
}
if (ParameterEbo.class.isAssignableFrom(businessObjectClass)) {
if(isNonBlankValueForKey(fieldValues, APPLICATION_ID) && isNonBlankValueForKey(fieldValues, NAMESPACE_CODE)
&& isNonBlankValueForKey(fieldValues, COMPONENT_CODE) && isNonBlankValueForKey(fieldValues, NAME)) {
ParameterKey key = ParameterKey.create((String)fieldValues.get(APPLICATION_ID),(String)fieldValues.get(NAMESPACE_CODE),
(String)fieldValues.get(COMPONENT_CODE),(String)fieldValues.get(NAME));
Parameter parameter = getParameterRepositoryService().getParameter(key);
result = (T) ParameterBo.from(parameter);
}
}
if (ComponentEbo.class.isAssignableFrom(businessObjectClass)) {
if(isNonBlankValueForKey(fieldValues, CODE) && isNonBlankValueForKey(fieldValues, NAMESPACE_CODE)){
Component component = getComponentService().getComponentByCode((String)fieldValues.get(NAMESPACE_CODE), (String)fieldValues.get(CODE));
result = (T) ComponentBo.from(component);
}
}
if (ParameterTypeEbo.class.isAssignableFrom(businessObjectClass)) {
if(isNonBlankValueForKey(fieldValues, CODE)){
ParameterTypeBo parameterType = getBusinessObjectService().findBySinglePrimaryKey(ParameterTypeBo.class,(String)fieldValues.get(CODE));
result = (T) parameterType;
}
}
return result;
}
示例9: compare
import org.kuali.rice.coreservice.impl.parameter.ParameterTypeBo; //导入依赖的package包/类
@Override
public int compare(ParameterTypeBo o1, ParameterTypeBo o2) {
return o1.getCode().compareTo(o2.getCode());
}