Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
location_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2018 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 /*
17  * location_jobs.h
18  *
19  * Created on: 5 Oct 2018
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_LOCATION_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_LOCATION_JOBS_H_
25 
28 #include "address.h"
29 #include "location.h"
30 
31 #include "string_parameter.h"
32 
33 
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
37 #ifdef ALLOCATE_LOCATION_JOB_CONSTANTS
38  #define LOCATION_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_API
39  #define LOCATION_JOB_STRUCT_VAL(x,y) = { x, y}
40 #else
41  #define LOCATION_JOB_PREFIX extern
42  #define LOCATION_JOB_STRUCT_VAL(x,y)
43 #endif
44 
45 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
46 
47 
48 
49 
50 LOCATION_JOB_PREFIX NamedParameterType LOCATION_NAME LOCATION_JOB_STRUCT_VAL("LO Name", PT_STRING);
51 LOCATION_JOB_PREFIX NamedParameterType LOCATION_STREET LOCATION_JOB_STRUCT_VAL("LO Street", PT_STRING);
52 LOCATION_JOB_PREFIX NamedParameterType LOCATION_TOWN LOCATION_JOB_STRUCT_VAL("LO Town", PT_STRING);
53 LOCATION_JOB_PREFIX NamedParameterType LOCATION_COUNTY LOCATION_JOB_STRUCT_VAL("LO County", PT_STRING);
54 LOCATION_JOB_PREFIX NamedParameterType LOCATION_COUNTRY LOCATION_JOB_STRUCT_VAL("LO Country", PT_STRING);
55 LOCATION_JOB_PREFIX NamedParameterType LOCATION_POSTCODE LOCATION_JOB_STRUCT_VAL("LO Postcode", PT_STRING);
56 LOCATION_JOB_PREFIX NamedParameterType LOCATION_USE_GPS LOCATION_JOB_STRUCT_VAL("LO Use GPS", PT_BOOLEAN);
57 LOCATION_JOB_PREFIX NamedParameterType LOCATION_LATITUDE LOCATION_JOB_STRUCT_VAL("LO Latitude", PT_SIGNED_REAL);
58 LOCATION_JOB_PREFIX NamedParameterType LOCATION_LONGITUDE LOCATION_JOB_STRUCT_VAL("LO Longitude", PT_SIGNED_REAL);
59 LOCATION_JOB_PREFIX NamedParameterType LOCATION_ALTITUDE LOCATION_JOB_STRUCT_VAL("LO Altitude", PT_SIGNED_REAL);
60 
61 
62 LOCATION_JOB_PREFIX NamedParameterType LOCATION_MIN_PH LOCATION_JOB_STRUCT_VAL("LO pH Minimum", PT_UNSIGNED_REAL);
63 LOCATION_JOB_PREFIX NamedParameterType LOCATION_MAX_PH LOCATION_JOB_STRUCT_VAL("LO pH Maximum", PT_UNSIGNED_REAL);
64 LOCATION_JOB_PREFIX NamedParameterType LOCATION_SOIL LOCATION_JOB_STRUCT_VAL("LO Soil", PT_STRING);
65 
66 LOCATION_JOB_PREFIX NamedParameterType LOCATION_TYPE LOCATION_JOB_STRUCT_VAL("LO Type", PT_STRING);
67 
68 
69 LOCATION_JOB_PREFIX NamedParameterType LOCATION_ID LOCATION_JOB_STRUCT_VAL("Location ID", PT_STRING);
70 LOCATION_JOB_PREFIX NamedParameterType LOCATION_GET_ALL_LOCATIONS LOCATION_JOB_STRUCT_VAL("Get all Locations", PT_BOOLEAN);
71 
72 
73 
74 #ifdef __cplusplus
75 extern "C"
76 {
77 #endif
78 
79 
80 
82 
83 
85 
86 
88 
89 
91 
92 
93 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetUpLocationsListParameter (const FieldTrialServiceData *data_p, StringParameter *param_p, const Location *active_location_p, const char *extra_option_s);
94 
95 
97 
98 
100 
101 
103 
104 
106 
107 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetAllLocationsAsJSON (const FieldTrialServiceData *data_p, bson_t *opts_p);
108 
109 
111 
112 
114 
115 
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 
123 
124 
125 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_LOCATION_JOBS_H_ */
AddSearchLocationParams
bool AddSearchLocationParams(ServiceData *data_p, ParameterSet *param_set_p)
SetUpLocationsListParameter
bool SetUpLocationsListParameter(const FieldTrialServiceData *data_p, StringParameter *param_p, const Location *active_location_p, const char *extra_option_s)
RunForSubmissionLocationParams
bool RunForSubmissionLocationParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
GetLocationIndexingData
json_t * GetLocationIndexingData(Service *service_p)
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
GetSubmissionLocationParameterTypeForNamedParameter
bool GetSubmissionLocationParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
GetSearchLocationParameterTypeForNamedParameter
bool GetSearchLocationParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
PT_STRING
A c-style string.
Definition: parameter_type.h:58
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
LOCATION_JOB_STRUCT_VAL
LOCATION_JOB_PREFIX NamedParameterType LOCATION_NAME LOCATION_JOB_STRUCT_VAL("LO Name", PT_STRING)
GetAllLocationsAsJSON
json_t * GetAllLocationsAsJSON(const FieldTrialServiceData *data_p, bson_t *opts_p)
GetLocationFromResource
Location * GetLocationFromResource(DataResource *resource_p, const NamedParameterType location_param_type, FieldTrialServiceData *dfw_data_p)
dfw_field_trial_service_library.h
AddLocationToServiceJob
bool AddLocationToServiceJob(ServiceJob *job_p, Location *location_p, const ViewFormat format, FieldTrialServiceData *data_p)
GetAddressFromLocationString
Address * GetAddressFromLocationString(const char *location_s)
address.h
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
PT_UNSIGNED_REAL
An unsigned real number.
Definition: parameter_type.h:55
StringParameter
Definition: string_parameter.h:32
Address
A datatype for storing a postal address as well as its geographic coordinates if possible.
Definition: address.h:21
PT_BOOLEAN
A boolean parameter.
Definition: parameter_type.h:38
PT_SIGNED_REAL
A real number.
Definition: parameter_type.h:52
location.h
AddSubmissionLocationParams
bool AddSubmissionLocationParams(ServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p)
RunForSearchLocationParams
bool RunForSearchLocationParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
dfw_field_trial_service_data.h
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
FieldTrialServiceData
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ViewFormat
ViewFormat
An indicator of what the output destination is for the JSON data values.
Definition: view_format.h:19
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
GetUnsetLocationValue
const char * GetUnsetLocationValue(void)
Location
Definition: location.h:45
string_parameter.h