public ViewConfig getViewConfig(DoradoContext context, String viewName) throws Exception {
   ViewConfig viewConfig = (ViewConfig) context.getAttribute(viewName);
   if (viewConfig == null) {
     viewConfig = viewConfigManager.getViewConfig(viewName);
     context.setAttribute(viewName, viewConfig);
   }
   return viewConfig;
 }
Exemplo n.º 2
0
 @SuppressWarnings("unchecked")
 private Map<String, String> doUserQuerySchemas() {
   DoradoContext context = DoradoContext.getCurrent();
   Map<String, String> querySchemas =
       (Map<String, String>) context.getAttribute(DoradoContext.SESSION, QUERY_SCHEMAS_KEY);
   if (querySchemas == null) {
     querySchemas = new LinkedHashMap<String, String>();
     querySchemas.putAll(QUERY_SCHEMAS);
     context.setAttribute(DoradoContext.SESSION, QUERY_SCHEMAS_KEY, querySchemas);
   }
   return querySchemas;
 }
 public DataProvider getDataProvider(String dataProviderId) throws Exception {
   DataProvider dataProvider;
   // 判断是否View中的私有DataProvider
   if (dataProviderId.startsWith(PRIVATE_VIEW_OBJECT_PREFIX)) {
     ParsedDataObjectName parsedName = new ParsedDataObjectName(dataProviderId);
     ViewConfig viewConfig = getViewConfig(DoradoContext.getCurrent(), parsedName.getViewName());
     dataProvider = viewConfig.getDataProvider(parsedName.getDataObject());
   } else {
     dataProvider = dataProviderManager.getDataProvider(dataProviderId);
   }
   return dataProvider;
 }