本文整理汇总了Java中org.kuali.rice.coreservice.api.parameter.Parameter.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java Parameter.Builder方法的具体用法?Java Parameter.Builder怎么用?Java Parameter.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.coreservice.api.parameter.Parameter
的用法示例。
在下文中一共展示了Parameter.Builder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
@RequestMapping(params = "methodToCall=update")
public ModelAndView update(@ModelAttribute("KualiForm") UifFormBase form) {
ParameterForm parameterForm = (ParameterForm) form;
String applicationId = KRADConstants.DEFAULT_PARAMETER_APPLICATION_ID;
String namespaceCode = parameterForm.getNamespaceCode();
String componentCode = parameterForm.getComponentCode();
String parameterName = parameterForm.getParameterName();
Parameter parameter = null;
if (StringUtils.isNotBlank(applicationId) && StringUtils.isNotBlank(namespaceCode)
&& StringUtils.isNotBlank(componentCode) && StringUtils.isNotBlank(parameterName)) {
ParameterKey key = ParameterKey.create(applicationId, namespaceCode, componentCode, parameterName);
parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(key);
}
if (parameter != null) {
Parameter.Builder builder = Parameter.Builder.create(parameter);
builder.setValue(parameterForm.getParameterValue());
CoreServiceApiServiceLocator.getParameterRepositoryService().updateParameter(builder.build());
}
return getModelAndView(form);
}
示例2: updateParameter
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
@Override
@Transactional
public Parameter updateParameter(Parameter parameter) {
if (parameter == null) {
throw new RiceIllegalArgumentException("parameter is null");
}
final ParameterKey key = ParameterKey.create(parameter.getApplicationId(), parameter.getNamespaceCode(), parameter.getComponentCode(), parameter.getName());
final Parameter existing = getParameter(key);
if (existing == null) {
throw new RiceIllegalStateException("the parameter does not exist: " + parameter);
}
final Parameter toUpdate;
if (!existing.getApplicationId().equals(parameter.getApplicationId())) {
final Parameter.Builder builder = Parameter.Builder.create(parameter);
builder.setApplicationId(existing.getApplicationId());
toUpdate = builder.build();
} else {
toUpdate = parameter;
}
return ParameterBo.to(getDataObjectService().save(ParameterBo.from(toUpdate)));
}
示例3: lockUnlockDocuments
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
private void lockUnlockDocuments(boolean locked) {
for (String documentType : lockedDocuments) {
Class<? extends Document> documentClass = dataDictionaryService.getDocumentClassByTypeName(documentType);
if (parameterService.parameterExists(documentClass, OLEConstants.DOCUMENT_LOCKOUT_PARM_NM)) {
Parameter existingParam = parameterService.getParameter(documentClass, OLEConstants.DOCUMENT_LOCKOUT_PARM_NM);
Parameter.Builder updatedParam = Builder.create(existingParam);
updatedParam.setValue(locked ? "Y" : "N");
parameterService.updateParameter(updatedParam.build());
} else {
String namespace = KRADServiceLocatorWeb.getKualiModuleService().getNamespaceCode(documentClass);
String detailType = KRADServiceLocatorWeb.getKualiModuleService().getComponentCode(documentClass);
Parameter.Builder newParam = Builder.create(OLEConstants.APPLICATION_NAMESPACE_CODE, namespace, detailType, OLEConstants.DOCUMENT_LOCKOUT_PARM_NM, ParameterType.Builder.create(OleParameterConstants.PARAMETER_CONFIG_TYPE_CODE));
newParam.setValue("Y");
newParam.setDescription(OLEConstants.DOCUMENT_LOCKOUT_PARM_DESC);
parameterService.createParameter(newParam.build());
}
}
}
示例4: loadDefaultIngestProfile
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
public List<String> loadDefaultIngestProfile( boolean forceLoad ) throws Exception {
if ( forceLoad || parameterService.getParameterValueAsBoolean(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_INGEST_POLICIES_IND, Boolean.TRUE) ) {
LOG.info("Starting Load of Default Ingest Profiles");
URL resource = getClass().getResource(fileName);
File file = new File(resource.toURI());
String fileContent = new FileUtil().readFile(file);
List<String> policies= oleKrmsBuilder.persistKrmsFromFileContent(fileContent);
LOG.info("Completed Load of Default Ingest Profiles");
Parameter existingParameter = parameterService.getParameter(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_INGEST_POLICIES_IND);
if ( existingParameter != null ) {
Parameter.Builder updatedParameter = Parameter.Builder.create(existingParameter);
updatedParameter.setValue("N");
parameterService.updateParameter(updatedParameter.build());
} else {
Parameter.Builder newParameter = Parameter.Builder.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_INGEST_POLICIES_IND, ParameterType.Builder.create("CONFG"));
newParameter.setDescription( "Set to 'Y' to have the application ingest the default circulation policies upon next startup." );
newParameter.setValue("N");
parameterService.createParameter(newParameter.build());
}
return policies;
}
return Collections.emptyList();
}
示例5: loadDefaultLocations
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
public void loadDefaultLocations(boolean forceLoad) throws Exception {
if (forceLoad || parameterService.getParameterValueAsBoolean(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LOCATIONS_IND, Boolean.TRUE)) {
LOG.info("Starting Load of Default Locations");
for (int i = 0; i < locationFiles.size(); i++) {
fileName = this.locationFiles.get(i);
URL resource = getClass().getResource(fileName);
File file = new File(resource.toURI());
String fileContent = new FileUtil().readFile(file);
oleLocationIngestService.persistLocationFromFileContent(fileContent, file.getName());
LOG.info("Completed Load of Default Locations");
Parameter existingParameter = parameterService.getParameter(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LOCATIONS_IND);
if (existingParameter != null) {
Parameter.Builder updatedParameter = Parameter.Builder.create(existingParameter);
updatedParameter.setValue("N");
parameterService.updateParameter(updatedParameter.build());
} else {
Parameter.Builder newParameter = Parameter.Builder.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LOCATIONS_IND, ParameterType.Builder.create("CONFG"));
newParameter.setDescription("Set to 'Y' to have the application ingest the default circulation policies upon next startup.");
newParameter.setValue("N");
parameterService.createParameter(newParameter.build());
}
}
}
}
示例6: lockUnlockDocuments
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
private void lockUnlockDocuments(boolean locked) {
for(String documentType : lockedDocuments) {
Class<? extends Document> documentClass = dataDictionaryService.getDocumentClassByTypeName(documentType);
if(parameterService.parameterExists(documentClass , KFSConstants.DOCUMENT_LOCKOUT_PARM_NM)) {
Parameter existingParam = parameterService.getParameter( documentClass, KFSConstants.DOCUMENT_LOCKOUT_PARM_NM );
Parameter.Builder updatedParam = Builder.create(existingParam);
updatedParam.setValue( locked?"Y":"N" );
parameterService.updateParameter(updatedParam.build());
} else {
String namespace = KRADServiceLocatorWeb.getKualiModuleService().getNamespaceCode(documentClass);
String detailType = KRADServiceLocatorWeb.getKualiModuleService().getComponentCode(documentClass);
Parameter.Builder newParam = Builder.create(KFSConstants.APPLICATION_NAMESPACE_CODE, namespace, detailType, KFSConstants.DOCUMENT_LOCKOUT_PARM_NM, ParameterType.Builder.create(KfsParameterConstants.PARAMETER_CONFIG_TYPE_CODE) );
newParam.setValue("Y");
newParam.setDescription(KFSConstants.DOCUMENT_LOCKOUT_PARM_DESC);
parameterService.createParameter(newParam.build());
}
}
}
示例7: setInitiatedParameter
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
/**
* This method sets a parameter that tells the step that it has already run and it does not need to run again.
*/
private void setInitiatedParameter() {
// first see if we can find an existing Parameter object with this key
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
Parameter runIndicatorParameter = parameterService.getParameter(GenesisBatchStep.class, Job.STEP_RUN_PARM_NM);
if (runIndicatorParameter == null) {
Parameter.Builder newParameter = Builder.create(RUN_INDICATOR_PARAMETER_APPLICATION_NAMESPACE_CODE, RUN_INDICATOR_PARAMETER_NAMESPACE_CODE, RUN_INDICATOR_PARAMETER_NAMESPACE_STEP, Job.STEP_RUN_PARM_NM, ParameterType.Builder.create(RUN_INDICATOR_PARAMETER_TYPE));
newParameter.setValue(RUN_INDICATOR_PARAMETER_VALUE);
newParameter.setEvaluationOperator( EvaluationOperator.ALLOW );
newParameter.setDescription(RUN_INDICATOR_PARAMETER_DESCRIPTION);
parameterService.createParameter(newParameter.build());
} else {
Parameter.Builder updatedParameter = Parameter.Builder.create(runIndicatorParameter);
updatedParameter.setValue(GenesisBatchStep.RUN_INDICATOR_PARAMETER_VALUE);
parameterService.updateParameter(updatedParameter.build());
}
}
示例8: publishDocHandlerUrlPrefix
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
@Override
public void publishDocHandlerUrlPrefix() {
ParameterType.Builder parameterType = ParameterType.Builder.create(parameterTypeCode);
Parameter.Builder parameter = Parameter.Builder.create(parameterApplicationId, parameterNamespaceCode, parameterComponentCode, parameterName, parameterType);
parameter.setDescription("KPME docHandler Prefix");
parameter.setValue(parameterValue);
parameter.setEvaluationOperator(EvaluationOperator.ALLOW);
Parameter existingParameter = parameterService.getParameter(parameterNamespaceCode, parameterComponentCode, parameterName);
if (existingParameter == null) {
parameterService.createParameter(parameter.build());
} else if(!StringUtils.equals(existingParameter.getValue(), parameterValue)) {
parameter.setObjectId(existingParameter.getObjectId());
parameter.setVersionNumber(existingParameter.getVersionNumber());
parameterService.updateParameter(parameter.build());
}
}
示例9: setKimPriorityOnDocumentTypeParameterValue
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
protected void setKimPriorityOnDocumentTypeParameterValue(String parameterValue) {
if(CoreFrameworkServiceLocator.getParameterService().parameterExists(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.ALL_DETAIL_TYPE, KewApiConstants.KIM_PRIORITY_ON_DOC_TYP_PERMS_IND)) {
Parameter kimPriorityOverDocTypePolicyParameter = CoreFrameworkServiceLocator.getParameterService().getParameter(KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.ALL_DETAIL_TYPE, KewApiConstants.KIM_PRIORITY_ON_DOC_TYP_PERMS_IND);
Parameter.Builder b = Parameter.Builder.create(kimPriorityOverDocTypePolicyParameter);
b.setValue(parameterValue);
CoreFrameworkServiceLocator.getParameterService().updateParameter(b.build());
}
}
示例10: changeState
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public synchronized void changeState(RunOnceState state) {
// Ensure things are as they should be
checkState(initialized, "Not initialized");
checkNotNull(state, "'state' cannot be null");
// Get the existing parameter
Parameter existingParameter = parameterService.getParameter(namespace, component, name);
// Can't change the state of a non-existent parameter
// The isRunOnce() method called during initialization cannot return true unless a parameter exists and it's value is set to 'Y'
checkNotNull(existingParameter, "'existingParameter' cannot be null");
// Update the parameter
logger.info("Updating parameter: [{}]", name);
Parameter.Builder builder = Parameter.Builder.create(existingParameter);
builder.setValue(state.name());
Parameter updatedParameter = parameterService.updateParameter(builder.build());
// This must always return false here
runonce = isRunOnce(updatedParameter);
checkState(!isTrue(), "isTrue() must return false");
// Emit a log message indicating the change in state
logger.info("Transitioned RunOnce to - [{}]", updatedParameter.getValue());
}
示例11: createParameter
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
private Parameter createParameter() {
logger.info("Creating parameter: [{}]=[{}]", name, YES);
ParameterType.Builder parameterTypeBuilder = ParameterType.Builder.create(CONFIGURATION_PARAMETER_TYPE);
Parameter.Builder parameterBuilder = Parameter.Builder.create(applicationId, namespace, component, name, parameterTypeBuilder);
parameterBuilder.setValue(YES);
if (description.isPresent()) {
parameterBuilder.setDescription(description.get());
}
return parameterService.createParameter(parameterBuilder.build());
}
示例12: resetAutoCloseRecurringOrderDateParameter
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
/**
* Resets the AUTO_CLOSE_RECURRING_ORDER_DT system parameter to "mm/dd/yyyy".
*/
protected void resetAutoCloseRecurringOrderDateParameter() {
Parameter autoCloseRecurringPODate = parameterService.getParameter(AutoCloseRecurringOrdersStep.class, PurapParameterConstants.AUTO_CLOSE_RECURRING_PO_DATE);
if (autoCloseRecurringPODate != null) {
Parameter.Builder updatedParameter = Parameter.Builder.create(autoCloseRecurringPODate);
updatedParameter.setValue("mm/dd/yyyy");
parameterService.updateParameter(updatedParameter.build());
}
}
示例13: loadDefaultCircPolicies
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
public List<String> loadDefaultCircPolicies(boolean forceLoad) throws Exception {
if (forceLoad || parameterService.getParameterValueAsBoolean(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_CIRCULATION_POLICIES_IND, Boolean.TRUE)) {
LOG.debug("Starting Load of Default Circulation Policies");
URL resource = getClass().getResource(fileName);
File file = new File(resource.toURI());
String fileContent = new FileUtil().readFile(file);
List<String> policies = circPolicyBuilder.persistKrmsFromFileContent(fileContent);
LOG.debug("Completed Load of Default Circulation Policies");
Parameter existingParameter = parameterService.getParameter(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_CIRCULATION_POLICIES_IND);
if (existingParameter != null) {
Parameter.Builder updatedParameter = Parameter.Builder.create(existingParameter);
updatedParameter.setValue("N");
parameterService.updateParameter(updatedParameter.build());
} else {
Parameter.Builder newParameter = Parameter.Builder.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_CIRCULATION_POLICIES_IND, ParameterType.Builder.create("CONFG"));
newParameter.setDescription("Set to 'Y' to have the application ingest the default circulation policies upon next startup.");
newParameter.setValue("N");
parameterService.createParameter(newParameter.build());
}
return policies;
}
return Collections.emptyList();
}
示例14: loadDefaultEResource
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
public List<String> loadDefaultEResource(boolean forceLoad) throws Exception {
if (forceLoad || parameterService.getParameterValueAsBoolean(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_EREC_IND, Boolean.TRUE)) {
LOG.debug("Starting Load of Default EResource");
URL resource = getClass().getResource(fileName);
File file = new File(resource.toURI());
String fileContent = new FileUtil().readFile(file);
List<String> policies = eresourceBuilder.persistKrmsFromFileContent(fileContent);
LOG.debug("Completed Load of Default EResource");
Parameter existingParameter = parameterService.getParameter(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_EREC_IND);
if (existingParameter != null) {
Parameter.Builder updatedParameter = Parameter.Builder.create(existingParameter);
updatedParameter.setValue("N");
parameterService.updateParameter(updatedParameter.build());
} else {
Parameter.Builder newParameter = Parameter.Builder.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_EREC_IND, ParameterType.Builder.create("CONFG"));
newParameter.setDescription("Set to 'Y' to have the application ingest the default EResource upon next startup.");
newParameter.setValue("N");
parameterService.createParameter(newParameter.build());
}
return policies;
}
return Collections.emptyList();
}
示例15: loadDefaultLicenses
import org.kuali.rice.coreservice.api.parameter.Parameter; //导入方法依赖的package包/类
public List<String> loadDefaultLicenses(boolean forceLoad) throws Exception {
if (forceLoad || parameterService.getParameterValueAsBoolean(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LICENSES_IND, Boolean.TRUE)) {
LOG.debug("Starting Load of Default Licenses");
URL resource = getClass().getResource(fileName);
File file = new File(resource.toURI());
String fileContent = new FileUtil().readFile(file);
List<String> policies = licenseBuilder.persistKrmsFromFileContent(fileContent);
LOG.debug("Completed Load of Default Licenses");
Parameter existingParameter = parameterService.getParameter(OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LICENSES_IND);
if (existingParameter != null) {
Parameter.Builder updatedParameter = Parameter.Builder.create(existingParameter);
updatedParameter.setValue("N");
parameterService.updateParameter(updatedParameter.build());
} else {
Parameter.Builder newParameter = Parameter.Builder.create(OLEConstants.APPL_ID, OLEConstants.DLVR_NMSPC, OLEConstants.DLVR_CMPNT, LOAD_DEFAULT_LICENSES_IND, ParameterType.Builder.create("CONFG"));
newParameter.setDescription("Set to 'Y' to have the application ingest the default Licenses upon next startup.");
newParameter.setValue("N");
parameterService.createParameter(newParameter.build());
}
return policies;
}
return Collections.emptyList();
}