Пример #1
0
 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;
 }
Пример #2
0
  /**
   * Skips id, oldId and uuid but clones the rest of the info. Bundles retain ids.
   *
   * @return cloned object with bundles
   */
  public View cloneBasicInfo() {
    View view = new View();
    //        // skip id, oldId, uuid, isDefault
    // skip id, oldId, uuid
    view.setName(getName());
    view.setDescription(getDescription());
    view.setType(getType());
    view.setDevelopmentPath(getDevelopmentPath());
    view.setApplication(getApplication());
    view.setIsPublic(isPublic());
    view.setLang(getLang());
    view.setPage(getPage());
    view.setPubDomain(getPubDomain());
    view.setIsDefault(isDefault());
    for (Bundle bundle : getBundles()) {
      view.addBundle(bundle.clone());
    }

    return view;
  }