本文整理汇总了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);
}
}