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


Java CoreServiceApiServiceLocator类代码示例

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


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

示例1: update

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ParameterController.java

示例2: lookup

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public String lookup(String propertyName) {
    if (StringUtils.isBlank(propertyName)) {
        return null;
    }

    String paramValue;

    // check runtime parameters first
    if (StringUtils.isBlank(applicationId)) {
        paramValue = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsString(
                KewApiConstants.KEW_NAMESPACE, KRADConstants.DetailTypes.ALL_DETAIL_TYPE, propertyName);
    } else {
        ParameterKey parameterKey = ParameterKey.create(applicationId, KewApiConstants.KEW_NAMESPACE,
                KRADConstants.DetailTypes.ALL_DETAIL_TYPE, propertyName);
        paramValue = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameterValueAsString(parameterKey);
    }

    // fall back to deploy time configurations if empty
    if (paramValue == null) {
        paramValue = super.lookup(propertyName);
    }

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

示例3: validGroupNamespace

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
protected boolean validGroupNamespace(IdentityManagementGroupDocument document){
    boolean rulePassed = true;
    String namespacePassed = document.getGroupNamespace();
    if(StringUtils.isNotBlank(namespacePassed)){
        rulePassed = true;
        Namespace matchedNamespace = CoreServiceApiServiceLocator.getNamespaceService().getNamespace(namespacePassed);
        if(matchedNamespace == null){
            rulePassed = false;
        }
    }else{
        rulePassed = false;
    }
    if(!rulePassed){
        GlobalVariables.getMessageMap().putError("document.groupNamespace",
                RiceKeyConstants.ERROR_REQUIRED,
                new String[] {"Group Namespace"});
    }
    return rulePassed;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:IdentityManagementGroupDocumentRule.java

示例4: testGenerateRemindersCustomStyleSheet

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
/**
 * tests custom stylesheet
 * @throws Exception
 */
@Test
public void testGenerateRemindersCustomStyleSheet() throws Exception {
    loadXmlFile("customEmailStyleData.xml");
    assertNotNull(CoreServiceApiServiceLocator.getStyleService().getStyle("kew.email.style"));

    Person user = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("arh14");
    int count = generateDocs(new String[] { "PingDocument", "PingDocumentWithEmailAttrib" }, user);

    Collection<ActionItem> actionItems = org.kuali.rice.kew.actionitem.ActionItem.to(new ArrayList<org.kuali.rice.kew.actionitem.ActionItem>(KEWServiceLocator.getActionListService().getActionList(user.getPrincipalId(), null)));
    assertEquals("user should have " + count + " items in his action list.", count, actionItems.size());

    EmailContent content = styleableContentService.generateImmediateReminder(user, actionItems.iterator().next(), KEWServiceLocator.getDocumentTypeService().findByName(actionItems.iterator().next().getDocName()));
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));

    content = styleableContentService.generateDailyReminder(user, actionItems);
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));

    content = styleableContentService.generateWeeklyReminder(user, actionItems);
    assertTrue("Unexpected subject", content.getSubject().startsWith("CUSTOM:"));
    assertTrue("Unexpected body", content.getBody().startsWith("CUSTOM:"));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:EmailMessageTest.java

示例5: testLoadXML

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
@Test public void testLoadXML() throws FileNotFoundException {
    loadXmlFile("EDocLiteContent.xml");
    loadXmlFile("edlstyle.xml");

    EDocLiteService edls = EdlServiceLocator.getEDocLiteService();
    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();
    //edls.loadXml(new FileInputStream("conf/examples/xml/EDocLiteContent.xml"));
    assertTrue("Definition not found", edls.getEDocLiteDefinition("profile") != null);
    Style defaultStyle = styleService.getStyle("Default");
    assertNotNull("Style not found", defaultStyle);
    assertEquals(1, edls.getEDocLiteAssociations().size());
    EDocLiteDefinition def = edls.getEDocLiteDefinition("profile");
    assertNotNull("'profile' definition not found", def);
    assertEquals("profile", def.getName());
    assertNotNull(def.getActiveInd());
    assertTrue(def.getActiveInd().booleanValue());
    Style style = styleService.getStyle("Default");
    assertNotNull("'Default' style not found", style);
    assertEquals("Default", style.getName());
    assertTrue(style.isActive());
    assertNotNull(style.getXmlContent());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:EDocLiteServiceImplTest.java

示例6: testStyleServiceImpl

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
@Test
public void testStyleServiceImpl() throws Exception{
    setupStyleBoDataObjectAndSave();

    List<String> styleNames = CoreServiceApiServiceLocator.getStyleService().getAllStyleNames();
    assertTrue("getAllStyleNames retrieved correctly", styleNames != null && styleNames.size() == 1);

    Style style = CoreServiceApiServiceLocator.getStyleService().getStyle(STYLE_NAME);
    assertTrue("getStyle retrieved correctly", style != null && StringUtils.equals(STYLE_NAME,style.getName()));

    StyleBo styleBo = new StyleBo();
    styleBo.setActive(true);
    styleBo.setId(STYLE_ID + "23");
    styleBo.setName(STYLE_NAME + "_NEW");
    styleBo.setXmlContent("<xml>something_new</xml>");
    style = StyleBo.to(styleBo);
    CoreServiceApiServiceLocator.getStyleService().saveStyle(style);
    style = CoreServiceApiServiceLocator.getStyleService().getStyle(STYLE_NAME+"_NEW");
    assertTrue("getStyle retrieved correctly", style != null && StringUtils.equals(STYLE_NAME+"_NEW",style.getName()));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:CoreServiceJpaDataTest.java

示例7: testParameterServiceImpl

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
@Test
public void testParameterServiceImpl() throws Exception{
    setupParameterBoDataObjectAndSave();
    ParameterKey parameterKey = ParameterKey.create(APP_ID, "TST_NM_SPACE", "TST", "TST_PARAM");

    Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().
            getParameter(parameterKey);
    assertTrue("Parameter fetched correctly after save", parameter != null &&
            StringUtils.equals(parameter.getName(),"TST_PARAM"));
    String value = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameterValueAsString(parameterKey);
    assertTrue("Parameter value fetched correctly", StringUtils.equals(parameter.getValue(),value));
    ParameterBo modifiedParam = ParameterBo.from(parameter);
    modifiedParam.setValue("new value");
    CoreServiceApiServiceLocator.getParameterRepositoryService().updateParameter(ParameterBo.to(modifiedParam));
    value = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameterValueAsString(parameterKey);
    assertTrue("Parameter value fetched correctly", StringUtils.equals(modifiedParam.getValue(),value));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:CoreServiceJpaDataTest.java

示例8: unmarshal

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
/**
 * @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
 */
@Override
public NameAndNamespacePair unmarshal(NameAndNamespacePair v) throws Exception {
    if (v != null) {
        
        if (StringUtils.isBlank(v.getName())) {
            throw new UnmarshalException("Cannot import a name-and-namespace pair with a blank name");
        } else if (StringUtils.isBlank(v.getNamespaceCode())) {
            throw new UnmarshalException("Cannot import a name-and-namespace pair with a blank namespace code");
        } if (CoreServiceApiServiceLocator.getNamespaceService().getNamespace(v.getNamespaceCode()) == null) {
            throw new UnmarshalException("Cannot import a name-and-namespace pair with invalid or unknown namespace \"" +
                    v.getNamespaceCode() + "\"");
        }
        
        v.setName(new NormalizedStringAdapter().unmarshal(v.getName()));
        v.setNamespaceCode(v.getNamespaceCode());
    }
    return v;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:NameAndNamespacePairValidatingAdapter.java

示例9: marshal

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
/**
 * @see javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
 */
@Override
public NameAndNamespacePair marshal(NameAndNamespacePair v) throws Exception {
    if (v != null) {
        if (StringUtils.isBlank(v.getName())) {
            throw new MarshalException("Cannot export a name-and-namespace pair with a blank name");
        } else if (StringUtils.isBlank(v.getNamespaceCode())) {
            throw new MarshalException("Cannot export a name-and-namespace pair with a blank namespace code");
        } else if (CoreServiceApiServiceLocator.getNamespaceService().getNamespace(v.getNamespaceCode()) == null) {
            throw new MarshalException("Cannot export a name-and-namespace pair with invalid or unknown namespace \"" + v.getNamespaceCode() + "\"");
        }
        
        v.setName(new NormalizedStringAdapter().marshal(v.getName()));
        v.setNamespaceCode(v.getNamespaceCode());
    }
    return v;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:NameAndNamespacePairValidatingAdapter.java

示例10: getKeyValues

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
@Override
public List<KeyValue> getKeyValues() {

       // get a list of all Namespaces
       List<Namespace> namespaces = CoreServiceApiServiceLocator.getNamespaceService().findAllNamespaces();
       // copy the list of codes before sorting, since we can't modify the results from this method
       namespaces = namespaces == null ? new ArrayList<Namespace>(0) : new ArrayList<Namespace>( namespaces );

       // sort using comparator.
       Collections.sort(namespaces, NamespaceComparator.INSTANCE);

       // create a new list (code, descriptive-name)
       List<KeyValue> labels = new ArrayList<KeyValue>( namespaces.size() );
       labels.add(new ConcreteKeyValue("", ""));
       for ( Namespace namespace : namespaces ) {
           labels.add( new ConcreteKeyValue(namespace.getCode(), namespace.getCode() + " - " + namespace.getName() ) );
       }
       return labels;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:NamespaceValuesFinder.java

示例11: exportStyles

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
private void exportStyles(Element parentEl, EDocLiteAssociation edl) {

		try {
			StyleService styleService = CoreServiceApiServiceLocator.getStyleService();

			if (edl.getStyle() != null) {//this probably shouldn't be supported on the entry side...
				Element styleWrapperEl = renderer.renderElement(parentEl, EDL_STYLE);
				renderer.renderAttribute(styleWrapperEl, "name", edl.getStyle());
				Style style = styleService.getStyle(edl.getStyle());
				if (style == null) {
					LOG.error("Attempted to export style " + edl.getStyle() + " which was not found");
					return;
				}
				Element styleEl = XmlHelper.buildJDocument(new StringReader(style.getXmlContent())).getRootElement();
				styleWrapperEl.addContent(styleEl.detach());
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:EDocLiteXmlExporter.java

示例12: ClassPathResource

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
/**
     * To load the property file for the given path.
     *
     * @param classPath String
     * @return properties
     */
/*    public static Properties loadPropertiesFromClassPath(String classPath) {
        ClassPathResource classPathResource = new ClassPathResource(classPath);

        Properties properties = new Properties();
        try {
            properties.load(classPathResource.getInputStream());
        }
        catch (IOException e) {
            throw new RuntimeException("Invalid class path: " + classPath + e,e);
        }

        return properties;
    }*/

    public String getParameter(String name){
        ParameterKey parameterKey = ParameterKey.create(OLEConstants.APPL_ID,OLEConstants.SELECT_NMSPC,OLEConstants.SELECT_CMPNT,name);
        Parameter parameter = CoreServiceApiServiceLocator.getParameterRepositoryService().getParameter(parameterKey);
        return parameter!=null?parameter.getValue():null;
    }
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:26,代码来源:RequisitionLoadTransactionsServiceImpl.java

示例13: publishBatchStepComponents

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
public static void publishBatchStepComponents() {
    Map<String,Step> steps = SpringContext.getBeansOfType(Step.class);
    List<Component> stepComponents = new ArrayList<Component>( steps.size() );
    for ( Step step : steps.values() ) {
        Step unproxiedStep = (Step) ProxyUtils.getTargetIfProxied(step);
        String namespaceCode = OLEConstants.CoreModuleNamespaces.OLE;
        if ( LOG.isDebugEnabled() ) {
            LOG.debug( "Building component for step: " + unproxiedStep.getName() + "(" + unproxiedStep.getClass() + ")" );
        }
        ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(unproxiedStep.getClass());
        if ( moduleService != null ) {
            namespaceCode = moduleService.getModuleConfiguration().getNamespaceCode();
        }
        Component.Builder component = Component.Builder.create(namespaceCode, unproxiedStep.getClass().getSimpleName(), unproxiedStep.getClass().getSimpleName());
        component.setComponentSetId(OLE_BATCH_STEP_COMPONENT_SET_ID);
        component.setActive(true);
        stepComponents.add(component.build());
    }

    CoreServiceApiServiceLocator.getComponentService().publishDerivedComponents(OLE_BATCH_STEP_COMPONENT_SET_ID, stepComponents);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:22,代码来源:SpringContext.java

示例14: publishBatchStepComponents

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
public static void publishBatchStepComponents() {
    Map<String,Step> steps = SpringContext.getBeansOfType(Step.class);
    List<Component> stepComponents = new ArrayList<Component>( steps.size() );
    for ( Step step : steps.values() ) {
        Step unproxiedStep = (Step) ProxyUtils.getTargetIfProxied(step);
        String namespaceCode = KFSConstants.CoreModuleNamespaces.KFS;
        if ( LOG.isDebugEnabled() ) {
            LOG.debug( "Building component for step: " + unproxiedStep.getName() + "(" + unproxiedStep.getClass() + ")" );
        }
        ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(unproxiedStep.getClass());
        if ( moduleService != null ) {
            namespaceCode = moduleService.getModuleConfiguration().getNamespaceCode();
        }
        Component.Builder component = Component.Builder.create(namespaceCode, unproxiedStep.getClass().getSimpleName(), unproxiedStep.getClass().getSimpleName());
        component.setComponentSetId(KFS_BATCH_STEP_COMPONENT_SET_ID);
        component.setActive(true);
        stepComponents.add(component.build());
    }

    CoreServiceApiServiceLocator.getComponentService().publishDerivedComponents(KFS_BATCH_STEP_COMPONENT_SET_ID, stepComponents);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:22,代码来源:SpringContext.java

示例15: testLoadXML

import org.kuali.rice.coreservice.api.CoreServiceApiServiceLocator; //导入依赖的package包/类
@Test public void testLoadXML() throws FileNotFoundException {
    loadXmlFile("EDocLiteContent.xml");
    loadXmlFile("edlstyle.xml");

    EDocLiteService edls = EdlServiceLocator.getEDocLiteService();
    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();
    //edls.loadXml(new FileInputStream("conf/examples/xml/EDocLiteContent.xml"));
    assertTrue("Definition not found", edls.getEDocLiteDefinitions().contains("profile"));
    Style defaultStyle = styleService.getStyle("Default");
    assertNotNull("Style not found", defaultStyle);
    assertEquals(1, edls.getEDocLiteAssociations().size());
    EDocLiteDefinition def = edls.getEDocLiteDefinition("profile");
    assertNotNull("'profile' definition not found", def);
    assertEquals("profile", def.getName());
    assertNotNull(def.getActiveInd());
    assertTrue(def.getActiveInd().booleanValue());
    Style style = styleService.getStyle("Default");
    assertNotNull("'Default' style not found", style);
    assertEquals("Default", style.getName());
    assertTrue(style.isActive());
    assertNotNull(style.getXmlContent());
}
 
开发者ID:kuali,项目名称:rice,代码行数:23,代码来源:EDocLiteServiceImplTest.java


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