当前位置: 首页>>代码示例>>Java>>正文


Java KRADServiceLocatorWeb类代码示例

本文整理汇总了Java中org.kuali.rice.krad.service.KRADServiceLocatorWeb的典型用法代码示例。如果您正苦于以下问题:Java KRADServiceLocatorWeb类的具体用法?Java KRADServiceLocatorWeb怎么用?Java KRADServiceLocatorWeb使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


KRADServiceLocatorWeb类属于org.kuali.rice.krad.service包,在下文中一共展示了KRADServiceLocatorWeb类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSearchResultsForEBO

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的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: setDerivedValuesOnForm

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
@Override
public void setDerivedValuesOnForm(HttpServletRequest request) {
	super.setDerivedValuesOnForm(request);

	String docTypeName = getDocTypeName();
	if (StringUtils.isNotBlank(docTypeName)) {
		DataDictionary dataDictionary = KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary();

           Class<? extends DerivedValuesSetter> derivedValuesSetterClass = null;
           KNSDocumentEntry documentEntry = (KNSDocumentEntry) dataDictionary.getDocumentEntry(docTypeName);
           derivedValuesSetterClass = (documentEntry).getDerivedValuesSetterClass();

		if (derivedValuesSetterClass != null) {
			DerivedValuesSetter derivedValuesSetter = null;
			try {
				derivedValuesSetter = derivedValuesSetterClass.newInstance();
			}

			catch (Exception e) {
				LOG.error("Unable to instantiate class " + derivedValuesSetterClass.getName(), e);
				throw new RuntimeException("Unable to instantiate class " + derivedValuesSetterClass.getName(), e);
			}
			derivedValuesSetter.setDerivedValues(this, request);
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:KualiDocumentFormBase.java

示例3: start

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
   * Gets an inquirable impl from the impl service name parameter. Then calls lookup service to retrieve the record from the
   * key/value parameters. Finally gets a list of Rows from the inquirable
   */
  public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
      InquiryForm inquiryForm = (InquiryForm) form;
      if (inquiryForm.getBusinessObjectClassName() == null) {
          LOG.error("Business object name not given.");
          throw new RuntimeException("Business object name not given.");
      }
      
      Class boClass = Class.forName(inquiryForm.getBusinessObjectClassName());
      ModuleService responsibleModuleService = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(boClass);
if(responsibleModuleService!=null && responsibleModuleService.isExternalizable(boClass)){
	String redirectUrl = responsibleModuleService.getExternalizableBusinessObjectInquiryUrl(boClass, (Map<String, String[]>) request.getParameterMap());
	ActionForward redirectingActionForward = new RedirectingActionForward(redirectUrl);
	redirectingActionForward.setModule("/");
	return redirectingActionForward;
}

return continueWithInquiry(mapping, form, request, response);
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:KualiInquiryAction.java

示例4: processAfterCopy

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
	 * Set the new collection records back to true so they can be deleted (copy
	 * should act like new)
	 *
	 * @see KualiMaintainableImpl#processAfterCopy()
	 */
	@Override
	public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
		try {
			// This was the only remaining use of this method, as the operation with the wrapper
			// below is not necessarily safe to use in all situations, I am calling it here
			// from within the document code where we know it's safe:
			
			KradDataServiceLocator.getDataObjectService().wrap(businessObject).materializeReferencedObjectsToDepth(2
					, MaterializeOption.COLLECTIONS, MaterializeOption.UPDATE_UPDATABLE_REFS);
			
			KRADServiceLocatorWeb.getLegacyDataAdapter().setObjectPropertyDeep(businessObject, KRADPropertyConstants.NEW_COLLECTION_RECORD,
					boolean.class, true);
//			ObjectUtils.setObjectPropertyDeep(businessObject, KRADPropertyConstants.NEW_COLLECTION_RECORD,
//					boolean.class, true, 2);
		} catch (Exception e) {
			LOG.error("unable to set newCollectionRecord property: " + e.getMessage(), e);
			throw new RuntimeException("unable to set newCollectionRecord property: " + e.getMessage(), e);
		}
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:KualiMaintainableImpl.java

示例5: getValidationMessageParams

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * This overridden method ...
 *
 * @see org.kuali.rice.krad.datadictionary.validation.constraint.ValidDataPatternConstraint#getValidationMessageParams()
 */
@Override
public List<String> getValidationMessageParams() {
    if (validationMessageParams == null) {
        validationMessageParams = new ArrayList<String>();
        MessageService messageService = KRADServiceLocatorWeb.getMessageService();
        if (allowNegative) {
            validationMessageParams.add(messageService.getMessageText(
                    UifConstants.Messages.VALIDATION_MSG_KEY_PREFIX + "positiveOrNegative"));
        } else {
            validationMessageParams.add(messageService.getMessageText(
                    UifConstants.Messages.VALIDATION_MSG_KEY_PREFIX + "positiveOrZero"));
        }

        validationMessageParams.add(Integer.toString(precision));
        validationMessageParams.add(Integer.toString(scale));
    }
    return validationMessageParams;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:FixedPointPatternConstraint.java

示例6: buildKeyMapFromRequest

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * Gets keys for the maintainable business object from the persistence metadata explorer. Checks for existence of key property
 * names as request parameters, if found adds them to the returned hash map.
 */
   protected Map buildKeyMapFromRequest(Maintainable maintainable, HttpServletRequest request) {
	List keyFieldNames = null;
	// are override keys listed in the request? If so, then those need to be our keys,
	// not the primary keye fields for the BO
	if (!StringUtils.isBlank(request.getParameter(KRADConstants.OVERRIDE_KEYS))) {
		String[] overrideKeys = request.getParameter(KRADConstants.OVERRIDE_KEYS).split(KRADConstants.FIELD_CONVERSIONS_SEPARATOR);
		keyFieldNames = new ArrayList();
		for (String overrideKey : overrideKeys) {
			keyFieldNames.add(overrideKey);
		}
	}
	else {
		keyFieldNames = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(maintainable.getBusinessObject().getClass());
	}
	return getRequestParameters(keyFieldNames, maintainable, request);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:KualiMaintenanceDocumentAction.java

示例7: getPartiallyMaskedValue

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
public static String getPartiallyMaskedValue(String className, String fieldName, Object formObject,
		String propertyName) {
	String displayMaskValue = null;
	Object propertyValue = ObjectUtils.getPropertyValue(formObject, propertyName);

	DataDictionaryEntryBase entry = (DataDictionaryEntryBase) KRADServiceLocatorWeb.getDataDictionaryService()
			.getDataDictionary().getDictionaryObjectEntry(className);
	AttributeDefinition a = entry.getAttributeDefinition(fieldName);

	AttributeSecurity attributeSecurity = a.getAttributeSecurity();
	if (attributeSecurity != null && attributeSecurity.isPartialMask()) {
		MaskFormatter partialMaskFormatter = attributeSecurity.getPartialMaskFormatter();
		displayMaskValue = partialMaskFormatter.maskValue(propertyValue);

	}
	return displayMaskValue;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:WebUtils.java

示例8: processInactivationBlockChecking

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * Given a InactivationBlockingMetadata, which represents a relationship that may block inactivation of a BO, it
 * determines whether there
 * is a record that violates the blocking definition
 *
 * @param maintenanceDocument
 * @param inactivationBlockingMetadata
 * @return true iff, based on the InactivationBlockingMetadata, the maintenance document should be allowed to route
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument,
        InactivationBlockingMetadata inactivationBlockingMetadata) {
    String inactivationBlockingDetectionServiceBeanName =
            inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
    if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
        inactivationBlockingDetectionServiceBeanName =
                KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
    }
    InactivationBlockingDetectionService inactivationBlockingDetectionService =
            KRADServiceLocatorWeb.getInactivationBlockingDetectionService(
                    inactivationBlockingDetectionServiceBeanName);

    boolean foundBlockingRecord = inactivationBlockingDetectionService.detectBlockingRecord(
            newDataObject, inactivationBlockingMetadata);

    if (foundBlockingRecord) {
        putInactivationBlockingErrorOnPage(maintenanceDocument, inactivationBlockingMetadata);
    }

    return !foundBlockingRecord;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:MaintenanceDocumentRuleBase.java

示例9: isDocumentSession

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
public static boolean isDocumentSession(Document document, PojoFormBase docForm) {
	boolean sessionDoc = document instanceof org.kuali.rice.krad.document.SessionDocument;
	boolean dataDictionarySessionDoc = false;
	if (!sessionDoc) {
		DataDictionary dataDictionary = KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary();
		if (docForm instanceof KualiMaintenanceForm) {
			KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) docForm;
			if (dataDictionary != null) {
				if (maintenanceForm.getDocTypeName() != null) {
                       MaintenanceDocumentEntry maintenanceDocumentEntry = (MaintenanceDocumentEntry) dataDictionary.getDocumentEntry(maintenanceForm.getDocTypeName());
					dataDictionarySessionDoc = maintenanceDocumentEntry.isSessionDocument();
				}
			}
		}
		else {
			if (document != null && dataDictionary != null) {
				KNSDocumentEntry documentEntry = (KNSDocumentEntry) dataDictionary.getDocumentEntry(document.getClass().getName());
				dataDictionarySessionDoc = documentEntry.isSessionDocument();
			}
		}
	}
	return sessionDoc || dataDictionarySessionDoc;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:WebUtils.java

示例10: getDocumentEntryForView

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * Overrides to retrieve the a {@link MaintenanceDocumentEntry} based on the configured data object class
 *
 * @return MaintenanceDocumentEntry document entry (exception thrown if not found)
 */
@Override
protected MaintenanceDocumentEntry getDocumentEntryForView() {
    MaintenanceDocumentEntry documentEntry = null;
    String docTypeName = KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentTypeName(
            getDataObjectClassName());
    if (StringUtils.isNotBlank(docTypeName)) {
        documentEntry = KRADServiceLocatorWeb.getDocumentDictionaryService().getMaintenanceDocumentEntry(
                docTypeName);
    }

    if (documentEntry == null) {
        throw new RuntimeException(
                "Unable to find maintenance document entry for data object class: " + getDataObjectClassName()
                        .getName());
    }

    return documentEntry;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:MaintenanceDocumentView.java

示例11: getDataObjectEntry

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.datadictionary.DataDictionaryMapper#getDataObjectEntry(org.kuali.rice.krad.datadictionary.DataDictionaryIndex,
 *      java.lang.String)
 */
@Override
public DataObjectEntry getDataObjectEntry(DataDictionaryIndex index, String className) {
    DataObjectEntry entry = getDataObjectEntryForConcreteClass(index, className);

    if (entry == null) {
        Class<?> boClass = null;
        try {
            boClass = Class.forName(className);
            ModuleService responsibleModuleService =
                    KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(boClass);
            if (responsibleModuleService != null && responsibleModuleService.isExternalizable(boClass)) {
                entry = responsibleModuleService.getExternalizableBusinessObjectDictionaryEntry(boClass);
            }
        } catch (ClassNotFoundException cnfex) {
            // swallow so we can return null
        }
    }

    return entry;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:DataDictionaryIndexMapper.java

示例12: hasAutoQuickfinderRelationship

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * Determines wheter or not to create an automatic quickfinder widget for this field within the current lifecycle.
 *
 * @return True if an automatic quickfinder widget should be created for this field on the current lifecycle.
 */
protected boolean hasAutoQuickfinderRelationship() {
    String propertyName = getBindingInfo().getBindingName();

    // get object instance and class for parent
    View view = ViewLifecycle.getView();
    Object model = ViewLifecycle.getModel();
    Object parentObject = ViewModelUtils.getParentObjectForMetadata(view, model, this);
    Class<?> parentObjectClass = null;
    if (parentObject != null) {
        parentObjectClass = parentObject.getClass();
    }

    // get relationship from metadata service
    @SuppressWarnings("deprecation")
    DataObjectRelationship relationship = null;
    if (parentObject != null) {
        relationship = KRADServiceLocatorWeb.getLegacyDataAdapter().getDataObjectRelationship(parentObject,
                parentObjectClass, propertyName, "", true, true, false);
    }

    return relationship != null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:InputFieldBase.java

示例13: validateBusinessRules

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
@Override
public void validateBusinessRules(DocumentEvent event) {
    if (GlobalVariables.getMessageMap().hasErrors()) {
        logErrors();
        throw new ValidationException("errors occured before business rule");
    }

    // perform validation against rules engine
    LOG.info("invoking rules engine on document " + getDocumentNumber());
    boolean isValid = true;
    isValid = KRADServiceLocatorWeb.getKualiRuleService().applyRules(event);

    // check to see if the br eval passed or failed
    if (!isValid) {
        logErrors();
        // TODO: better error handling at the lower level and a better error message are
        // needed here
        throw new ValidationException("business rule evaluation failed");
    } else if (GlobalVariables.getMessageMap().hasErrors()) {
        logErrors();
        throw new ValidationException(
                "Unreported errors occured during business rule evaluation (rule developer needs to put meaningful error messages into global ErrorMap)");
    }
    LOG.debug("validation completed");

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:DocumentBase.java

示例14: processInactivationBlockChecking

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
/**
 * Given a InactivationBlockingMetadata, which represents a relationship that may block inactivation of a BO, it
 * determines whether there
 * is a record that violates the blocking definition
 *
 * @param maintenanceDocument
 * @param inactivationBlockingMetadata
 * @return true iff, based on the InactivationBlockingMetadata, the maintenance document should be allowed to route
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument,
        InactivationBlockingMetadata inactivationBlockingMetadata) {
    if (newBo instanceof PersistableBusinessObject) {
        String inactivationBlockingDetectionServiceBeanName =
                inactivationBlockingMetadata.getInactivationBlockingDetectionServiceBeanName();
        if (StringUtils.isBlank(inactivationBlockingDetectionServiceBeanName)) {
            inactivationBlockingDetectionServiceBeanName =
                    KRADServiceLocatorWeb.DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE;
        }
        InactivationBlockingDetectionService inactivationBlockingDetectionService = KRADServiceLocatorWeb
                .getInactivationBlockingDetectionService(inactivationBlockingDetectionServiceBeanName);

        boolean foundBlockingRecord = inactivationBlockingDetectionService
                .hasABlockingRecord((PersistableBusinessObject) newBo, inactivationBlockingMetadata);

        if (foundBlockingRecord) {
            putInactivationBlockingErrorOnPage(maintenanceDocument, inactivationBlockingMetadata);
        }

        return !foundBlockingRecord;
    }

    return true;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:MaintenanceDocumentRuleBase.java

示例15: recallDocument

import org.kuali.rice.krad.service.KRADServiceLocatorWeb; //导入依赖的package包/类
@Override
public Document recallDocument(Document document, String annotation, boolean cancel) throws WorkflowException {
    checkForNulls(document);
    WorkflowDocument workflowDocument = KRADServiceLocatorWeb.getDocumentService().
            getByDocumentHeaderId(document.getDocumentNumber()).getDocumentHeader().getWorkflowDocument();

    if (!workflowDocument.isFinal() && !workflowDocument.isProcessed()) {
        Note note = createNoteFromDocument(document, annotation);
        document.addNote(note);
        getNoteService().save(note);
    }

    prepareWorkflowDocument(document);
    getWorkflowDocumentService().recall(document.getDocumentHeader().getWorkflowDocument(), annotation, cancel);
    UserSessionUtils.addWorkflowDocument(GlobalVariables.getUserSession(),
            document.getDocumentHeader().getWorkflowDocument());
    removeAdHocPersonsAndWorkgroups(document);
    return document;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:DocumentServiceImpl.java


注:本文中的org.kuali.rice.krad.service.KRADServiceLocatorWeb类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。