protected InvCatalogRef readCatalogRef(InvCatalogImpl cat, InvDatasetImpl parent, Element catRefElem, URI baseURI) { String title = catRefElem.getAttributeValue("title", xlinkNS); if (title == null) title = catRefElem.getAttributeValue("name"); String href = catRefElem.getAttributeValue("href", xlinkNS); String useRemCatSerStr = catRefElem.getAttributeValue("useRemoteCatalogService"); Boolean useRemoteCatalogService = null; if (useRemCatSerStr != null) useRemoteCatalogService = Boolean.parseBoolean(useRemCatSerStr); InvCatalogRef catRef = new InvCatalogRef(parent, title, href, useRemoteCatalogService); readDatasetInfo(cat, catRef, catRefElem, baseURI); return catRef; }
private Element writeCatalogRef( InvCatalogRef catRef) { Element catrefElem = new Element("catalogRef", defNS); catrefElem.setAttribute("href", catRef.getXlinkHref(), xlinkNS); String name = catRef.getName() == null ? "" : catRef.getName(); catrefElem.setAttribute("title", name, xlinkNS); if ( catRef.getID() != null ) catrefElem.setAttribute("ID", catRef.getID() ); if (catRef.getRestrictAccess() != null) catrefElem.setAttribute("restrictAccess", catRef.getRestrictAccess()); catrefElem.setAttribute("name", ""); /* List list = catRef.getDocumentation(); for (int j=0; j< list.size(); j++) { InvDocumentation doc = (InvDocumentation) list.get(j); catrefElem.addContent( writeDocumentation(doc, "documentation")); } */ return catrefElem; }
private synchronized void read() { if (init) return; URI uriResolved = getURI(); if (uriResolved == null) { // this is to display an error message proxy = new InvDatasetImpl(null, "HREF ERROR"); proxy.addProperty(new InvProperty("HREF ERROR", errMessage)); datasets.add(proxy); init = true; return; } // open and read the referenced catalog XML try { if (debug) System.out.println(" InvCatalogRef read " + getFullName() + " hrefResolved = " + uriResolved); InvCatalogFactory factory = InvCatalogFactory.getDefaultFactory(true); // InvCatalogFactory factory = ((InvCatalogImpl) getParentCatalog()).getCatalogFactory(); InvCatalogImpl cat = factory.readXML(uriResolved.toString()); finishCatalog(cat); } catch (Exception e) { // this is to display an error message proxy = new InvDatasetImpl(null, "HREF ERROR"); if (debug) System.out.println("HREF ERROR =\n " + href + " err= " + e.getMessage()); proxy.addProperty(new InvProperty("HREF ERROR", href)); datasets.add(proxy); init = true; } }
private InvCatalogRef createCatalogRefDataset() { final InvCatalogRef catalogRef = new InvCatalogRef(null, "catalogName", "irrelevant"); catalogRef.setCatalog(catalog); return catalogRef; }
public static void appendCatalogNode(MutableTreeNode parentNode, DefaultTreeModel treeModel, InvCatalogRef catalogRef) { final DefaultMutableTreeNode catalogNode = new DefaultMutableTreeNode(catalogRef.getName()); final String catalogPath = catalogRef.getURI().toASCIIString(); final CatalogNode opendapNode = new CatalogNode(catalogPath, catalogRef); opendapNode.setCatalogUri(catalogPath); catalogNode.add(new DefaultMutableTreeNode(opendapNode)); treeModel.insertNodeInto(catalogNode, parentNode, parentNode.getChildCount()); }
resultDs = new InvCatalogRef( null, catRef.getName(), catRef.getXlinkHref()); } else { resultDs = new InvDatasetImpl( null, dataset.getName() );
boolean isCatRef = (ds instanceof InvCatalogRef); if (filter != null && filter.skipAll(ds)) { if (isCatRef && release) ((InvCatalogRef) ds).release(); return; InvCatalogRef catref = (InvCatalogRef) ds; if (out != null) out.println(" **CATREF " + catref.getURI() + " (" + ds.getName() + ") "); countCatrefs++; if (release) catref.release(); return; InvCatalogRef catref = (InvCatalogRef) ds; if (!isDataScan) { listen.getDataset(catref.getProxyDataset(), context); // wait till a catref is read, so all metadata is there ! catref.release();
String name = catRef.getName(); String href = catRef.getXlinkHref(); URI uri; try
parentCatalog = (InvCatalogImpl) getParentCatalog(); DatasetFilter filter = parentCatalog.getDatasetFilter(); if (filter != null) String name = getName().trim(); String proxyName = proxy.getName().trim();
boolean isCatRef = (ds instanceof InvCatalogRef); if (filter != null && filter.skipAll(ds)) { if (isCatRef && release) ((InvCatalogRef) ds).release(); return; InvCatalogRef catref = (InvCatalogRef) ds; if (out != null) out.println(" **CATREF " + catref.getURI() + " (" + ds.getName() + ") "); countCatrefs++; if (release) catref.release(); return; catref.release();
InvCatalogRef filesCat = new InvCatalogRef(this, FILES, getCatalogHref(FILES)); filesCat.finish(); datasets.add(filesCat);
caller.setCatalog((InvCatalogImpl) getParentCatalog()); return; java.net.URI uri = getParentCatalog().resolveUri(href); hrefResolved = uri.toString(); if (debug) System.out.println(" InvCatalogRef readXMLasynch " + getFullName() + " hrefResolved = " + hrefResolved); factory.readXMLasynch(hrefResolved, new Callback(caller));
if (ds instanceof InvCatalogRef) { // LOOK !! InvCatalogRef catref = (InvCatalogRef) ds; uri = catref.getURI(); href = uri.toString(); int pos = href.lastIndexOf('.');
InvCatalogRef catref = (InvCatalogRef) ds; String href = resolveRelativeUrls || catrefEvents ? resolve(ds, catref.getXlinkHref()) : catref.getXlinkHref(); if (catrefEvents) href = "catref:" + href; buff.append(" <li><em>CatalogRef: </em>").append(makeHref(href, null)).append("</li>\n");
@Override boolean check(StringBuilder out, boolean show) { boolean isValid = true; // no longer need default service for FC 3/11/14 /* if (getServiceDefault() == null) { out.append("**Warning: Dataset (").append(getFullName()).append("): has no default service\n"); isValid = false; } */ return isValid && super.check(out, show); }
/** * @return Xlink reference as a URI, resolved */ public URI getURI() { if (uri != null) return uri; // may be reletive try { return getParentCatalog().resolveUri(href); } catch (java.net.URISyntaxException e) { errMessage = "URISyntaxException on url " + href + " = " + e.getMessage(); return null; } }
resultDs = new InvCatalogRef( null, catRef.getName(), catRef.getXlinkHref()); } else { resultDs = new InvDatasetImpl( null, dataset.getName() );
boolean isCatRef = (ds instanceof InvCatalogRef); if (filter != null && filter.skipAll(ds)) { if (isCatRef && release) ((InvCatalogRef) ds).release(); return; InvCatalogRef catref = (InvCatalogRef) ds; if (out != null) out.println(" **CATREF " + catref.getURI() + " (" + ds.getName() + ") "); countCatrefs++; if (release) catref.release(); return; InvCatalogRef catref = (InvCatalogRef) ds; if (!isDataScan) { listen.getDataset(catref.getProxyDataset(), context); // wait till a catref is read, so all metadata is there ! catref.release();
String name = catRef.getName(); String href = catRef.getXlinkHref(); URI uri; try
parentCatalog = (InvCatalogImpl) getParentCatalog(); DatasetFilter filter = parentCatalog.getDatasetFilter(); if (filter != null) String name = getName().trim(); String proxyName = proxy.getName().trim();