/** * If this dataset has an authority and an ID, then the concatenation of them is the * globally unique ID. * * @return globally unique ID, or null if missing authority or ID. */ public String getUniqueID() { String authority = getAuthority(); if ((authority != null) && (getID() != null)) return authority + ":" + getID(); else if (getID() != null) return getID(); else return null; }
/** * If this dataset has an authority and an ID, then the concatenation of them is the * globally unique ID. * * @return globally unique ID, or null if missing authority or ID. */ public String getUniqueID() { String authority = getAuthority(); if ((authority != null) && (getID() != null)) return authority + ":" + getID(); else if (getID() != null) return getID(); else return null; }
/** * If this dataset has an authority and an ID, then the concatenation of them is the * globally unique ID. * * @return globally unique ID, or null if missing authority or ID. */ public String getUniqueID() { String authority = getAuthority(); if ((authority != null) && (getID() != null)) return authority + ":" + getID(); else if (getID() != null) return getID(); else return null; }
/** * Return the query fragment referencing this dataset, ie "catalog=catalog.xml&dataset=datasetID" * * @return the query fragment for this dataset */ public String getSubsetUrl() { if (getID() == null) return null; return "catalog=" + getParentCatalog().baseURI.toString() + "&dataset=" + getID(); }
/** * Return the query fragment referencing this dataset, ie "catalog=catalog.xml&dataset=datasetID" * * @return the query fragment for this dataset */ public String getSubsetUrl() { if (getID() == null) return null; return "catalog=" + getParentCatalog().baseURI.toString() + "&dataset=" + getID(); }
/** * Return the query fragment referencing this dataset, ie "catalog=catalog.xml&dataset=datasetID" * * @return the query fragment for this dataset */ public String getSubsetUrl() { if (getID() == null) return null; return "catalog=" + getParentCatalog().baseURI.toString() + "&dataset=" + getID(); }
private static URI formDocBaseUriForSubsetCatalog( InvCatalog catalog, InvDataset dataset ) { String catDocBaseUri = catalog.getUriString(); String subsetDocBaseUriString = catDocBaseUri + "/" + ( dataset.getID() != null ? dataset.getID() : dataset.getName() ); try { // URI thisDocBaseUri = ((InvCatalogImpl) catalog ).getBaseURI(); // String uriPath = thisDocBaseUri.getPath() + "/" + ( dataset.getID() != null ? dataset.getID() : dataset.getName() ); // URI subsetDocBaseUri = new URI( thisDocBaseUri.getScheme(), thisDocBaseUri.getUserInfo(), thisDocBaseUri.getHost(), // thisDocBaseUri.getPort(), uriPath, null, null ); return new URI( subsetDocBaseUriString); } catch ( URISyntaxException e ) { // This shouldn't happen. But just in case ... throw new IllegalStateException( "Bad document Base URI for new catalog [" + catalog.getUriString() + "/" + (dataset.getID() != null ? dataset.getID() : dataset.getName()) + "].", e ); } }
private static URI formDocBaseUriForSubsetCatalog( InvCatalog catalog, InvDataset dataset ) { String catDocBaseUri = catalog.getUriString(); String subsetDocBaseUriString = catDocBaseUri + "/" + ( dataset.getID() != null ? dataset.getID() : dataset.getName() ); try { // URI thisDocBaseUri = ((InvCatalogImpl) catalog ).getBaseURI(); // String uriPath = thisDocBaseUri.getPath() + "/" + ( dataset.getID() != null ? dataset.getID() : dataset.getName() ); // URI subsetDocBaseUri = new URI( thisDocBaseUri.getScheme(), thisDocBaseUri.getUserInfo(), thisDocBaseUri.getHost(), // thisDocBaseUri.getPort(), uriPath, null, null ); return new URI( subsetDocBaseUriString); } catch ( URISyntaxException e ) { // This shouldn't happen. But just in case ... throw new IllegalStateException( "Bad document Base URI for new catalog [" + catalog.getUriString() + "/" + (dataset.getID() != null ? dataset.getID() : dataset.getName()) + "].", e ); } }
private void doOneDataset( InvDataset ds) { if (!ds.isHarvest()) { messBuffer.append( " Dataset "+ ds.getName()+ " id = "+ds.getID()+" has harvest = false\n"); } else if (isDatasetUseable( ds, messBuffer)) { String id = StringUtil2.replace(ds.getID(), "/", "-"); String fileOutName = fileDir+"/"+id+".adn.xml"; try { OutputStream out = new BufferedOutputStream(new FileOutputStream( fileOutName)); writeOneItem(ds, out); out.close(); messBuffer.append(" OK on Write\n"); } catch (IOException ioe) { messBuffer.append("FAILED on Write "+ioe.getMessage()+"\n"); ioe.printStackTrace(); } } }
/** * Get URL to this dataset. Dataset must have an ID. * Form is catalogURL#DatasetID * * @return URL to this dataset. */ public String getCatalogUrl() { return getParentCatalog().getUriString() + "#" + getID(); }
private void doOneDataset( InvDataset ds) { if (!ds.isHarvest()) { messBuffer.append( " Dataset "+ ds.getName()+ " id = "+ds.getID()+" has harvest = false\n"); } else if (isDatasetUseable( ds, messBuffer)) { String id = StringUtil2.replace(ds.getID(), "/", "-"); String fileOutName = fileDir+"/"+id+".adn.xml"; try { OutputStream out = new BufferedOutputStream(new FileOutputStream( fileOutName)); writeOneItem(ds, out); out.close(); messBuffer.append(" OK on Write\n"); } catch (IOException ioe) { messBuffer.append("FAILED on Write "+ioe.getMessage()+"\n"); ioe.printStackTrace(); } } }
private void doOneDataset( InvDataset ds) { if (!ds.isHarvest()) { messBuffer.append( " Dataset "+ ds.getName()+ " id = "+ds.getID()+" has harvest = false\n"); } else if (isDatasetUseable( ds, messBuffer)) { String id = StringUtil2.replace(ds.getID(), "/", "-"); String fileOutName = fileDir+"/"+id+".adn.xml"; try { OutputStream out = new BufferedOutputStream(new FileOutputStream( fileOutName)); writeOneItem(ds, out); out.close(); messBuffer.append(" OK on Write\n"); } catch (IOException ioe) { messBuffer.append("FAILED on Write "+ioe.getMessage()+"\n"); ioe.printStackTrace(); } } }
/** * Get URL to this dataset. Dataset must have an ID. * Form is catalogURL#DatasetID * * @return URL to this dataset. */ public String getCatalogUrl() { return getParentCatalog().getUriString() + "#" + getID(); }
/** * Get URL to this dataset. Dataset must have an ID. * Form is catalogURL#DatasetID * * @return URL to this dataset. */ public String getCatalogUrl() { return getParentCatalog().getUriString() + "#" + getID(); }
private void doDataset( InvDataset ds, String fileDir) { if (ds.isHarvest() && (ds.getID() != null)) { String fileOutName = fileDir+"/"+ds.getID()+".dc.xml"; try ( OutputStream out = new BufferedOutputStream(new FileOutputStream(fileOutName))) { writeOneItem(ds, System.out); writeOneItem(ds, out); return; } catch (IOException ioe) { ioe.printStackTrace(); } } for (InvDataset nested : ds.getDatasets()) { doDataset( nested, fileDir); } }
private void doDataset( InvDataset ds, String fileDir) { if (ds.isHarvest() && (ds.getID() != null)) { String fileOutName = fileDir+"/"+ds.getID()+".dc.xml"; try ( OutputStream out = new BufferedOutputStream(new FileOutputStream(fileOutName))) { writeOneItem(ds, System.out); writeOneItem(ds, out); return; } catch (IOException ioe) { ioe.printStackTrace(); } } for (InvDataset nested : ds.getDatasets()) { doDataset( nested, fileDir); } }
public boolean addMetadata( InvDataset dataset ) { InvDataset parentDs = dataset.getParent(); String curId = ( parentDs == null) ? this.baseId : parentDs.getID(); if ( curId == null) curId = this.baseId; if ( dataset.getName() != null && ! dataset.getName().equals( "") ) curId += "/" + dataset.getName(); ( (InvDatasetImpl) dataset).setID( curId ); return ( true ); } }
public boolean addMetadata( InvDataset dataset ) { InvDataset parentDs = dataset.getParent(); String curId = ( parentDs == null) ? this.baseId : parentDs.getID(); if ( curId == null) curId = this.baseId; if ( dataset.getName() != null && ! dataset.getName().equals( "") ) curId += "/" + dataset.getName(); ( (InvDatasetImpl) dataset).setID( curId ); return ( true ); } }
public boolean addMetadata( InvDataset dataset ) { InvDataset parentDs = dataset.getParent(); String curId = ( parentDs == null) ? this.baseId : parentDs.getID(); if ( curId == null) curId = this.baseId; if ( dataset.getName() != null && ! dataset.getName().equals( "") ) curId += "/" + dataset.getName(); ( (InvDatasetImpl) dataset).setID( curId ); return ( true ); } }
void appendToNode(final JTree jTree, List<InvDataset> datasets, MutableTreeNode parentNode, boolean goDeeper) { for (InvDataset dataset : datasets) { final MutableTreeNode deeperParent; if (!goDeeper || !CatalogTreeUtils.isHyraxId(dataset.getID())) { appendToNode(jTree, dataset, parentNode); if (parentNode.getChildCount() == 0) { continue; } deeperParent = (MutableTreeNode) parentNode.getChildAt(parentNode.getChildCount() - 1); } else { deeperParent = parentNode; } if (goDeeper && !(dataset instanceof InvCatalogRef)) { appendToNode(jTree, dataset.getDatasets(), deeperParent, false); } } }