本文整理匯總了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);
}
}
示例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);
}
}