本文整理汇总了Java中org.kuali.rice.krms.impl.repository.TermSpecificationBo.getContexts方法的典型用法代码示例。如果您正苦于以下问题:Java TermSpecificationBo.getContexts方法的具体用法?Java TermSpecificationBo.getContexts怎么用?Java TermSpecificationBo.getContexts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krms.impl.repository.TermSpecificationBo
的用法示例。
在下文中一共展示了TermSpecificationBo.getContexts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateContext
import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
private boolean validateContext(TermSpecificationBo termSpec) {
List<ContextBo> termSpecContexts = termSpec.getContexts();
List<String> contextIds = new ArrayList<String>();
boolean valid = true;
for (ContextBo context: termSpecContexts) {
if (contextIds.contains(context.getId())) {
this.putFieldError(KRMSPropertyConstants.TermSpecification.CONTEXT, "error.termSpecification.duplicateContext");
valid = false;
} else {
contextIds.add(context.getId());
}
}
return valid;
}
示例2: prepareForSave
import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
* Store contexts in contextIds (needed for serialization)
*
* @see org.kuali.rice.krad.maintenance.Maintainable#prepareForSave
*/
@Override
public void prepareForSave() {
super.prepareForSave();
TermSpecificationBo termSpec = (TermSpecificationBo) getDataObject();
termSpec.setContextIds(new ArrayList<String>());
for (ContextBo context : termSpec.getContexts()) {
termSpec.getContextIds().add(context.getId());
}
}
示例3: copyContextsOldToNewBo
import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
* Copy the contexts from the old TermSpecificationBo to the newTermSpecificationBo of the maintenance document.
* <p>
* Since the contexts is a transient field it doesn't get copied by the deepCopy in
* MaintenanceDocumentServiceImpl.setupMaintenanceObject, we manually need to copy the values over.
* For performance reasons a shallow copy is done since the ContextBo themselves are never changed.
* </p>
* @param document that contains the old and new TermSpecificationBos
*/
private void copyContextsOldToNewBo(MaintenanceDocument document) {
TermSpecificationBo newTermSpec = (TermSpecificationBo) document.getNewMaintainableObject().getDataObject();
// Hydrade contexts as they are transient
newTermSpec.getContexts().clear();
newTermSpec.getContexts();
}
示例4: copyContextsOldToNewBo
import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
* Copy the contexts from the old TermSpecificationBo to the newTermSpecificationBo of the maintenance document.
* <p>
* Since the contexts is a transient field it doesn't get copied by the deepCopy in
* MaintenanceDocumentServiceImpl.setupMaintenanceObject, we manually need to copy the values over.
* For performance reasons a shallow copy is done since the ContextBo themselves are never changed.
* </p>
* @param document that contains the old and new TermSpecificationBos
*/
private void copyContextsOldToNewBo(MaintenanceDocument document) {
TermSpecificationBo oldTermSpec = (TermSpecificationBo) document.getOldMaintainableObject().getDataObject();
TermSpecificationBo newTermSpec = (TermSpecificationBo) document.getNewMaintainableObject().getDataObject();
newTermSpec.setContexts(new ArrayList<ContextBo>());
for (ContextBo contextBo : oldTermSpec.getContexts()) {
newTermSpec.getContexts().add(contextBo);
}
}