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


Java LookupView.setId方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.lookup.LookupView.setId方法的典型用法代码示例。如果您正苦于以下问题:Java LookupView.setId方法的具体用法?Java LookupView.setId怎么用?Java LookupView.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.lookup.LookupView的用法示例。


在下文中一共展示了LookupView.setId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateMissingLookupDefinitions

import org.kuali.rice.krad.lookup.LookupView; //导入方法依赖的package包/类
protected void generateMissingLookupDefinitions() {
    Collection<LookupView> lookupViewBeans = ddBeans.getBeansOfType(LookupView.class).values();
    // Index all the inquiry views by the data object class so we can find them easily below
    Map<Class<?>,LookupView> defaultViewsByDataObjectClass = new HashMap<>();
    for ( LookupView view : lookupViewBeans ) {
        if ( view.getViewName().equals(UifConstants.DEFAULT_VIEW_NAME) ) {
            defaultViewsByDataObjectClass.put(view.getDataObjectClass(), view);
        }
    }
    for (DataObjectEntry entry : ddBeans.getBeansOfType(DataObjectEntry.class).values()) {
        // if an inquiry already exists, just ignore - we only default if none exist
        if ( defaultViewsByDataObjectClass.containsKey(entry.getDataObjectClass())) {
            continue;
        }
        // We only generate the inquiry if the metadata says to
        if ( entry.getDataObjectMetadata() == null ) {
            continue;
        }
        if ( !entry.getDataObjectMetadata().shouldAutoCreateUifViewOfType(UifAutoCreateViewType.LOOKUP)) {
            continue;
        }
        // no inquiry exists and we want one to, create one
        if ( LOG.isInfoEnabled() ) {
            LOG.info( "Generating Lookup View for : " + entry.getDataObjectClass() );
        }
        String lookupBeanName = entry.getDataObjectClass().getSimpleName()+"-LookupView-default";

        LookupView lookupView = KRADServiceLocatorWeb.getUifDefaultingService().deriveLookupViewFromMetadata(entry);
        lookupView.setId(lookupBeanName);
        lookupView.setViewName(UifConstants.DEFAULT_VIEW_NAME);

        ChildBeanDefinition lookupBean = new ChildBeanDefinition(ComponentFactory.LOOKUP_VIEW);
        lookupBean.setScope(BeanDefinition.SCOPE_SINGLETON);
        lookupBean.setAttribute("dataObjectClassName", lookupView.getDataObjectClass());
        lookupBean.getPropertyValues().add("dataObjectClassName", lookupView.getDataObjectClass().getName());
        lookupBean.setResourceDescription("Autogenerated From Metadata");
        ddBeans.registerBeanDefinition(lookupBeanName, lookupBean);
        ddBeans.registerSingleton(lookupBeanName, lookupView);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:DataDictionary.java

示例2: generateMissingLookupDefinitions

import org.kuali.rice.krad.lookup.LookupView; //导入方法依赖的package包/类
protected void generateMissingLookupDefinitions() {
    Collection<LookupView> lookupViewBeans = ddBeans.getBeansOfType(LookupView.class).values();
    // Index all the inquiry views by the data object class so we can find them easily below
    Map<Class<?>,LookupView> defaultViewsByDataObjectClass = new HashMap<Class<?>, LookupView>();
    for ( LookupView view : lookupViewBeans ) {
        if ( view.getViewName().equals(UifConstants.DEFAULT_VIEW_NAME) ) {
            defaultViewsByDataObjectClass.put(view.getDataObjectClass(), view);
        }
    }
    for (DataObjectEntry entry : ddBeans.getBeansOfType(DataObjectEntry.class).values()) {
        // if an inquiry already exists, just ignore - we only default if none exist
        if ( defaultViewsByDataObjectClass.containsKey(entry.getDataObjectClass())) {
            continue;
        }
        // We only generate the inquiry if the metadata says to
        if ( entry.getDataObjectMetadata() == null ) {
            continue;
        }
        if ( !entry.getDataObjectMetadata().shouldAutoCreateUifViewOfType(UifAutoCreateViewType.LOOKUP)) {
            continue;
        }
        // no inquiry exists and we want one to, create one
        if ( LOG.isInfoEnabled() ) {
            LOG.info( "Generating Lookup View for : " + entry.getDataObjectClass() );
        }
        String lookupBeanName = entry.getDataObjectClass().getSimpleName()+"-LookupView-default";

        LookupView lookupView = KRADServiceLocatorWeb.getUifDefaultingService().deriveLookupViewFromMetadata(entry);
        lookupView.setId(lookupBeanName);
        lookupView.setViewName(UifConstants.DEFAULT_VIEW_NAME);

        ChildBeanDefinition lookupBean = new ChildBeanDefinition(ComponentFactory.LOOKUP_VIEW);
        lookupBean.setScope(BeanDefinition.SCOPE_SINGLETON);
        lookupBean.setAttribute("dataObjectClassName", lookupView.getDataObjectClass());
        lookupBean.getPropertyValues().add("dataObjectClassName", lookupView.getDataObjectClass().getName());
        lookupBean.setResourceDescription("Autogenerated From Metadata");
        ddBeans.registerBeanDefinition(lookupBeanName, lookupBean);
        ddBeans.registerSingleton(lookupBeanName, lookupView);
    }
}
 
开发者ID:kuali,项目名称:rice,代码行数:41,代码来源:DataDictionary.java


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