legacy/src/main/java/thredds/catalog/dl/DCWriter.java
public void writeDataset(InvDataset ds, Element rootElem) {

    rootElem.addContent( new Element("title", defNS).addContent(ds.getName()));

    rootElem.addContent( new Element("Entry_ID", defNS).addContent(ds.getUniqueID()));

    // keywords
    List<ThreddsMetadata.Vocab> list = ds.getKeywords();
    if (list.size() > 0) {
      for (ThreddsMetadata.Vocab k : list) {
        rootElem.addContent( new Element("Keyword", defNS).addContent( k.getText()));
      }
    }

    //temporal
    CalendarDateRange tm = ds.getCalendarDateCoverage();
    Element tmElem = new Element("Temporal_Coverage", defNS);
    rootElem.addContent( tmElem);

    tmElem.addContent( new Element("Start_Date", defNS).addContent( tm.getStart().toString()));
    tmElem.addContent( new Element("End_Date", defNS).addContent( tm.getEnd().toString()));

    //geospatial
    ThreddsMetadata.GeospatialCoverage geo = ds.getGeospatialCoverage();
    Element geoElem = new Element("Spatial_Coverage", defNS);
    rootElem.addContent( geoElem);

    geoElem.addContent( new Element("Southernmost_Latitude", defNS).addContent( Double.toString(geo.getLatSouth())));
    geoElem.addContent( new Element("Northernmost_Latitude", defNS).addContent(Double.toString(geo.getLatNorth())));
    geoElem.addContent( new Element("Westernmost_Latitude", defNS).addContent(Double.toString(geo.getLonWest())));
    geoElem.addContent( new Element("Easternmost_Latitude", defNS).addContent(Double.toString(geo.getLonEast())));

    rootElem.addContent( new Element("Use_Constraints", defNS).addContent(ds.getDocumentation("rights")));

    // data center
    List<ThreddsMetadata.Source> slist = ds.getPublishers();
    if (list.size() > 0) {
      for ( ThreddsMetadata.Source p : slist) {
        Element dataCenter = new Element("Data_Center", defNS);
        rootElem.addContent( dataCenter);
        writePublisher(p, dataCenter);
      }
    }

    rootElem.addContent( new Element("Summary", defNS).addContent(ds.getDocumentation("summary")));

    Element primaryURLelem = new Element("Related_URL", defNS);
    rootElem.addContent( primaryURLelem);

    String primaryURL = threddsServerURL +
        "?catalog="+((InvCatalogImpl)ds.getParentCatalog()).getBaseURI().toString() +
        "&dataset="+ds.getID();
    primaryURLelem.addContent( new Element("URL_Content_Type", defNS).addContent("THREDDS access page"));
    primaryURLelem.addContent( new Element("URL", defNS).addContent(primaryURL));

    DateType today = new DateType(false, new Date());
    rootElem.addContent(new Element("DIF_Creation_Date", defNS).addContent(today.toDateTimeStringISO()));

  }
public void writeDataset(InvDataset ds, Element rootElem) {

    rootElem.addContent( new Element("title", defNS).addContent(ds.getName()));

    rootElem.addContent( new Element("Entry_ID", defNS).addContent(ds.getUniqueID()));

    // keywords
    List<ThreddsMetadata.Vocab> list = ds.getKeywords();
    if (list.size() > 0) {
      for (ThreddsMetadata.Vocab k : list) {
        rootElem.addContent( new Element("Keyword", defNS).addContent( k.getText()));
      }
    }

    //temporal
    CalendarDateRange tm = ds.getCalendarDateCoverage();
    Element tmElem = new Element("Temporal_Coverage", defNS);
    rootElem.addContent( tmElem);

    tmElem.addContent( new Element("Start_Date", defNS).addContent( tm.getStart().toString()));
    tmElem.addContent( new Element("End_Date", defNS).addContent( tm.getEnd().toString()));

    //geospatial
    ThreddsMetadata.GeospatialCoverage geo = ds.getGeospatialCoverage();
    Element geoElem = new Element("Spatial_Coverage", defNS);
    rootElem.addContent( geoElem);

    geoElem.addContent( new Element("Southernmost_Latitude", defNS).addContent( Double.toString(geo.getLatSouth())));
    geoElem.addContent( new Element("Northernmost_Latitude", defNS).addContent(Double.toString(geo.getLatNorth())));
    geoElem.addContent( new Element("Westernmost_Latitude", defNS).addContent(Double.toString(geo.getLonWest())));
    geoElem.addContent( new Element("Easternmost_Latitude", defNS).addContent(Double.toString(geo.getLonEast())));

    rootElem.addContent( new Element("Use_Constraints", defNS).addContent(ds.getDocumentation("rights")));

    // data center
    List<ThreddsMetadata.Source> slist = ds.getPublishers();
    if (list.size() > 0) {
      for ( ThreddsMetadata.Source p : slist) {
        Element dataCenter = new Element("Data_Center", defNS);
        rootElem.addContent( dataCenter);
        writePublisher(p, dataCenter);
      }
    }

    rootElem.addContent( new Element("Summary", defNS).addContent(ds.getDocumentation("summary")));

    Element primaryURLelem = new Element("Related_URL", defNS);
    rootElem.addContent( primaryURLelem);

    String primaryURL = threddsServerURL +
        "?catalog="+((InvCatalogImpl)ds.getParentCatalog()).getBaseURI().toString() +
        "&dataset="+ds.getID();
    primaryURLelem.addContent( new Element("URL_Content_Type", defNS).addContent("THREDDS access page"));
    primaryURLelem.addContent( new Element("URL", defNS).addContent(primaryURL));

    DateType today = new DateType(false, new Date());
    rootElem.addContent(new Element("DIF_Creation_Date", defNS).addContent(today.toDateTimeStringISO()));

  }
public void writeDataset ( InvDataset ds , Element rootElem ) { rootElem . addContent ( new Element ( "title" , defNS ) . addContent ( ds . getName ( ) ) ) ; rootElem . addContent ( new Element ( "Entry_ID" , defNS ) . addContent ( ds . getUniqueID ( ) ) ) ; // keywords List < ThreddsMetadata . Vocab > list = ds . getKeywords ( ) ; if ( list . size ( ) > 0 ) { for ( ThreddsMetadata . Vocab k : list ) { rootElem . addContent ( new Element ( "Keyword" , defNS ) . addContent ( k . getText ( ) ) ) ; } } //temporal CalendarDateRange tm = ds . getCalendarDateCoverage ( ) ; Element tmElem = new Element ( "Temporal_Coverage" , defNS ) ; rootElem . addContent ( tmElem ) ; tmElem . addContent ( new Element ( "Start_Date" , defNS ) . addContent ( tm . getStart ( ) . toString ( ) ) ) ; tmElem . addContent ( new Element ( "End_Date" , defNS ) . addContent ( tm . getEnd ( ) . toString ( ) ) ) ; //geospatial ThreddsMetadata . GeospatialCoverage geo = ds . getGeospatialCoverage ( ) ; Element geoElem = new Element ( "Spatial_Coverage" , defNS ) ; rootElem . addContent ( geoElem ) ; geoElem . addContent ( new Element ( "Southernmost_Latitude" , defNS ) . addContent ( Double . toString ( geo . getLatSouth ( ) ) ) ) ; geoElem . addContent ( new Element ( "Northernmost_Latitude" , defNS ) . addContent ( Double . toString ( geo . getLatNorth ( ) ) ) ) ; geoElem . addContent ( new Element ( "Westernmost_Latitude" , defNS ) . addContent ( Double . toString ( geo . getLonWest ( ) ) ) ) ; geoElem . addContent ( new Element ( "Easternmost_Latitude" , defNS ) . addContent ( Double . toString ( geo . getLonEast ( ) ) ) ) ; rootElem . addContent ( new Element ( "Use_Constraints" , defNS ) . addContent ( ds . getDocumentation ( "rights" ) ) ) ; // data center List < ThreddsMetadata . Source > slist = ds . getPublishers ( ) ; if ( list . size ( ) > 0 ) { for ( ThreddsMetadata . Source p : slist ) { Element dataCenter = new Element ( "Data_Center" , defNS ) ; rootElem . addContent ( dataCenter ) ; writePublisher ( p , dataCenter ) ; } } rootElem . addContent ( new Element ( "Summary" , defNS ) . addContent ( ds . getDocumentation ( "summary" ) ) ) ; Element primaryURLelem = new Element ( "Related_URL" , defNS ) ; rootElem . addContent ( primaryURLelem ) ; String primaryURL = threddsServerURL + "?catalog=" + ( ( InvCatalogImpl ) ds . getParentCatalog ( ) ) . getBaseURI ( ) . toString ( ) + "&dataset=" + ds . getID ( ) ; primaryURLelem . addContent ( new Element ( "URL_Content_Type" , defNS ) . addContent ( "THREDDS access page" ) ) ; primaryURLelem . addContent ( new Element ( "URL" , defNS ) . addContent ( primaryURL ) ) ; DateType today = new DateType ( false , new Date ( ) ) ; rootElem . addContent ( new Element ( "DIF_Creation_Date" , defNS ) . addContent ( today . toDateTimeStringISO ( ) ) ) ; }
/*
<xs:element ref="dc:title"/>
<xs:element ref="dc:creator"/>
<xs:element ref="dc:subject"/>
<xs:element ref="dc:description"/>
<xs:element ref="dc:publisher"/>
<xs:element ref="dc:contributor"/>
<xs:element ref="dc:date"/>
<xs:element ref="dc:type"/>
<xs:element ref="dc:format"/>
<xs:element ref="dc:identifier"/>
<xs:element ref="dc:source"/>
<xs:element ref="dc:language"/>
<xs:element ref="dc:relation"/>
<xs:element ref="dc:coverage"/>
<xs:element ref="dc:rights"/>
<!-- controlled vocabulary from dcmitype -->
<xs:element ref="dcmitype:dcmitype"/>
/ * <xs : element ref = dc : title / > <xs : element ref = dc : creator / > <xs : element ref = dc : subject / > <xs : element ref = dc : description / > <xs : element ref = dc : publisher / > <xs : element ref = dc : contributor / > <xs : element ref = dc : date / > <xs : element ref = dc : type / > <xs : element ref = dc : format / > <xs : element ref = dc : identifier / > <xs : element ref = dc : source / > <xs : element ref = dc : language / > <xs : element ref = dc : relation / > <xs : element ref = dc : coverage / > <xs : element ref = dc : rights / > <! -- controlled vocabulary from dcmitype -- > <xs : element ref = dcmitype : dcmitype / >