@GetMapping("/modules")
  @ResponseBody
  public ModulesConfigResponse getModules(@RequestParam("entity") String entityTypeId) {
    EntityType entityType = dataService.getEntityType(entityTypeId);
    List<Module> modules = dataExplorerService.getModules(entityType);

    ModulesConfigResponse modulesConfigResponse = new ModulesConfigResponse();
    modules.forEach(
        module -> {
          String id;
          String label;
          String icon;

          switch (module) {
            case DATA:
              id = MOD_DATA;
              label = "Data";
              icon = "grid-icon.png";
              break;
            case AGGREGATION:
              id = "aggregates";
              label =
                  messageSource.getMessage(
                      "dataexplorer_aggregates_title", new Object[] {}, getLocale());
              icon = "aggregate-icon.png";
              break;
            case REPORT:
              id = MOD_ENTITIESREPORT;
              label = dataExplorerSettings.getEntityReport(entityTypeId);
              icon = "report-icon.png";
              break;
            default:
              throw new UnexpectedEnumException(module);
          }

          modulesConfigResponse.add(new ModuleConfig(id, label, icon));
        }
@ GetMapping ( "/modules" ) @ ResponseBody public ModulesConfigResponse getModules ( @ RequestParam ( "entity" ) String entityTypeId ) { EntityType entityType = dataService . getEntityType ( entityTypeId ) ; List < Module > modules = dataExplorerService . getModules ( entityType ) ; ModulesConfigResponse modulesConfigResponse = new ModulesConfigResponse ( ) ; modules . forEach ( module -> { String id ; String label ; String icon ; switch ( module ) { case DATA : id = MOD_DATA ; label = "Data" ; icon = "grid-icon.png" ; break ; case AGGREGATION : id = "aggregates" ; label = messageSource . getMessage ( "dataexplorer_aggregates_title" , new Object [ ] { } , getLocale ( ) ) ; icon = "aggregate-icon.png" ; break ; case REPORT : id = MOD_ENTITIESREPORT ; label = dataExplorerSettings . getEntityReport ( entityTypeId ) ; icon = "report-icon.png" ; break ; default : throw new UnexpectedEnumException ( module ) ; } modulesConfigResponse . add ( new ModuleConfig ( id , label , icon ) ) ; }
Returns modules configuration for this entity based on current user permissions.