private static seriesCatalogType createSeriesCatalog( seriesCatalogDataSet ds, VariablesDataset vds) { if (ds.SeriesCatalog.Count > 0) { Boolean useOD; String siteServiceURL; String siteServiceName; try { useOD = Boolean.Parse(ConfigurationManager.AppSettings["UseODForValues"]); if (!useOD) { siteServiceURL = ConfigurationManager.AppSettings["externalGetValuesService"]; siteServiceName = ConfigurationManager.AppSettings["externalGetValuesName"]; } else { siteServiceURL = "http://localhost/"; siteServiceName = "OD Web Services"; } } catch { useOD = true; // should be caught earlier siteServiceURL = "http://locahost/"; siteServiceName = "Fix UseODForValues, externalGetValuesService, externalGetValuesName"; } seriesCatalogType catalog = CuahsiBuilder.CreateSeriesCatalog( ds.SeriesCatalog.Count, siteServiceName, // menu name (aka OD name siteServiceURL // web service location ); List <seriesCatalogTypeSeries> seriesRecords = new List <seriesCatalogTypeSeries>(); foreach (seriesCatalogDataSet.SeriesCatalogRow row in ds.SeriesCatalog.Rows) { seriesCatalogTypeSeries aRecord = row2SeriesCatalogElement( row, ds, vds); seriesRecords.Add(aRecord); } catalog.series = seriesRecords.ToArray(); return(catalog); } else { seriesCatalogType catalog = CuahsiBuilder.CreateSeriesCatalog(0, null, // menu name (aka OD name String.Empty // web service location ); return(catalog); } }
public static seriesCatalogType CreateSeriesCatalog( int variableCount, string serviceName, string serviceUrl) { seriesCatalogType por = new seriesCatalogType(); por.menuGroupName = serviceName; por.serviceWsdl = serviceUrl; por.series = new seriesCatalogTypeSeries[variableCount]; for (int i = 0; i < variableCount; i++) { por.series[i] = new seriesCatalogTypeSeries(); por.series[i].variable = CreateVariableDescriptionType(); por.series[i].valueCount = new seriesCatalogTypeSeriesValueCount(); } return(por); }
public static seriesCatalogType[] dataSet2SeriesCatalog(seriesCatalogDataSet ds, VariablesDataset vds, ControlledVocabularyDataset vocabularyDataset) { /* logic * for each sourceID that is associated with the site * * */ List <seriesCatalogType> catalogs = new List <seriesCatalogType>(); seriesCatalogType catalog = createSeriesCatalog(ds, vds, vocabularyDataset); if (catalog != null) { catalogs.Add(catalog); } return(catalogs.ToArray()); }
// do one at a time public seriesCatalogType[] GetSeries(locationParam lp) { // for this we are only doing one, but multiple can come back List <seriesCatalogType> seriesCatalogs = new List <seriesCatalogType>(); // seriesCatalog is built from array of series #region build series { List <seriesCatalogTypeSeries> series = new List <seriesCatalogTypeSeries>(); UsgsDbDailyValues.seriesCatalogDataTable scDs = new UsgsDbDailyValues.seriesCatalogDataTable(); UsgsDbDailyValuesTableAdapters.seriesCatalogTableAdapter tableAdaptor = new seriesCatalogTableAdapter(); if (lp != null) { if (lp.SiteCode != null) { tableAdaptor.FillBySiteCode(scDs, lp.SiteCode); } } foreach (UsgsDbDailyValues.seriesCatalogRow row in scDs.Rows) { seriesCatalogTypeSeries s = row2Series(row); if (s != null) { series.Add(s); } } // add the list of series to the seriesCatalogType aCatalog = new seriesCatalogType(); aCatalog.series = series.ToArray(); seriesCatalogs.Add(aCatalog); } #endregion return(seriesCatalogs.ToArray()); }
/// <summary> /// Populates the serviceWSDL, and menuGroupNames for the provided SeriesCatalog. /// </summary> /// <param name="WsdlUrl">The base URL of the web service that has the GetValues service, without the page name</param> /// <param name="ServiceMenuName">The menu name that may optionally be dsiplyed to clients</param> /// <param name="SeriesCatalog">A seriesCatalog</param> public static void AddGetValuesWSDLLocation(String WsdlUrl, String ServiceMenuName, seriesCatalogType SeriesCatalog) { SeriesCatalog.serviceWsdl = WsdlUrl; SeriesCatalog.menuGroupName = ServiceMenuName; }
/// <summary> /// Populates the serviceWSDL, and menuGroupNames for the provided SeriesCatalog. /// </summary> /// <param name="WsdlBaseUrl">The base URL of the web service that has the GetValues service, without the page name</param> /// <param name="AsmxPage">The name of the page with the .asmx </param> /// <param name="ServiceMenuName">The menu name that may optionally be dsiplyed to clients</param> /// <param name="SeriesCatalog">A seriesCatalog</param> public static void AddGetValuesWSDLLocation(String WsdlBaseUrl, String AsmxPage, String ServiceMenuName, seriesCatalogType SeriesCatalog) { AddGetValuesWSDLLocation(WsdlBaseUrl + AsmxPage, ServiceMenuName, SeriesCatalog); }
//GetValuesName, ServiceMenuName /// <summary> /// /// Requires application properties: /// asmxPage /// GetValuesName /// </summary> /// <param name="Context"></param> /// <param name="SeriesCatalog"></param> public static void AddGetValuesWSDLLocation(HttpContext Context, seriesCatalogType SeriesCatalog) { AddGetValuesWSDLLocation(UrlFromContext(Context), ConfigurationManager.AppSettings["GetValuesName"], SeriesCatalog); }
public static seriesCatalogType CreateSeriesCatalog( int variableCount, string serviceName, string serviceUrl) { seriesCatalogType por = new seriesCatalogType(); por.menuGroupName = serviceName; por.serviceWsdl = serviceUrl; por.series = new seriesCatalogTypeSeries[variableCount]; for (int i = 0; i < variableCount; i++) { por.series[i] = new seriesCatalogTypeSeries(); por.series[i].variable = CreateVariableDescriptionType(); por.series[i].valueCount = new seriesCatalogTypeSeriesValueCount(); } return por; }