Esempio n. 1
0
 public ListViewData(Person currentPerson, WebServiceToken webServiceAccessToken, List <WebServiceDocumentation> serviceDocumentationList)
     : base(currentPerson)
 {
     ServiceDocumentationList = serviceDocumentationList;
     WebServiceAccessToken    = webServiceAccessToken;
     PageTitle = "List of Web Services";
 }
Esempio n. 2
0
 public IndexViewData(Person currentPerson, WebServiceToken webServiceAccessToken, List <WebServiceDocumentation> serviceDocumentationList) : base(currentPerson, NeptuneArea.OCStormwaterTools)
 {
     WebServiceAccessToken    = webServiceAccessToken;
     ServiceDocumentationList = serviceDocumentationList;
     EntityName = "Web Services";
     PageTitle  = "Web Services";
 }
Esempio n. 3
0
        public ListViewData(FirmaSession currentFirmaSession, WebServiceToken userWebServiceAccessToken,
                            List <WebServiceDocumentation> serviceDocumentationList, List <GeospatialAreaType> geospatialAreaTypeList, ProjectFirmaModels.Models.FirmaPage firmaPage)
            : base(currentFirmaSession, firmaPage)
        {
            ServiceDocumentationList  = serviceDocumentationList;
            UserWebServiceAccessToken = userWebServiceAccessToken;
            PageTitle = "List of Web Services";
            GeospatialAreaTypeList = geospatialAreaTypeList;

            if (MultiTenantHelpers.GetTenantAttributeFromCache().GeoServerNamespace != null)
            {
                GeoServerServiceDocumentationList = new List <GeoServerServiceDocumentation>
                {
                    new GeoServerServiceDocumentation("WFS 2.0.0",
                                                      "Provides project simple locations, project detailed locations, and geospatial area features in vector format and can be consumed or added to geospatial applications such as ArcGIS or QGIS.",
                                                      "wfs"),
                    new GeoServerServiceDocumentation("WMS 1.3.0",
                                                      "Provides project simple locations, project detailed locations, and geospatial area features and can be consumed or added to geospatial applications such as ArcGIS or QGIS.",
                                                      "wms")
                };
            }
            else
            {
                GeoServerServiceDocumentationList = new List <GeoServerServiceDocumentation>();
            }
        }
Esempio n. 4
0
        public ViewResult Index()
        {
            var allMethods = FindAttributedMethods(typeof(PowerBIController), typeof(WebServiceNameAndDescriptionAttribute));
            var serviceDocumentationList = allMethods.Select(c => new WebServiceDocumentation(c)).OrderBy(c => c.Name).ToList();
            var webServiceAccessToken    = new WebServiceToken(CurrentPerson.WebServiceAccessToken.ToString());
            var viewData = new IndexViewData(CurrentPerson, webServiceAccessToken, serviceDocumentationList);

            return(RazorView <Index, IndexViewData>(viewData));
        }
Esempio n. 5
0
        public string GetParameters(WebServiceToken userToken)
        {
            if (!_parameters.Any())
            {
                return(String.Empty);
            }

            return(string.Join(", ", _parameters));
        }
Esempio n. 6
0
        public string GetExampleJsonUrl(WebServiceToken userToken)
        {
            if (String.IsNullOrEmpty(_exampleJsonUrl))
            {
                return(String.Empty);
            }

            return(_exampleJsonUrl.Replace(WebServiceToken.WebServiceTokenGuidForUnitTests.ToString(), userToken.ToString()));
        }
Esempio n. 7
0
        public string GetExampleCsvUrl(WebServiceToken userToken)
        {
            if (String.IsNullOrEmpty(_exampleCsvUrl))
            {
                return(String.Empty);
            }

            return(_exampleCsvUrl.Replace(WebServiceToken.WebServiceTokenGuidForParameterizedReplacement.ToString(), userToken.ToString()));
        }
Esempio n. 8
0
        public JsonResult LandUseStatistics([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.vPowerBILandUseStatistics.ToList();


            return(new JsonResult()
            {
                Data = data,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = int.MaxValue
            });
        }
Esempio n. 9
0
        private static T CommandWrapper <T>(string allegedWebServiceTokenString, Func <WebServiceToken, T> func)
        {
            var webServiceToken = new WebServiceToken(allegedWebServiceTokenString);

            // To prevent code from doing Notifications and any other stuff for production bits only, temporarily mark this thread here to be in Unit Test Mode
            if (webServiceToken.IsWebServiceTokenForUnitTests)
            {
                BrowserAutomationCookie.SetIsRunningUnderWebBrowserAutomation();
            }

            return(func.Invoke(webServiceToken));
        }
Esempio n. 10
0
        public JsonResult TreatmentBMPAttributeSummary([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.vPowerBITreatmentBMPs.Select(x => new TreatmentBMPForPowerBI
            {
                PrimaryKey                              = x.PrimaryKey,
                TreatmentBMPName                        = x.TreatmentBMPName,
                Jurisdiction                            = x.Jurisdiction,
                LocationLon                             = x.LocationLon,
                LocationLat                             = x.LocationLat,
                Watershed                               = x.Watershed,
                DelineationType                         = x.DelineationType,
                WaterQualityManagementPlanID            = x.WaterQualityManagementPlanID,
                TreatmentBMPModelingAttributeID         = x.TreatmentBMPModelingAttributeID,
                TreatmentBMPID                          = x.PrimaryKey,
                TreatmentBMPTypeName                    = x.TreatmentBMPTypeName,
                UpstreamTreatmentBMPID                  = x.UpstreamTreatmentBMPID,
                AverageDivertedFlowrate                 = x.AverageDivertedFlowrate,
                AverageTreatmentFlowrate                = x.AverageTreatmentFlowrate,
                DesignDryWeatherTreatmentCapacity       = x.DesignDryWeatherTreatmentCapacity,
                DesignLowFlowDiversionCapacity          = x.DesignLowFlowDiversionCapacity,
                DesignMediaFiltrationRate               = x.DesignMediaFiltrationRate,
                DesignResidenceTimeforPermanentPool     = x.DesignResidenceTimeforPermanentPool,
                DiversionRate                           = x.DiversionRate,
                DrawdownTimeforWQDetentionVolume        = x.DrawdownTimeforWQDetentionVolume,
                EffectiveFootprint                      = x.EffectiveFootprint,
                EffectiveRetentionDepth                 = x.EffectiveRetentionDepth,
                InfiltrationDischargeRate               = x.InfiltrationDischargeRate,
                InfiltrationSurfaceArea                 = x.InfiltrationSurfaceArea,
                MediaBedFootprint                       = x.MediaBedFootprint,
                PermanentPoolorWetlandVolume            = x.PermanentPoolorWetlandVolume,
                RoutingConfigurationID                  = x.RoutingConfigurationID,
                StorageVolumeBelowLowestOutletElevation = x.StorageVolumeBelowLowestOutletElevation,
                SummerHarvestedWaterDemand              = x.SummerHarvestedWaterDemand,
                TimeOfConcentrationID                   = x.TimeOfConcentrationID,
                DrawdownTimeForDetentionVolume          = x.DrawdownTimeForDetentionVolume,
                TotalEffectiveBMPVolume                 = x.TotalEffectiveBMPVolume,
                TotalEffectiveDrywellBMPVolume          = x.TotalEffectiveDrywellBMPVolume,
                TreatmentRate                           = x.TreatmentRate,
                UnderlyingHydrologicSoilGroupID         = x.UnderlyingHydrologicSoilGroupID,
                UnderlyingInfiltrationRate              = x.UnderlyingInfiltrationRate,
                WaterQualityDetentionVolume             = x.WaterQualityDetentionVolume,
                WettedFootprint                         = x.WettedFootprint,
                WinterHarvestedWaterDemand              = x.WinterHarvestedWaterDemand
            });

            return(new JsonResult()
            {
                Data = data,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = int.MaxValue
            });
        }
Esempio n. 11
0
        public ContentResult BaselineModelResults([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var jobjects = HttpRequestStorage.DatabaseEntities.NereidResults.Where(x => x.IsBaselineCondition).ToList()
                           .Select(x =>
            {
                var jobject = JObject.Parse(x.FullResponse);
                jobject["TreatmentBMPID"] = x.TreatmentBMPID;
                jobject["WaterQualityManagementPlanID"] = x.WaterQualityManagementPlanID;
                jobject["DelineationID"]      = x.DelineationID;
                jobject["RegionalSubbasinID"] = x.RegionalSubbasinID;
                return(jobject);
            }).ToList();

            return(Content(new JArray(jobjects).ToString()));
        }
Esempio n. 12
0
        public JsonResult CentralizedBMPLoadGeneratingUnitMapping([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.vPowerBICentralizedBMPLoadGeneratingUnits.Select(x => new
            {
                x.LoadGeneratingUnitID,
                x.TreatmentBMPID
            });

            return(new JsonResult()
            {
                Data = data,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = int.MaxValue
            });
        }
Esempio n. 13
0
        public JsonResult TreatmentBMPParameterizationSummary([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.TreatmentBMPs
                       .Where(x => x.TreatmentBMPType.IsAnalyzedInModelingModule).ToList().Select(x => new
            {
                x.TreatmentBMPID,
                x.TreatmentBMPName,
                x.TreatmentBMPType.TreatmentBMPTypeName,
                FullyParameterized  = x.IsFullyParameterized() ? "Yes" : "No",
                IsReadyForMovedling = x.IsFullyParameterized() && x.HasVerifiedDelineationForModelingPurposes(new List <int>()) ? "Yes" : "No"
            });

            return(new JsonResult()
            {
                Data = data,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = int.MaxValue
            });
        }
Esempio n. 14
0
        public ActionResult WaterQualityManagementPlanOAndMVerifications([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.vPowerBIWaterQualityManagementPlanOAndMVerifications.ToList().Select(x => new
            {
                WQMPID = x.PrimaryKey,
                x.WQMPName,
                x.Jurisdiction,
                VerificationDate = x.VerificationDate.ToString(CultureInfo.InvariantCulture),
                LastEditedDate   = x.LastEditedDate.ToString(CultureInfo.InvariantCulture),
                x.LastEditedBy,
                x.TypeOfVerification,
                x.VisitStatus,
                x.VerificationStatus,
                x.SourceControlCondition,
                x.EnforcementOrFollowupActions,
                x.DraftOrFinalized
            });

            //JsonResult serializes ampersands to be their unicode values because it uses JavascriptSerializer
            //JsonConvert does not
            //Returning this way to protect the MANY ampersands we encounter in this particular method
            return(Content(JsonConvert.SerializeObject(data), "application/json"));
        }
Esempio n. 15
0
        public JsonResult WaterQualityManagementPlanAttributeSummary([ParameterDescription("Authorization Token")] WebServiceToken webServiceToken)
        {
            var data = HttpRequestStorage.DatabaseEntities.vPowerBIWaterQualityManagementPlans.ToList().Select(x => new
            {
                x.WaterQualityManagementPlanID,
                Name            = x.WaterQualityManagementPlanName,
                Jurisdiction    = x.OrganizationName,
                Status          = x.WaterQualityManagementPlanStatusDisplayName,
                DevelopmentType = x.WaterQualityManagementPlanDevelopmentTypeDisplayName,
                LandUse         = x.WaterQualityManagementPlanLandUseDisplayName,
                PermitTerm      = x.WaterQualityManagementPlanPermitTermDisplayName,
                x.ApprovalDate,
                x.DateOfConstruction,
                HydromodificationApplies = x.HydromodificationAppliesDisplayName,
                HydrologicSubarea        = x.HydrologicSubareaName,
                x.RecordedWQMPAreaInAcres,
                TrashCaptureStatus = x.TrashCaptureStatusTypeDisplayName,
                x.TrashCaptureEffectiveness,
                x.ModelingApproach
            });

            return(Json(data, JsonRequestBehavior.AllowGet));
        }