public static Application parseApplicationDescription(JSONObject topJson, boolean store) throws DBException {
        try {
            JSONObject  appJson;
            appJson = topJson.getJSONObject("application");
            //check if the json specifies the user by name instead of USER_id
            if (!appJson.has("USER_id")) {
                appJson.put("USER_id", (User.getByName(appJson.getString("USER_name"))).getId());
            }
            Application app = new Application(appJson);
            if(store) app.store();
            LOG.debug("loading description for app:" + app.getDescription());
            JSONArray modules = appJson.getJSONArray("modules");
            for (int i = 0; i < modules.length(); i++) {
                JSONObject m = modules.getJSONObject(i);
                m.put("APPLICATION_id", app.getId());
                Module module = new Module(m);
                if(store) module.store();
                LOG.debug("parsed Module:" + module);
                JSONArray components = m.getJSONArray("components");
                for (int j = 0; j < components.length(); j++) {
                    JSONObject c = components.getJSONObject(j);
                    c.put("MODULE_id", ""+module.getId());
                    
                    //check if the json specifies the resource type name instead of the id
                    if (!c.has("RESOURCE_TYPE_id")){ 
                        ResourceType rt= ResourceType.getByName(c.getString("resource_type"));
                        c.put("RESOURCE_TYPE_id", rt.getId());
                    }
                    Component component = new Component(c);
                    if(store) component.store();
                    LOG.debug("parsed component: " + component);
                }//components
            }//modules
            return app;
        } catch (JSONException ex) {
            System.err.println("parsing not successfull");
            ex.printStackTrace();
        }
        return null;
    }