本文整理汇总了Java中org.kuali.rice.core.api.CoreConstants类的典型用法代码示例。如果您正苦于以下问题:Java CoreConstants类的具体用法?Java CoreConstants怎么用?Java CoreConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoreConstants类属于org.kuali.rice.core.api包,在下文中一共展示了CoreConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRegexString
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* Returns a regex representing all the allowed formats in the system. If allowedFormats is
* supplied, returns a regex representing only those formats.
*
* @see org.kuali.rice.krad.datadictionary.validation.constraint.ValidDataPatternConstraint#getRegexString()
*/
@Override
protected String getRegexString() {
List<String> dateFormatParams = loadFormats(CoreConstants.STRING_TO_DATE_FORMATS, CoreConstants.STRING_TO_DATE_FORMATS_DEFAULT);
if (allowedFormats != null && !allowedFormats.isEmpty()) {
if (dateFormatParams.containsAll(allowedFormats)) {
dateFormatParams = allowedFormats;
} else {
//throw new Exception("Some of these formats do not exist in configured allowed date formats: " + allowedFormats.toString());
}
}
String regex = "";
int i = 0;
for (String format : dateFormatParams) {
if (i == 0) {
regex = "(^" + convertDateFormatToRegex(format.trim()) + "$)";
} else {
regex = regex + "|(^" + convertDateFormatToRegex(format.trim()) + "$)";
}
i++;
}
return regex;
}
示例2: initGRL
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
@Before
public void initGRL() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "APPID");
ConfigContext.init(config);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
when(kualiModuleService.getInstalledModuleServices()).thenReturn(installedModuleServices);
testBf.addBean(KRADServiceLocator.PROVIDER_REGISTRY, mock(ProviderRegistry.class));
testBf.addBean(KRADServiceLocatorWeb.KUALI_MODULE_SERVICE, kualiModuleService);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName("moduleservicebase-unittest"), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
}
示例3: composeMessage
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
protected MailMessage composeMessage(MailMessage message){
MailMessage mm = new MailMessage();
// If realNotificationsEnabled is false, mails will be sent to nonProductionNotificationMailingList
if(!isRealNotificationsEnabled()){
getNonProductionMessage(message);
}
String app = CoreApiServiceLocator.getKualiConfigurationService().getPropertyValueAsString(CoreConstants.Config.APPLICATION_ID);
String env = CoreApiServiceLocator.getKualiConfigurationService().getPropertyValueAsString(KRADConstants.ENVIRONMENT_KEY);
mm.setToAddresses(message.getToAddresses());
mm.setBccAddresses(message.getBccAddresses());
mm.setCcAddresses(message.getCcAddresses());
mm.setSubject(app + " " + env + ": " + message.getSubject());
mm.setMessage(message.getMessage());
mm.setFromAddress(message.getFromAddress());
return mm;
}
示例4: initGrl
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
@BeforeClass
public static void initGrl() throws Exception {
ConfigContext.init(new SimpleConfig());
ConfigContext.getCurrentContextConfig().putProperty(CoreConstants.Config.APPLICATION_ID, LegacyUtilsTest.class.getName());
// have to mock these because LegacyDetectionAdvice is calling LegacyUtils
MetadataRepository metadataRepository = mock(MetadataRepository.class);
DataDictionaryService dataDictionaryService = mock(DataDictionaryService.class);
ResourceLoader resourceLoader = mock(ResourceLoader.class);
when(resourceLoader.getName()).thenReturn(QName.valueOf(LegacyUtilsTest.class.getName()));
when(resourceLoader.getService(QName.valueOf("metadataRepository"))).thenReturn(metadataRepository);
when(resourceLoader.getService(QName.valueOf("dataDictionaryService"))).thenReturn(dataDictionaryService);
GlobalResourceLoader.addResourceLoader(resourceLoader);
GlobalResourceLoader.start();
}
示例5: initGrl
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
@BeforeClass
public static void initGrl() throws Exception {
MetadataRepository metadataRepository = mock(MetadataRepository.class);
DataDictionaryService dataDictionaryService = mock(DataDictionaryService.class);
ResourceLoader resourceLoader = mock(ResourceLoader.class);
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, LegacyUtilsTest.class.getName());
config.putProperty(KRADConstants.Config.ENABLE_LEGACY_DATA_FRAMEWORK, "true");
ConfigContext.init(config);
when(resourceLoader.getName()).thenReturn(QName.valueOf(LegacyUtilsTest.class.getName()));
when(resourceLoader.getService(QName.valueOf("metadataRepository"))).thenReturn(metadataRepository);
when(resourceLoader.getService(QName.valueOf("dataDictionaryService"))).thenReturn(dataDictionaryService);
GlobalResourceLoader.addResourceLoader(resourceLoader);
GlobalResourceLoader.start();
}
示例6: installRiceKualiModuleService
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
@Before
public void installRiceKualiModuleService() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "APPID");
ConfigContext.init(config);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
KualiModuleService riceKualiModuleService = mock(KualiModuleService.class);
when(riceKualiModuleService.getInstalledModuleServices()).thenReturn(riceModuleServices);
testBf.addBean(KRADServiceLocatorWeb.KUALI_MODULE_SERVICE, riceKualiModuleService);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName("moduleservicebase-unittest"), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
}
示例7: refreshServiceBus
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
public ActionForward refreshServiceBus(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
String applicationId = ConfigContext.getCurrentContextConfig().getProperty(
CoreConstants.Config.APPLICATION_ID);
List<Endpoint> endpoints = KsbApiServiceLocator.getServiceBus().getEndpoints(SERVICE_BUS_ADMIN_SERVICE_QUEUE, applicationId);
if (endpoints.isEmpty()) {
KsbApiServiceLocator.getServiceBus().synchronize();
} else {
for (Endpoint endpoint : endpoints) {
ServiceBusAdminService serviceBusAdminService = (ServiceBusAdminService) endpoint.getService();
LOG.info("Calling " + endpoint.getServiceConfiguration().getEndpointUrl() + " on " +
endpoint.getServiceConfiguration().getInstanceId());
serviceBusAdminService.clearServiceBusCache();
}
}
return mapping.findForward("basic");
}
示例8: getNestedQualification
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
private Map<String, String> getNestedQualification(RoleBoLite memberRole, String namespaceCode, String roleName,
String memberNamespaceCode, String memberName, Map<String, String> qualification,
Map<String, String> memberQualification) {
VersionedService<RoleTypeService> versionedRoleTypeService = getVersionedRoleTypeService(KimTypeBo.to(
memberRole.getKimRoleType()));
// if null service - just return the original qualification (pre 2.3.4 - ignoring memberQualifications)
if (versionedRoleTypeService == null) {
return qualification;
}
boolean versionOk = VersionHelper.compareVersion(versionedRoleTypeService.getVersion(),
CoreConstants.Versions.VERSION_2_3_4) != -1;
if (versionOk) {
return versionedRoleTypeService.getService().convertQualificationForMemberRolesAndMemberAttributes(
namespaceCode, roleName, memberNamespaceCode, memberName, qualification, memberQualification);
} else {
return versionedRoleTypeService.getService().convertQualificationForMemberRoles(namespaceCode, roleName,
memberNamespaceCode, memberName, qualification);
}
}
示例9: getCleanedSearchableValues
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* Splits the values then cleans them of any other query characters like *?!><...
*
* @param valueEntered
* @param propertyDataType
* @return
*/
public static List<String> getCleanedSearchableValues(String valueEntered, String propertyDataType) {
List<String> lRet = null;
List<String> lTemp = getSearchableValues(valueEntered);
if(lTemp != null && !lTemp.isEmpty()){
lRet = new ArrayList<String>();
for(String val: lTemp){
// Clean the wildcards appropriately, depending on the field's data type.
if (CoreConstants.DATA_TYPE_STRING.equals(propertyDataType)) {
lRet.add(clean(val));
} else if (CoreConstants.DATA_TYPE_FLOAT.equals(propertyDataType) || CoreConstants.DATA_TYPE_LONG.equals(propertyDataType)) {
lRet.add(SQLUtils.cleanNumericOfValidOperators(val));
} else if (CoreConstants.DATA_TYPE_DATE.equals(propertyDataType)) {
lRet.add(SQLUtils.cleanDate(val));
} else {
lRet.add(clean(val));
}
}
}
return lRet;
}
示例10: applicationEventListener
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* <p>
* The {@link org.kuali.rice.coreservice.api.parameter.Parameter} properties need to come from the
* {@link ConfigContext} instead of the {@link org.kuali.common.util.spring.env.EnvironmentService} for the scenario
* where nobody has wired in a bootstrap PSC in order to help manage the resetting of the database via RunOnce.
* </p>
*/
@Override
@Bean
public SmartApplicationListener applicationEventListener() {
Properties properties = ConfigContext.getCurrentContextConfig().getProperties();
String applicationId = properties.getProperty(CoreConstants.Config.APPLICATION_ID);
String namespace = properties.getProperty(NAMESPACE_KEY, NAMESPACE);
String component = properties.getProperty(COMPONENT_KEY, COMPONENT);
String name = properties.getProperty(NAME_KEY, NAME);
String description = properties.getProperty(DESCRIPTION_KEY, DESCRIPTION);
boolean runOnMissingParameter = Boolean.parseBoolean(properties.getProperty(RUN_ON_MISSING_PARAMETER_KEY, RUN_ON_MISSING_PARAMETER.toString()));
int order = Integer.parseInt(properties.getProperty(ORDER_KEY, String.valueOf(Ordered.LOWEST_PRECEDENCE)));
RunOnce runOnce = ParameterServiceRunOnce.builder(applicationId, namespace, component, name)
.description(description).runOnMissingParameter(runOnMissingParameter).build();
Executable springExecutable = SpringExecUtils.getSpringExecutable(service, propertySource, IngestXmlExecConfig.class,
Lists.newArrayList("master"));
Executable executable = RunOnceExecutable.builder(springExecutable, runOnce).build();
return ExecutableApplicationEventListener.builder(executable, ContextRefreshedEvent.class).order(order).build();
}
示例11: getDateTimeService
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* Returns the {@link DateTimeService}.
*
* @return the {@link DateTimeService}
*/
protected DateTimeService getDateTimeService() {
if (dateTimeService == null) {
dateTimeService = GlobalResourceLoader.getService(CoreConstants.Services.DATETIME_SERVICE);
}
return dateTimeService;
}
示例12: getDateTimeService
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* Gets the date time service.
*
* @return the date time service
*/
protected DateTimeService getDateTimeService() {
if (this.dateTimeService == null) {
this.dateTimeService = GlobalResourceLoader.getService(CoreConstants.Services.DATETIME_SERVICE);
}
return this.dateTimeService;
}
示例13: getDateTimeService
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
/**
* Gets the date time service.
*
* @return the date time service
*/
protected DateTimeService getDateTimeService() {
if (dateTimeService == null) {
dateTimeService = GlobalResourceLoader.getService(CoreConstants.Services.DATETIME_SERVICE);
}
return dateTimeService;
}
示例14: getValidationMessageParams
import org.kuali.rice.core.api.CoreConstants; //导入依赖的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>();
if (allowedFormats != null && !allowedFormats.isEmpty()) {
validationMessageParams.add(StringUtils.join(allowedFormats, ", "));
} else {
List<String> dateFormatParams = loadFormats(CoreConstants.STRING_TO_DATE_FORMATS, CoreConstants.STRING_TO_DATE_FORMATS_DEFAULT);
validationMessageParams.add(StringUtils.join(dateFormatParams, ", "));
}
}
return validationMessageParams;
}
示例15: setUp
import org.kuali.rice.core.api.CoreConstants; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
String formats = "MM/dd/yy;MM/dd/yyyy;MM-dd-yy;MM-dd-yyyy";
Properties props = new Properties();
props.put(CoreConstants.STRING_TO_DATE_FORMATS, formats);
Config config = new SimpleConfig(props);
ConfigContext.init(config);
ConfigContext.getCurrentContextConfig().putProperty(CoreConstants.STRING_TO_DATE_FORMATS, formats);
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
validDate = "07-28-2011";
validDate1 = "12-31-83";
invalidDateEmpty = "";
invalidDate = "31-12-2010";
invalidDate1 = "31-12-2010 12:30:45.456";
invalidDate2 = "2011-07-28 IST";
invalidDate3 = "12/31/2011";
List<String> allowedFormats = new ArrayList<String>();
allowedFormats.add("MM-dd-yy");
allowedFormats.add("MM-dd-yyyy");
datePatternConstraint = new DatePatternConstraint();
datePatternConstraint.setMessageKey("validate.dummykey");
datePatternConstraint.setValidationMessageParams( new ArrayList<String>());
datePatternConstraint.setAllowedFormats(allowedFormats);
dateDefinition = new AttributeDefinition();
dateDefinition.setName("date");
dateDefinition.setValidCharactersConstraint(datePatternConstraint);
}