當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。