public void reattach(Catalog catalog) { reattach(catalog, false); }
public void reattach(Catalog catalog) { reattach(catalog, false); }
public void init(ImportContext context, boolean prepData) throws IOException { context.reattach(catalog); ImportData data = context.getData(); if (data != null) { addTasks(context, data, prepData); } }
public void init(ImportContext context, boolean prepData) throws IOException { context.reattach(catalog); try { ImportData data = context.getData(); if (data != null) { if (data instanceof RemoteData) { data = ((RemoteData) data).resolve(this); context.setData(data); } addTasks(context, data, prepData); } // switch from init to pending as needed context.setState(ImportContext.State.PENDING); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to init the context ", e); // switch to complete to make the error evident, since we // cannot attach it to a task context.setState(ImportContext.State.INIT_ERROR); context.setMessage(e.getMessage()); return; } }
public ImportContext reattach(ImportContext context) { // reload store and workspace objects from catalog so they are "attached" with // the proper references to the catalog initialized context.reattach(catalog); for (ImportTask task : context.getTasks()) { StoreInfo store = task.getStore(); if (store != null && store.getId() != null) { task.setStore(catalog.getStore(store.getId(), StoreInfo.class)); // ((StoreInfoImpl) task.getStore()).setCatalog(catalog); // @todo remove if the // above sets catalog } if (task.getLayer() != null) { LayerInfo l = task.getLayer(); if (l.getDefaultStyle() != null && l.getDefaultStyle().getId() != null) { l.setDefaultStyle(catalog.getStyle(l.getDefaultStyle().getId())); } if (l.getResource() != null) { ResourceInfo r = l.getResource(); r.setCatalog(catalog); if (r.getStore() == null && resourceMatchesStore(r, store)) { r.setStore(store); } } } } return context; }
public ImportContext reattach(ImportContext context) { //reload store and workspace objects from catalog so they are "attached" with // the proper references to the catalog initialized context.reattach(catalog); for (ImportTask task : context.getTasks()) { StoreInfo store = task.getStore(); if (store != null && store.getId() != null) { task.setStore(catalog.getStore(store.getId(), StoreInfo.class)); //((StoreInfoImpl) task.getStore()).setCatalog(catalog); // @todo remove if the above sets catalog } if (task.getLayer() != null) { LayerInfo l = task.getLayer(); if (l.getDefaultStyle() != null && l.getDefaultStyle().getId() != null) { l.setDefaultStyle(catalog.getStyle(l.getDefaultStyle().getId())); } if (l.getResource() != null) { ResourceInfo r = l.getResource(); r.setCatalog(catalog); if (r.getStore() == null && resourceMatchesStore(r, store)) { r.setStore(store); } } } } return context; }