private void setupBundle(final View view, final JSONObject publisherData, final String bundleid) { final JSONObject bundleData = publisherData.optJSONObject(bundleid); if (bundleData != null && bundleData.names().length() > 0) { log.info("config found for", bundleid); final Bundle bundle = addBundle(view, bundleid); mergeBundleConfiguration(bundle, bundleData, null); } else { log.warn("config not found for", bundleid, "- removing bundle."); // We have to remove the bundle... // TODO: check if we really want to remove the bundle from view since it could be template // view??? view.removeBundle(bundleid); } }