/**
  * Get Aggregate result field types (
  *
  * @param newcols new column names in resultset
  * @return List of localised method names
  */
 private Map<String, String> getAggregateFieldTypes(List<String> newcols) {
   Map<String, String> map = new HashMap<String, String>();
   for (String col : newcols) {
     map.put(col.replace(" ", "_"), "numeric");
   }
   return map;
 }
 private Bundle addBundle(final View view, final String bundleid) {
   Bundle bundle = view.getBundleByName(bundleid);
   if (bundle == null) {
     log.info("Bundle with id:", bundleid, "not found in currentView - adding");
     if (!bundleCache.containsKey(bundleid)) {
       log.warn("Trying to add bundle that isn't loaded:", bundleid, "- Skipping it!");
       return null;
     }
     bundle = bundleCache.get(bundleid).clone();
     view.addBundle(bundle);
   }
   return bundle;
 }
  public void init() {
    // setup service if it hasn't been initialized
    if (viewService == null) {
      setViewService(new ViewServiceIbatisImpl());
    }

    if (myPlaceService == null) {
      setMyPlacesService(new MyPlacesServiceIbatisImpl());
    }

    if (permissionsService == null) {
      setPermissionsService(new PermissionsServiceIbatisImpl());
    }

    if (bundleService == null) {
      setBundleService(new BundleServiceIbatisImpl());
    }
    final String publishTemplateIdProperty = PropertyUtil.getOptional("view.template.publish");
    PUBLISHED_VIEW_TEMPLATE_ID =
        ConversionHelper.getLong(publishTemplateIdProperty, PUBLISHED_VIEW_TEMPLATE_ID);
    if (publishTemplateIdProperty == null) {
      log.warn("Publish template id not configured (property: view.template.publish)!");
    } else {
      log.info("Using publish template id: ", PUBLISHED_VIEW_TEMPLATE_ID);
    }

    // setup roles authorized to enable drawing tools on published map
    drawToolsEnabledRoles = PropertyUtil.getCommaSeparatedList(PROPERTY_DRAW_TOOLS_ENABLED);

    for (String bundleid : CACHED_BUNDLE_IDS) {
      final Bundle bundle = bundleService.getBundleTemplateByName(bundleid);
      if (bundle == null) {
        log.warn("Couldn't get", bundleid, "bundle template from DB!");
        continue;
      }
      bundleCache.put(bundleid, bundle);
    }
  }