本文整理匯總了Java中org.kuali.rice.kew.api.repository.type.KewAttributeDefinition類的典型用法代碼示例。如果您正苦於以下問題:Java KewAttributeDefinition類的具體用法?Java KewAttributeDefinition怎麽用?Java KewAttributeDefinition使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
KewAttributeDefinition類屬於org.kuali.rice.kew.api.repository.type包,在下文中一共展示了KewAttributeDefinition類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildRemotableFieldWithoutDataDictionary
import org.kuali.rice.kew.api.repository.type.KewAttributeDefinition; //導入依賴的package包/類
/**
* Builds a {@link RemotableAttributeField} instance when there is no component configured (and therefore we can
* not lookup the data dictionary)
*
* <p>
* Very basic field, should have labels configured and defaults to using text control
* </p>
*
* @param attributeDefinition - KEW attribute definition configured from which the name, label, and description
* will be pulled
* @return RemotableAttributeField instance built from the given KEW attribute definition
*/
protected RemotableAttributeField buildRemotableFieldWithoutDataDictionary(
KewAttributeDefinition attributeDefinition) {
RemotableAttributeField.Builder definition = RemotableAttributeField.Builder.create(
attributeDefinition.getName());
definition.setLongLabel(attributeDefinition.getLabel());
definition.setShortLabel(attributeDefinition.getLabel());
definition.setHelpDescription(attributeDefinition.getDescription());
// default control to text
RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
controlBuilder.setSize(30);
definition.setControl(controlBuilder);
return definition.build();
}
示例2: from
import org.kuali.rice.kew.api.repository.type.KewAttributeDefinition; //導入依賴的package包/類
/**
* Converts a immutable object to it's mutable bo counterpart
* @param kadIm immutable object
* @return the mutable bo
*/
public static KewAttributeDefinitionBo from(KewAttributeDefinition kadIm) {
if (null == kadIm) {
return null;
} else {
KewAttributeDefinitionBo kadBo = new KewAttributeDefinitionBo();
kadBo.setId(kadIm.getId());
kadBo.setName(kadIm.getName());
kadBo.setNamespace(kadIm.getNamespace());
kadBo.setLabel(kadIm.getLabel());
kadBo.setDescription(kadIm.getDescription());
kadBo.setActive(kadIm.isActive());
kadBo.setComponentName(kadIm.getComponentName());
kadBo.setVersionNumber(kadIm.getVersionNumber());
return kadBo;
}
}
示例3: from
import org.kuali.rice.kew.api.repository.type.KewAttributeDefinition; //導入依賴的package包/類
public static PeopleFlowAttributeBo from(KewAttributeDefinition attributeDefinition, String id, PeopleFlowBo peopleFlow,
String value) {
if (null == attributeDefinition) {
return null;
}
PeopleFlowAttributeBo peopleFlowAttributeBo = new PeopleFlowAttributeBo();
peopleFlowAttributeBo.setId(id);
peopleFlowAttributeBo.setPeopleFlow(peopleFlow);
peopleFlowAttributeBo.setValue(value);
peopleFlowAttributeBo.setAttributeDefinition(KewAttributeDefinitionBo.from(attributeDefinition));
return peopleFlowAttributeBo;
}
示例4: to
import org.kuali.rice.kew.api.repository.type.KewAttributeDefinition; //導入依賴的package包/類
/**
* Converts a mutable bo to it's immutable counterpart
* @param kadBo the mutable business object
* @return the immutable object
*/
public static KewAttributeDefinition to(KewAttributeDefinitionBo kadBo) {
if(null == kadBo) {
return null;
} else {
return org.kuali.rice.kew.api.repository.type.KewAttributeDefinition.Builder.create(kadBo).build();
}
}
示例5: fromAndUpdate
import org.kuali.rice.kew.api.repository.type.KewAttributeDefinition; //導入依賴的package包/類
/**
* Translates from the given PeopleFlowDefinition to a PeopleFlowBo, optionally updating the given "toUpdate" parameter
* instead of creating a new PeopleFlowBo. If it's not passed then a new PeopleFlowBo will be created.
*/
public static PeopleFlowBo fromAndUpdate(PeopleFlowDefinition peopleFlow, KewTypeDefinition kewTypeDefinition,
PeopleFlowBo toUpdate) {
PeopleFlowBo result = toUpdate;
if (null == toUpdate) {
result = new PeopleFlowBo();
}
result.setId(peopleFlow.getId());
result.setName(peopleFlow.getName());
result.setNamespaceCode(peopleFlow.getNamespaceCode());
result.setTypeId(peopleFlow.getTypeId());
result.setDescription(peopleFlow.getDescription());
result.setActive(peopleFlow.isActive());
result.setVersionNumber(peopleFlow.getVersionNumber());
// we need to translate attributes over, this is a bit more work, first let's do some validation
if (null == peopleFlow.getTypeId()) {
if (null != kewTypeDefinition) {
throw new RiceIllegalArgumentException("PeopleFlow has no type id, but a KewTypeDefinition was " +
"supplied when it should not have been.");
}
}
if (null != peopleFlow.getTypeId()) {
if (kewTypeDefinition == null) {
throw new RiceIllegalArgumentException("PeopleFlow has a type id of '" + peopleFlow.getTypeId() +
"' but no KewTypeDefinition was supplied.");
}
if (!kewTypeDefinition.getId().equals(peopleFlow.getTypeId())) {
throw new RiceIllegalArgumentException("Type id of given KewTypeDefinition does not match PeopleFlow " +
"type id: " + kewTypeDefinition.getId() + " != " + peopleFlow.getTypeId());
}
}
// now we need to effectively do a diff with the given attributes, first let's add new entries and update
// existing ones
// TODO - ensure this is correct
ArrayList attributesToAdd = new ArrayList<PeopleFlowAttributeBo>();
// if type is null drop attributes
if (null != peopleFlow.getTypeId()) {
for (String key : peopleFlow.getAttributes().keySet()) {
KewAttributeDefinition attributeDefinition = kewTypeDefinition.getAttributeDefinitionByName(key);
if (null == attributeDefinition) {
throw new RiceIllegalArgumentException("There is no attribute definition for the given attribute " +
"name '" + key + "'");
}
attributesToAdd.add(PeopleFlowAttributeBo.from(attributeDefinition, null, result,
peopleFlow.getAttributes().get(key)));
}
result.setAttributeBos(attributesToAdd);
}
// TODO - END
handleMembersUpdate(result, peopleFlow);
return result;
}