本文整理汇总了Java中org.kuali.rice.krad.util.KRADUtils类的典型用法代码示例。如果您正苦于以下问题:Java KRADUtils类的具体用法?Java KRADUtils怎么用?Java KRADUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KRADUtils类属于org.kuali.rice.krad.util包,在下文中一共展示了KRADUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkAuthorization
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
@Override
protected void checkAuthorization(ActionForm form, String methodToCall) throws AuthorizationException {
if (!(form instanceof LookupForm)) {
super.checkAuthorization(form, methodToCall);
} else {
try {
Class businessObjectClass = Class.forName(((LookupForm) form).getBusinessObjectClassName());
if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
GlobalVariables.getUserSession().getPrincipalId(), KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
KRADUtils.getNamespaceAndComponentSimpleName(businessObjectClass),
Collections.<String, String>emptyMap())) {
throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(),
KimConstants.PermissionTemplateNames.LOOK_UP_RECORDS,
businessObjectClass.getSimpleName());
}
}
catch (ClassNotFoundException e) {
LOG.warn("Unable to load BusinessObject class: " + ((LookupForm) form).getBusinessObjectClassName(), e);
super.checkAuthorization(form, methodToCall);
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:KualiLookupAction.java
示例2: backdoorLogout
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Method to logout the backdoor user and return to the view.
*
* @return the view to return to
*/
@RequestMapping(params = "methodToCall=backdoorLogout")
public ModelAndView backdoorLogout(@ModelAttribute("KualiForm") DummyLoginForm uifForm, BindingResult result,
HttpServletRequest request, HttpServletResponse response) {
String returnUrl = decode(uifForm.getReturnLocation());
if (StringUtils.isBlank(returnUrl)) {
returnUrl = ConfigContext.getCurrentContextConfig().getProperty(KRADConstants.APPLICATION_URL_KEY);
}
UserSession userSession = KRADUtils.getUserSessionFromRequest(request);
if (userSession.isBackdoorInUse()) {
userSession.clearBackdoorUser();
}
return performRedirect(uifForm, returnUrl, new Properties());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:DummyLoginController.java
示例3: preHandle
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Before the controller executes the user session is set on GlobalVariables
* and messages are cleared, in addition setup for the history manager and a check on missing session
* forms is performed.
*
* {@inheritDoc}
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
Object handler) throws Exception {
checkHandlerMethodAccess(request, handler);
final ParameterService parameterService = CoreFrameworkServiceLocator.getParameterService();
if (parameterService.getParameterValueAsBoolean(KRADConstants.KUALI_RICE_SYSTEM_NAMESPACE, ParameterConstants.ALL_COMPONENT, CsrfValidator.CSRF_PROTECTION_ENABLED_PARAM) && !CsrfValidator.validateCsrf(request, response)) {
return false;
}
final UserSession session = KRADUtils.getUserSessionFromRequest(request);
GlobalVariables.setUserSession(session);
GlobalVariables.clear();
createUifFormManagerIfNecessary(request);
// add the HistoryManager for storing HistoryFlows to the session
if (request.getSession().getAttribute(UifConstants.HistoryFlow.HISTORY_MANAGER) == null) {
request.getSession().setAttribute(UifConstants.HistoryFlow.HISTORY_MANAGER, new HistoryManager());
}
ProcessLogger.trace("pre-handle");
return true;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:UifControllerHandlerInterceptor.java
示例4: getMaintenanceActionUrl
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
@Override
protected String getMaintenanceActionUrl(LookupForm lookupForm, Object dataObject, String methodToCall,
List<String> pkNames) {
Properties props = new Properties();
props.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, methodToCall);
Map<String, String> primaryKeyValues = KRADUtils.getPropertyKeyValuesFromDataObject(pkNames, dataObject);
for (String primaryKey : primaryKeyValues.keySet()) {
String primaryKeyValue = primaryKeyValues.get(primaryKey);
props.put(primaryKey, primaryKeyValue);
props.put(KRADConstants.OVERRIDE_KEYS, primaryKey);
}
if (StringUtils.isNotBlank(lookupForm.getReturnLocation())) {
props.put(KRADConstants.RETURN_LOCATION_PARAMETER, lookupForm.getReturnLocation());
}
props.put(UifParameters.DATA_OBJECT_CLASS_NAME, PropositionBo.class.getName());
props.put(UifParameters.VIEW_TYPE_NAME, UifConstants.ViewType.MAINTENANCE.name());
return UrlFactory.parameterizeUrl(org.kuali.rice.krms.impl.util.KrmsImplConstants.WebPaths.PROPOSITION_PATH, props);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:PropositionLookupableHelperServiceImpl.java
示例5: getRedirectUrl
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Inspects the given view session policy to determine how the request should be redirected
*
* <p>
* The request will either be redirected to the application home, a custom URL, the same request URL but
* modified to call the <code>sessionTimeout</code> method, or a redirect to show the session timeout view
* </p>
*
* @param sessionPolicy session policy instance to inspect
* @param httpServletRequest request instance for pulling parameters
* @return redirect URL or null if no redirect was configured
*/
protected String getRedirectUrl(ViewSessionPolicy sessionPolicy, HttpServletRequest httpServletRequest) {
String redirectUrl = null;
if (sessionPolicy.isRedirectToHome()) {
redirectUrl = CoreApiServiceLocator.getKualiConfigurationService().getPropertyValueAsString(
KRADConstants.APPLICATION_URL_KEY);
} else if (StringUtils.isNotBlank(sessionPolicy.getRedirectUrl())) {
redirectUrl = sessionPolicy.getRedirectUrl();
} else if (sessionPolicy.isRenderTimeoutView()) {
String kradUrl = CoreApiServiceLocator.getKualiConfigurationService().getPropertyValueAsString(
KRADConstants.KRAD_URL_KEY);
redirectUrl = KRADUtils.buildViewUrl(kradUrl, KRADConstants.REQUEST_MAPPING_SESSION_TIMEOUT,
KRADConstants.SESSION_TIMEOUT_VIEW_ID);
}
return redirectUrl;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:UifSessionTimeoutFilter.java
示例6: establishBackdoorUser
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* establishes the backdoor user on the established user id if backdoor capabilities are valid.
*/
private void establishBackdoorUser(HttpServletRequest request) {
final String backdoor = request.getParameter(KRADConstants.BACKDOOR_PARAMETER);
if (StringUtils.isNotBlank(backdoor)) {
if (!getKualiConfigurationService().getPropertyValueAsString(KRADConstants.PROD_ENVIRONMENT_CODE_KEY)
.equalsIgnoreCase(getKualiConfigurationService().getPropertyValueAsString(
KRADConstants.ENVIRONMENT_KEY))) {
if (getParameterService().getParameterValueAsBoolean(KRADConstants.KUALI_RICE_WORKFLOW_NAMESPACE,
KRADConstants.DetailTypes.BACKDOOR_DETAIL_TYPE, KewApiConstants.SHOW_BACK_DOOR_LOGIN_IND)) {
try {
KRADUtils.getUserSessionFromRequest(request).setBackdoorUser(backdoor);
} catch (RiceRuntimeException re) {
//Ignore so BackdoorAction can redirect to invalid_backdoor_portal
}
}
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:UserLoginFilter.java
示例7: testValidInheritedAppDocStatusWithCategories
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
*
* This method an inherited valid set of values and categories.
*
* @throws Exception
*/
@Test public void testValidInheritedAppDocStatusWithCategories() throws Exception {
// Create document
WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestAppDocStatusDoc5");
document.saveDocumentData();
assertNotNull(document.getDocumentId());
assertTrue("Document should be initiatied", document.isInitiated());
assertTrue("Invalid route level.", document.getNodeNames().contains("Initiated"));
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName("TestAppDocStatusDoc5");
assertTrue(KRADUtils.isNotNull(documentType));
assertTrue(KRADUtils.isNotNull(documentType.getValidApplicationStatuses()));
LOG.info("valid application status size: " + documentType.getValidApplicationStatuses().size());
assertEquals(6,documentType.getValidApplicationStatuses().size());
assertTrue(KRADUtils.isNotNull(documentType.getApplicationStatusCategories()));
assertEquals(2,documentType.getApplicationStatusCategories().size());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:AppDocStatusTest.java
示例8: getMessages
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Gets all the messages from the list of lists passed in (which are
* lists of ErrorMessages associated to the key) and uses the configuration
* service to get the message String associated. This will also combine
* error messages per a field if that option is turned on. If
* displayFieldLabelWithMessages is turned on, it will also find the label
* by key passed in.
*
* @param view
* @param key
* @param lists
* @return list of messages
*/
protected List<String> getMessages(View view, String key, List<List<ErrorMessage>> lists) {
List<String> result = new ArrayList<String>();
for (List<ErrorMessage> errorList : lists) {
if (errorList != null && StringUtils.isNotBlank(key)) {
for (ErrorMessage e : errorList) {
String message = KRADUtils.getMessageText(e, true);
message = MessageStructureUtils.translateStringMessage(message);
result.add(message);
}
}
}
return result;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:ValidationMessages.java
示例9: convertStringToPropertyType
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Convert a string property value to the targeted property type.
*
* @param propertyValue The string property value.
* @return The property value, converted to the property type.
*/
private Object convertStringToPropertyType(String propertyValue) {
Class<?> propertyType = getPropertyType();
// TODO: these methods, and their inversions (below) need to be either support escaping
// or be removed. Both have been included for equivalence with previous BeanWrapper
// implementation.
if (List.class.equals(propertyType)) {
return KRADUtils.convertStringParameterToList(propertyValue);
} else if (Map.class.equals(propertyType)) {
return KRADUtils.convertStringParameterToMap(propertyValue);
} else {
PropertyEditor editor = ObjectPropertyUtils.getPropertyEditor(rootBean, rootPath);
if (editor == null) {
throw new IllegalArgumentException("No property editor available for converting '" + propertyValue
+ "' to " + propertyType);
}
editor.setAsText((String) propertyValue);
return editor.getValue();
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:ObjectPropertyReference.java
示例10: compareFieldStringValues
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Compare the field values by computing the two string values and comparing them based on the
* sort type.
*
* @param columnSort the comparison metadata (which column number, which direction, what type of
* sort)
* @param protoField the prototype Field for the column being sorted
* @param index1 the index of the first modelCollection element for comparison
* @param index2 the index of the second modelCollection element for comparison
* @return 0 if the two elements are considered equal, a positive integer if the element at
* index1 is considered greater, else a negative integer
*/
private int compareFieldStringValues(ColumnSort columnSort, Field protoField, Integer index1, Integer index2) {
final int sortResult;
final String fieldValue1;
final String fieldValue2;
if (!CollectionUtils.sizeIsEmpty(protoField.getPropertyExpressions())) {
// We have to evaluate expressions
fieldValue1 = calculateFieldValue(protoField, index1, columnSort.getColumnIndex());
fieldValue2 = calculateFieldValue(protoField, index2, columnSort.getColumnIndex());
} else {
fieldValue1 = KRADUtils.getSimpleFieldValue(modelCollection.get(index1), protoField);
fieldValue2 = KRADUtils.getSimpleFieldValue(modelCollection.get(index2), protoField);
}
sortResult = columnTypeCompare(fieldValue1, fieldValue2, columnSort.getSortType());
return sortResult;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:MultiColumnComparator.java
示例11: generateMessageText
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Returns formatted message text for the given message namespace, component, and key
*
* @param namespace namespace code the message is associated with, if null the default namespace
* will be used
* @param componentCode component code the message is associated with, if null default component
* code is used
* @param messageKey key for the message to retrieve
* @param params list of parameters for the message text
* @return formatted message text
*/
public static String generateMessageText(String namespace, String componentCode, String messageKey,
List<String> params) {
String message = "NO MESSAGE";
if (StringUtils.isNotEmpty(messageKey)) {
message = KRADServiceLocatorWeb.getMessageService().getMessageText(namespace, componentCode, messageKey);
if (params != null && !params.isEmpty() && StringUtils.isNotEmpty(message)) {
message = MessageFormat.format(message, params.toArray());
message = MessageStructureUtils.translateStringMessage(message);
}
}
if (StringUtils.isEmpty(message)) {
message = messageKey;
}
//replace characters that might cause issues with their equivalent html codes
message = KRADUtils.convertToHTMLAttributeSafeString(message);
return message;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:ClientValidationUtils.java
示例12: getUnresolvedInheritedDocHandlerUrl
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* This method retrieves the unresolved document handler URL either from this object or from a parent document type
* object. If the forDisplayPurposes value is true the value returned will be invalid for system use.
* <p/>
* This method will first call the {@link #getUnresolvedDocHandlerUrl()} method to check for a value on this object.
* If none is found a parent document type must exist because the document handler URL is required and is used. The
* system will use inheritance to find the document handler url from a document type somewhere in the hierarchy.
*
* @param forDisplayPurposes - if true then the string returned will have a label explaining where the value came from
* @return the unresolved document handler URL value or a displayable value with sourcing information
*/
protected String getUnresolvedInheritedDocHandlerUrl(boolean forDisplayPurposes) {
if (StringUtils.isNotBlank(getUnresolvedDocHandlerUrl())) {
// this object has a direct value set, so return it
return getUnresolvedDocHandlerUrl();
}
// check for a parent document to see if the doc handler url can be inherited
DocumentType docType = getParentDocType();
if (KRADUtils.isNotNull(docType)) {
String parentValue = docType.getUnresolvedDocHandlerUrl();
if (StringUtils.isNotBlank(parentValue)) {
// found a parent value set on the immediate parent object so return it
if (forDisplayPurposes) {
parentValue += " " + KewApiConstants.DOCUMENT_TYPE_INHERITED_VALUE_INDICATOR;
}
return parentValue;
}
// no valid value exists on the immediate parent, so check the hierarchy
return docType.getUnresolvedInheritedDocHandlerUrl(forDisplayPurposes);
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:DocumentType.java
示例13: getAriaAttributesAsString
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String getAriaAttributesAsString() {
String attributes = "";
if (getAriaAttributes() == null) {
return attributes;
}
for (Map.Entry<String, String> aria : getAriaAttributes().entrySet()) {
if (aria != null && aria.getValue() != null) {
attributes = attributes + " " + "aria-" + aria.getKey() + "=\"" +
KRADUtils.convertToHTMLAttributeSafeString(aria.getValue()) + "\"";
}
}
return attributes;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ComponentBase.java
示例14: prepareSelectFieldForLine
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
public static void prepareSelectFieldForLine(Field selectField, CollectionGroup collectionGroup, String lineBindingPath,
Object line) {
// if select property name set use as property name for select field
String selectPropertyName = collectionGroup.getLineSelectPropertyName();
if (StringUtils.isNotBlank(selectPropertyName)) {
// if select property contains form prefix, will bind to form and not each line
if (selectPropertyName.startsWith(UifConstants.NO_BIND_ADJUST_PREFIX)) {
selectPropertyName = StringUtils.removeStart(selectPropertyName, UifConstants.NO_BIND_ADJUST_PREFIX);
((DataBinding) selectField).getBindingInfo().setBindingName(selectPropertyName);
((DataBinding) selectField).getBindingInfo().setBindToForm(true);
} else {
((DataBinding) selectField).getBindingInfo().setBindingName(selectPropertyName);
((DataBinding) selectField).getBindingInfo().setBindByNamePrefix(lineBindingPath);
}
} else {
// select property name not given, use UifFormBase#selectedCollectionLines
String collectionLineKey = KRADUtils.translateToMapSafeKey(
collectionGroup.getBindingInfo().getBindingPath());
String selectBindingPath = UifPropertyPaths.SELECTED_COLLECTION_LINES + "['" + collectionLineKey + "']";
((DataBinding) selectField).getBindingInfo().setBindingName(selectBindingPath);
((DataBinding) selectField).getBindingInfo().setBindToForm(true);
}
setControlValueToLineIdentifier(selectField, line, lineBindingPath);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:CollectionLayoutUtils.java
示例15: start
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* Determines if the inquiry request needs to be redirected based on the module service, if not retrieves
* the inquiry data object and sets the instance onto the form for display.
*
* <p>Note the inquiry data object is retrieved based on the key values passed by the request.</p>
*
* {@inheritDoc}
*/
@Override
public ModelAndView start(UifFormBase form) {
InquiryForm inquiryForm = (InquiryForm) form;
HttpServletRequest request = form.getRequest();
Boolean hasRedirectedInquiryParameter = (request.getParameter(UifParameters.REDIRECTED_INQUIRY) != null
&& request.getParameter(UifParameters.REDIRECTED_INQUIRY).contains("true"));
if (!inquiryForm.isRedirectedInquiry() && !hasRedirectedInquiryParameter) {
ModelAndView redirectModelAndView = checkForModuleInquiryRedirect(inquiryForm, request);
if (redirectModelAndView != null) {
return redirectModelAndView;
}
}
// invoke inquirable to retrieve inquiry data object
Object dataObject = inquiryForm.getInquirable().retrieveDataObject(KRADUtils.translateRequestParameterMap(
request.getParameterMap()));
inquiryForm.setDataObject(dataObject);
return super.start(inquiryForm);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:InquiryControllerServiceImpl.java
示例16: getAttributeValue
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
private Object getAttributeValue(PropertyDescriptor propertyDescriptor, String attributeValue){
Object attributeValueObject = null;
if (propertyDescriptor!=null && attributeValue!=null) {
Class<?> propertyType = propertyDescriptor.getPropertyType();
if (String.class.equals(propertyType)) {
// it's already a String
attributeValueObject = attributeValue;
} // KULRICE-6808: Kim Role Maintenance - Custom boolean role qualifier values are not being converted properly
else if (Boolean.class.equals(propertyType) || Boolean.TYPE.equals(propertyType)) {
attributeValueObject = Truth.strToBooleanIgnoreCase(attributeValue);
} else {
// try to create one with KRADUtils for other misc data types
attributeValueObject = KRADUtils.createObject(propertyType, new Class[]{String.class}, new Object[]{attributeValue});
// if that didn't work, we'll get a null back
if (attributeValueObject == null ) {
// this doesn't seem like a great option, since we know the property isn't of type String
attributeValueObject = attributeValue;
}
}
}
return attributeValueObject;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:AttributeValidatingTypeServiceBase.java
示例17: setupPrincipal
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
@Override
protected boolean setupPrincipal(IdentityManagementPersonDocument identityManagementPersonDocument,EntityBo kimEntity, List<PrincipalBo> origPrincipals) {
boolean inactivatingPrincipal = false;
List<PrincipalBo> principals = new ArrayList<PrincipalBo>();
Principal.Builder principal = Principal.Builder.create(identityManagementPersonDocument.getPrincipalName());
principal.setPrincipalId(identityManagementPersonDocument.getPrincipalId());
//principal.setPassword(identityManagementPersonDocument.getPassword());
principal.setActive(identityManagementPersonDocument.isActive());
principal.setEntityId(identityManagementPersonDocument.getEntityId());
if(KRADUtils.isNotNull(origPrincipals)){
for (PrincipalBo prncpl : origPrincipals) {
if (prncpl.getPrincipalId()!=null && StringUtils.equals(prncpl.getPrincipalId(), principal.getPrincipalId())) {
principal.setVersionNumber(prncpl.getVersionNumber());
principal.setObjectId(prncpl.getObjectId());
// check if inactivating the principal
if ( prncpl.isActive() && !principal.isActive() ) {
inactivatingPrincipal = true;
}
}
}
}
principals.add(PrincipalBo.from(principal.build()));
kimEntity.setPrincipals(principals);
return inactivatingPrincipal;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:LdapUiDocumentServiceImpl.java
示例18: getApplicationId
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
/**
* This method gets the string for the application id value. If the forDisplayPurposes value is true
* the application id value will be invalid for system use.
* <p/>
* This method will first call the {@link #getActualApplicationId()} method to check for a value on this object. If
* none is found a parent document type is used. If a valid parent type exists for this document type then the system
* will use inheritance from that parent document type as long as at least one document type in the hierarchy has a
* value set. If no value is set on any parent document type or if no parent document type exists for this object the
* system default is used: {@link CoreConfigHelper#getApplicationId()}
*
* @param forDisplayPurposes - if true then the string returned will have a label explaining where the value came from
* @return the application id value or a displayable value with sourcing information
*/
protected String getApplicationId(boolean forDisplayPurposes) {
if (StringUtils.isNotBlank(getActualApplicationId())) {
// this object has a application id set, so return it
return getActualApplicationId();
}
// this object has no application id... check for a parent document type
if (KRADUtils.isNotNull(getParentDocType())) {
// direct parent document type exists
String parentValue = getParentDocType().getActualApplicationId();
if (StringUtils.isNotBlank(parentValue)) {
// found a parent value set on the immediate parent object so return it
if (forDisplayPurposes) {
parentValue += " " + KewApiConstants.DOCUMENT_TYPE_INHERITED_VALUE_INDICATOR;
}
return parentValue;
}
// no valid application id on direct parent, so use hierarchy to find correct value
return getParentDocType().getApplicationId(forDisplayPurposes);
}
String defaultValue = CoreConfigHelper.getApplicationId();
if (forDisplayPurposes) {
defaultValue += " " + KewApiConstants.DOCUMENT_TYPE_SYSTEM_DEFAULT_INDICATOR;
}
return defaultValue;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:DocumentType.java
示例19: getSearchResultsForEBO
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的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
示例20: verifyVersionNumber
import org.kuali.rice.krad.util.KRADUtils; //导入依赖的package包/类
@Override
public void verifyVersionNumber(Object dataObject) {
if (isPersistable(dataObject.getClass())) {
Object pbObject = businessObjectService.retrieve(dataObject);
if ( dataObject instanceof Versioned ) {
Long pbObjectVerNbr = KRADUtils.isNull(pbObject) ? null : ((Versioned) pbObject).getVersionNumber();
Long newObjectVerNbr = ((Versioned) dataObject).getVersionNumber();
if (pbObjectVerNbr != null && !(pbObjectVerNbr.equals(newObjectVerNbr))) {
GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS,
RiceKeyConstants.ERROR_VERSION_MISMATCH);
throw new ValidationException(
"Version mismatch between the local business object and the database business object");
}
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KNSLegacyDataAdapterImpl.java
注:本文中的org.kuali.rice.krad.util.KRADUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论