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


Java KRADConstants类代码示例

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


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

示例1: returnToSender

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * If the given form has returnToActionList set to true, this method returns an ActionForward that should take the user back to
 * their action list; otherwise, it returns them to the portal.
 *
 * @param form
 * @return
 */
protected ActionForward returnToSender(HttpServletRequest request, ActionMapping mapping, KualiDocumentFormBase form) {
    final ActionForward dest;
    if (form.isReturnToActionList()) {
        String workflowBase = getKualiConfigurationService().getPropertyValueAsString(
                KRADConstants.WORKFLOW_URL_KEY);
        String actionListUrl = workflowBase + "/ActionList.do";

        dest = new ActionForward(actionListUrl, true);
    } else if (StringUtils.isNotBlank(form.getBackLocation())) {
        dest = new ActionForward(form.getBackLocation(), true);
    } else {
        dest = new ActionForward("/portal.do", true);
    }

    setupDocumentExit();
    return dest;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:KualiDocumentActionBase.java

示例2: populateExportCapabilities

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * Examines the BusinessObject's data dictionary entry to determine if it supports
 * XML export or not and set's canExport appropriately.
 */
protected void populateExportCapabilities(HttpServletRequest request, String boClassName) {
	setCanExport(false);
	BusinessObjectEntry businessObjectEntry = (BusinessObjectEntry) KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(boClassName);
	Class<? extends Exporter> exporterClass = businessObjectEntry.getExporterClass();
	if (exporterClass != null) {
		try {
			Exporter exporter = exporterClass.newInstance();
			if (exporter.getSupportedFormats(businessObjectEntry.getBusinessObjectClass()).contains(KRADConstants.XML_FORMAT)) {
				setCanExport(true);
			}
		} catch (Exception e) {
			LOG.error("Failed to locate or create exporter class: " + exporterClass, e);
			throw new RuntimeException("Failed to locate or create exporter class: " + exporterClass);
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:InquiryForm.java

示例3: getByDocumentHeaderIdSessionless

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DocumentService#getByDocumentHeaderIdSessionless(java.lang.String)
 */
@Override
public Document getByDocumentHeaderIdSessionless(String documentHeaderId) throws WorkflowException {
    if (documentHeaderId == null) {
        throw new IllegalArgumentException("invalid (null) documentHeaderId");
    }

    WorkflowDocument workflowDocument = null;

    if (LOG.isDebugEnabled()) {
        LOG.debug("Retrieving doc id: " + documentHeaderId + " from workflow service.");
    }

    Person person = getPersonService().getPersonByPrincipalName(KRADConstants.SYSTEM_USER);
    workflowDocument = workflowDocumentService.loadWorkflowDocument(documentHeaderId, person);

    Class<? extends Document> documentClass = getDocumentClassByTypeName(workflowDocument.getDocumentTypeName());

    // retrieve the Document
    Document document = getLegacyDataAdapter().findByDocumentHeaderId(documentClass, documentHeaderId);

    return postProcessDocument(documentHeaderId, workflowDocument, document);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:DocumentServiceImpl.java

示例4: getComponentForBean

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * Retrieves the component code associated with the bean definition
 *
 * @param beanName name of the bean to find component code for
 * @param beanDefinition bean definition to find component code for
 * @return String component code for bean or null if a component code was not found
 */
protected String getComponentForBean(String beanName, BeanDefinition beanDefinition) {
    String componentCode = null;

    MutablePropertyValues pvs = beanDefinition.getPropertyValues();
    if (pvs.contains(KRADPropertyConstants.COMPONENT_CODE)) {
        PropertyValue propertyValue = pvs.getPropertyValue(KRADPropertyConstants.COMPONENT_CODE);

        componentCode = getStringValue(propertyValue.getValue());
    }

    if ((componentCode == null) && StringUtils.isNotBlank(beanName) && !isGeneratedBeanName(beanName)) {
        componentCode = beanName;
    }

    if (StringUtils.isNotBlank(componentCode)) {
        componentCode = StringUtils.removeEnd(componentCode, KRADConstants.DICTIONARY_BEAN_PARENT_SUFFIX);
    }

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

示例5: moduleLocked

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * Retrieves the module locked message test from a system parameter and then returns the message view
 */
@MethodAccessible
@RequestMapping(value = "/module-locked")
public ModelAndView moduleLocked(@ModelAttribute("KualiForm") UifFormBase form,
        @RequestParam(value = MODULE_PARAMETER, required = true) String moduleNamespaceCode) {
    ParameterService parameterSerivce = CoreFrameworkServiceLocator.getParameterService();
    
    String messageParamComponentCode = KRADConstants.DetailTypes.ALL_DETAIL_TYPE;
    String messageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_MESSAGE_PARM;
    String lockoutMessage = parameterSerivce.getParameterValueAsString(moduleNamespaceCode,
            messageParamComponentCode, messageParamName);

    if (StringUtils.isBlank(lockoutMessage)) {
        String defaultMessageParamName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_DEFAULT_MESSAGE;
        lockoutMessage = parameterSerivce.getParameterValueAsString(KRADConstants.KNS_NAMESPACE,
                messageParamComponentCode, defaultMessageParamName);
    }
    
    return getMessageView(form, "Module Locked", lockoutMessage);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:ModuleLockedController.java

示例6: isLocked

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * This method determines whether or not this module is currently locked
 *
 * @see org.kuali.rice.krad.service.ModuleService#isLocked()
 */
@Override
public boolean isLocked() {
    ModuleConfiguration configuration = this.getModuleConfiguration();
    if (configuration != null) {
        String namespaceCode = configuration.getNamespaceCode();
        String componentCode = KRADConstants.DetailTypes.ALL_DETAIL_TYPE;
        String parameterName = KRADConstants.SystemGroupParameterNames.OLTP_LOCKOUT_ACTIVE_IND;
        ParameterService parameterService = CoreFrameworkServiceLocator.getParameterService();
        String shouldLockout = parameterService.getParameterValueAsString(namespaceCode, componentCode,
                parameterName);
        if (StringUtils.isNotBlank(shouldLockout)) {
            return parameterService.getParameterValueAsBoolean(namespaceCode, componentCode, parameterName);
        }
    }
    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RemoteModuleServiceBase.java

示例7: checkSensitiveDataAndWarningDialog

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * Helper method to check if sensitive data is present in a given string and dialog display.
 *
 * <p>If the string is sensitive we want to return a dialog box to make sure user wants to continue,
 * else we just return null</p>
 *
 * @param field the string to check for sensitive data
 * @param form the form to add the dialog to
 * @return the model and view for the dialog or null if there isn't one
 */
protected ModelAndView checkSensitiveDataAndWarningDialog(String field, UifFormBase form) {
    boolean hasSensitiveData = KRADUtils.containsSensitiveDataPatternMatch(field);
    Boolean warnForSensitiveData = getParameterService().getParameterValueAsBoolean(KRADConstants.KNS_NAMESPACE,
            ParameterConstants.ALL_COMPONENT,
            KRADConstants.SystemGroupParameterNames.SENSITIVE_DATA_PATTERNS_WARNING_IND);

    // if there is sensitive data and the flag to warn for sensitive data is set,
    // then we want a dialog returned if there is not already one
    if (hasSensitiveData && warnForSensitiveData.booleanValue()) {
        DialogResponse sensitiveDataDialogResponse = form.getDialogResponse(SENSITIVE_DATA_DIALOG);

        if (sensitiveDataDialogResponse == null) {
            // no sensitive data dialog found, so create one on the form and return it
            return getModelAndViewService().showDialog(SENSITIVE_DATA_DIALOG, true, form);
        }
    }

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

示例8: getRecordsPerPage

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
public int getRecordsPerPage() {
	if ( recordsPerPage == -1 ) {
		Parameter param = CoreFrameworkServiceLocator.getParameterService().getParameter(KimConstants.NAMESPACE_CODE, KRADConstants.DetailTypes.DOCUMENT_DETAIL_TYPE, MAX_MEMBERS_PER_PAGE_PARM);
		if ( param != null ) {
			try {
				recordsPerPage = Integer.parseInt( param.getValue() );
			} catch ( NumberFormatException ex ) {
				LOG.error( "Unable to parse parameter " + KimConstants.NAMESPACE_CODE+"/"+ KRADConstants.DetailTypes.DOCUMENT_DETAIL_TYPE+"/"+MAX_MEMBERS_PER_PAGE_PARM + "(+"+param.getValue()+") as an int - defaulting to 1." );
				recordsPerPage = 1;
			}
		} else {
			LOG.error( "Unable to find " + KimConstants.NAMESPACE_CODE+"/"+ KRADConstants.DetailTypes.DOCUMENT_DETAIL_TYPE+"/"+MAX_MEMBERS_PER_PAGE_PARM + " - defaulting to 1." );
			recordsPerPage = 1;
		}
	}
	return recordsPerPage;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:IdentityManagementDocumentFormBase.java

示例9: considerInquiryOrMaintenanceDocumentAuthorizer

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
protected void considerInquiryOrMaintenanceDocumentAuthorizer(
		InquiryOrMaintenanceDocumentAuthorizer authorizer,
		Object businessObject, Person user,
		InquiryOrMaintenanceDocumentRestrictions restrictions) {
	for (String sectionId : authorizer
			.getSecurePotentiallyHiddenSectionIds()) {
		Map<String, String> additionalPermissionDetails = new HashMap<String, String>();
		additionalPermissionDetails
				.put(KimConstants.AttributeConstants.SECTION_ID, sectionId);
		if (!authorizer.isAuthorizedByTemplate(businessObject,
				KRADConstants.KNS_NAMESPACE,
				KimConstants.PermissionTemplateNames.VIEW_SECTION, user
						.getPrincipalId(), additionalPermissionDetails,
				null)) {
			restrictions.addHiddenSectionId(sectionId);
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:BusinessObjectAuthorizationServiceImpl.java

示例10: addRequiredNonEditableProperties

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * @see KualiForm#addRequiredNonEditableProperties()
 */
public void addRequiredNonEditableProperties(){
	super.addRequiredNonEditableProperties();
	registerRequiredNonEditableProperty(KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME);
	registerRequiredNonEditableProperty(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE);
	registerRequiredNonEditableProperty(KRADConstants.DISPATCH_REQUEST_PARAMETER);
	registerRequiredNonEditableProperty(KRADConstants.DOC_FORM_KEY);
	registerRequiredNonEditableProperty(KRADConstants.REFRESH_CALLER);
	registerRequiredNonEditableProperty(KRADConstants.DOC_NUM);
	registerRequiredNonEditableProperty(KRADConstants.REFERENCES_TO_REFRESH);
	registerRequiredNonEditableProperty(KRADConstants.FORM_KEY);
	registerRequiredNonEditableProperty(KRADConstants.CONVERSION_FIELDS_PARAMETER);
	registerRequiredNonEditableProperty(KRADConstants.FIELDS_CONVERSION_PARAMETER);
	registerRequiredNonEditableProperty(KRADConstants.HIDE_LOOKUP_RETURN_LINK);
	registerRequiredNonEditableProperty(KRADConstants.MULTIPLE_VALUE);
	registerRequiredNonEditableProperty(KRADConstants.BACK_LOCATION);
	registerRequiredNonEditableProperty(KRADConstants.LOOKUP_ANCHOR);
	registerRequiredNonEditableProperty("searchUsingOnlyPrimaryKeyValues");
	registerRequiredNonEditableProperty(KRADConstants.MULTIPLE_VALUE_LOOKUP_PREVIOUSLY_SELECTED_OBJ_IDS_PARAM);
	registerRequiredNonEditableProperty(KRADConstants.TableRenderConstants.VIEWED_PAGE_NUMBER);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:LookupForm.java

示例11: getMaintenanceActionUrl

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的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

示例12: shouldPropertyBePopulatedInForm

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * This overridden method ...
 * 
 * @see KualiDocumentFormBase#shouldPropertyBePopulatedInForm(java.lang.String, javax.servlet.http.HttpServletRequest)
 */
@Override
public boolean shouldPropertyBePopulatedInForm(
		String requestParameterName, HttpServletRequest request) {
	// the user clicked on a document initiation link
	//add delete check for 3070
	String methodToCallActionName = request.getParameter(KRADConstants.DISPATCH_REQUEST_PARAMETER);
	if (StringUtils.equals(methodToCallActionName, KRADConstants.MAINTENANCE_COPY_METHOD_TO_CALL) ||
			StringUtils.equals(methodToCallActionName, KRADConstants.MAINTENANCE_EDIT_METHOD_TO_CALL) ||
			StringUtils.equals(methodToCallActionName, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL) ||
			StringUtils.equals(methodToCallActionName, KRADConstants.MAINTENANCE_NEWWITHEXISTING_ACTION) ||
			StringUtils.equals(methodToCallActionName, KRADConstants.MAINTENANCE_DELETE_METHOD_TO_CALL)) {
		return true;
	}
	if ( StringUtils.indexOf(methodToCallActionName, KRADConstants.TOGGLE_INACTIVE_METHOD ) == 0 ) {
		return true;
	}
	return super.shouldPropertyBePopulatedInForm(requestParameterName, request);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:KualiMaintenanceForm.java

示例13: processErrorMessages

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * This method handles processing any error messages coming in the door.
 *
 * @param request
 */
private void processErrorMessages(HttpServletRequest request) {
    String errorKey = request.getParameter(KRADConstants.QUESTION_ERROR_KEY);
    String errorPropertyName = request.getParameter(KRADConstants.QUESTION_ERROR_PROPERTY_NAME);
    String errorParameter = request.getParameter(KRADConstants.QUESTION_ERROR_PARAMETER);

    if (StringUtils.isNotBlank(errorKey)) {
        if (StringUtils.isBlank(errorPropertyName)) {
            throw new IllegalStateException("Both the errorKey and the errorPropertyName must be filled in, " + "in order for errors to be displayed by the question component.  Currently, " + "only the errorKey has a value specified.");
        }
        else {
            if (StringUtils.isBlank(errorParameter)) {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPropertyName, errorKey);
            }
            else {
                GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(errorPropertyName, errorKey, errorParameter);
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:QuestionPromptAction.java

示例14: generateNotifications

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
public List<ActionRequestValue> generateNotifications(List requests, PrincipalContract principal, Recipient delegator,
        String notificationRequestCode, String actionTakenCode)
{
    String groupName =  CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(KewApiConstants.KEW_NAMESPACE,
            KRADConstants.DetailTypes.WORKGROUP_DETAIL_TYPE,
            KewApiConstants.NOTIFICATION_EXCLUDED_USERS_WORKGROUP_NAME_IND);
    
    
    Group notifyExclusionWorkgroup = null;
    if(!StringUtils.isBlank(groupName)){
    	notifyExclusionWorkgroup = getGroupService().getGroupByNamespaceCodeAndName(
                Utilities.parseGroupNamespaceCode(groupName), Utilities.parseGroupName(groupName));
    }
    
 
    
    return generateNotifications(null, getActionRequestService().getRootRequests(requests), principal, delegator, notificationRequestCode, actionTakenCode, notifyExclusionWorkgroup);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:ActionRequestFactory.java

示例15: performApplyModel

import org.kuali.rice.krad.util.KRADConstants; //导入依赖的package包/类
/**
 * Sets up rich message content for the label, if any exists
 *
 * {@inheritDoc}
 */
@Override
public void performApplyModel(Object model, LifecycleElement parent) {
    super.performApplyModel(model, parent);

    if (richHeaderMessage == null && headerText != null && headerText.contains(
            KRADConstants.MessageParsing.LEFT_TOKEN) && headerText.contains(
            KRADConstants.MessageParsing.RIGHT_TOKEN)) {
        Message message = ComponentFactory.getMessage();
        message.setMessageText(headerText);
        message.setInlineComponents(inlineComponents);
        message.setRenderWrapperTag(false);
        
        this.setRichHeaderMessage(message);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:Header.java


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