private InvDataset createDataset( InvCatalog catalog, String datasetName, final String serviceName) { final InvDatasetImpl dapDataset = new InvDatasetImpl( null, datasetName, FeatureType.NONE, serviceName, "http://wherever.you.want.bc"); dapDataset.setCatalog(catalog); final InvService dapService = new InvService(serviceName, serviceName, "irrelevant", "irrelevant", "irrelevant"); dapDataset.addAccess(new InvAccessImpl(dapDataset, "http://y.z", dapService)); dapDataset.finish(); return dapDataset; }
public void store2Dataset() { PersistentBean persBean = new PersistentBean(dataset); // reset the BeanMaps setStoreValue(NAME, persBean, false); setStoreValue(ID, persBean, false); setStoreValue(AUTHORITY, persBean, true); setStoreValue(SERVICE_NAME, persBean, true); setStoreValue(FORMAT_TYPE, persBean, true); setStoreValue(DATA_TYPE, persBean, true); setStoreValue(COLLECTION_TYPE, persBean, false); setStoreValue(HARVEST, persBean, false); String gcType = (String) metadataPP.getFieldValue(GC_TYPE); if (!gcType.equals(INHERITED)) { ThreddsMetadata.GeospatialCoverage gc = new ThreddsMetadata.GeospatialCoverage(); storeGC(new PersistentBean(gc)); if (gcType.equals(LOCAL)) { dataset.getLocalMetadata().setGeospatialCoverage(gc); dataset.getLocalMetadataInheritable().setGeospatialCoverage(null); } else { dataset.getLocalMetadata().setGeospatialCoverage(null); dataset.getLocalMetadataInheritable().setGeospatialCoverage(gc); } } String tcType = (String) metadataPP.getFieldValue(TC_TYPE); if (!tcType.equals(INHERITED)) { DateRange dateRange = dateRangeSelector.getDateRange(); if (tcType.equals(LOCAL)) { dataset.getLocalMetadata().setTimeCoverage(dateRange); dataset.getLocalMetadataInheritable().setTimeCoverage((DateRange) null); } else { dataset.getLocalMetadata().setTimeCoverage((DateRange) null); dataset.getLocalMetadataInheritable().setTimeCoverage(dateRange); } } setStoreValue(SUMMARY, persBean, true); setStoreValue(RIGHTS, persBean, true); setStoreValue(HISTORY, persBean, true); setStoreValue(PROCESSING, persBean, true); // storeBeanList( variablesFld, VARIABLES, persBean); storeBeanList(creatorsFld, CREATORS, persBean); storeBeanList(publishersFld, PUBLISHERS, persBean); storeBeanList(projectsFld, PROJECTS, persBean); storeBeanList(keywordsFld, KEYWORDS, persBean); storeBeanList(datesFld, DATES, persBean); storeBeanList(contributorsFld, CONTRIBUTORS, persBean); storeBeanList(docsFld, DOCUMENTATION, persBean); if (dataset instanceof InvDatasetScan) { setStoreValue(dscanPP, DSCAN_PATH, persBean, false); setStoreValue(dscanPP, DSCAN_DIR, persBean, false); // setStoreValue( dscanPP, DSCAN_FILTER, persBean, false); setStoreValue(dscanPP, DSCAN_ADDSIZE, persBean, false); // setStoreValue( dscanPP, DSCAN_ADDLATEST, persBean, false); // setStoreValue( dscanPP, DSCAN_TC_MATCH, persBean, false); // setStoreValue( dscanPP, DSCAN_TC_SUBS, persBean, false); // setStoreValue( dscanPP, DSCAN_TC_DURATOPN, persBean, false); } dataset.finish(); }