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.
field_trial_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  * field_trial_jobs.h
18  *
19  * Created on: 1 Oct 2018
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_FIELD_TRIAL_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_FIELD_TRIAL_JOBS_H_
25 
26 
29 
30 #include "field_trial.h"
31 #include "json_processor.h"
32 #include "string_parameter.h"
33 
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
37 #ifdef ALLOCATE_FIELD_TRIAL_CONSTANTS
38  #define FIELD_TRIAL_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_API
39  #define FIELD_TRIAL_JOB_STRUCT_VAL(x,y) = { x, y}
40 #else
41  #define FIELD_TRIAL_JOB_PREFIX extern
42  #define FIELD_TRIAL_JOB_STRUCT_VAL(x,y)
43 #endif
44 
45 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
46 
47 
48 
49 
50 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_NAME FIELD_TRIAL_JOB_STRUCT_VAL("FT Name", PT_STRING);
51 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_TEAM FIELD_TRIAL_JOB_STRUCT_VAL("FT Team", PT_STRING);
52 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_ID FIELD_TRIAL_JOB_STRUCT_VAL("FT Id", PT_STRING);
53 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_PARENT_ID FIELD_TRIAL_JOB_STRUCT_VAL("FT Parent Id", PT_STRING);
54 
55 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_ADD FIELD_TRIAL_JOB_STRUCT_VAL("FT Add", PT_BOOLEAN);
56 
57 FIELD_TRIAL_JOB_PREFIX NamedParameterType FIELD_TRIAL_SEARCH FIELD_TRIAL_JOB_STRUCT_VAL("FT Search", PT_BOOLEAN);
58 
59 #ifdef __cplusplus
60 extern "C"
61 {
62 #endif
63 
64 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddSubmissionFieldTrialParams (ServiceData *data_p, ParameterSet *param_set_p, FieldTrial *active_trial_p, const bool read_only_flag);
65 
66 
68 
70 
71 
73 
75 
77 
78 
79 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetUpFieldTrialsListParameter (const FieldTrialServiceData *data_p, Parameter *param_p, const char *active_trial_id_s, const bool empty_option_flag);
80 
81 
82 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetUpFieldTrialsListParameterFromJSON (const FieldTrialServiceData *data_p, Parameter *param_p, const char *active_trial_id_s, const bool empty_option_flag, json_t *trials_p);
83 
84 
86 
87 
88 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetAllFieldTrialsAsJSON (const FieldTrialServiceData *data_p, const bool full_data_flag);
89 
90 
91 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddFieldTrialToServiceJobFromJSON (ServiceJob *job_p, json_t *trial_json_p, const ViewFormat format, FieldTrialServiceData *data_p);
92 
93 
95 
96 
97 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetFieldTrialJSONForId (const char *id_s, const ViewFormat format, JSONProcessor *processor_p, char **name_ss, FieldTrialServiceData *data_p);
98 
99 
101 
102 
104 
105 
106 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SearchFieldTrials (ServiceJob *job_p, const char *name_s, const char *team_s, const bool regex_flag, const ViewFormat format, FieldTrialServiceData *data_p);
107 
108 
109 DFW_FIELD_TRIAL_SERVICE_LOCAL bool PopulaterActiveTrialValues (FieldTrial *active_trial_p, char **id_ss, char **programme_id_ss, const char **name_ss, const char **team_ss, LinkedList **existing_people_pp, ParameterSet *param_set_p, FieldTrialServiceData *dfw_data_p);
110 
111 
112 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddTrialsList (const char *id_s, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char * const empty_option_s, FieldTrialServiceData *data_p);
113 
114 
115 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddTrialsListFromJSON (const char *id_s, json_t *trials_json_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char *empty_option_s, FieldTrialServiceData *dfw_data_p);
116 
117 
118 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddTrialEditor (const char * const name_s, const char * const team_s, const char * const programme_id_s, LinkedList *existing_people_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, FieldTrialServiceData *dfw_data_p);
119 
120 
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_FIELD_TRIAL_JOBS_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
AddFieldTrialToServiceJob
bool AddFieldTrialToServiceJob(ServiceJob *job_p, FieldTrial *trial_p, const ViewFormat format, FieldTrialServiceData *data_p)
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
AddFieldTrialToServiceJobFromJSON
bool AddFieldTrialToServiceJobFromJSON(ServiceJob *job_p, json_t *trial_json_p, const ViewFormat format, FieldTrialServiceData *data_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
ServiceJob
A datatype to represent a running task.
Definition: service_job.h:72
SearchFieldTrials
bool SearchFieldTrials(ServiceJob *job_p, const char *name_s, const char *team_s, const bool regex_flag, const ViewFormat format, FieldTrialServiceData *data_p)
PT_STRING
A c-style string.
Definition: parameter_type.h:58
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
JSONProcessor
Definition: json_processor.h:21
AddTrialsList
bool AddTrialsList(const char *id_s, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char *const empty_option_s, FieldTrialServiceData *data_p)
GetFieldTrialFromResource
FieldTrial * GetFieldTrialFromResource(DataResource *resource_p, const NamedParameterType trial_param_type, FieldTrialServiceData *dfw_data_p)
GetFieldTrialAsFrictionlessDataResource
json_t * GetFieldTrialAsFrictionlessDataResource(const FieldTrial *trial_p, const FieldTrialServiceData *data_p)
SetUpFieldTrialsListParameter
bool SetUpFieldTrialsListParameter(const FieldTrialServiceData *data_p, Parameter *param_p, const char *active_trial_id_s, const bool empty_option_flag)
PopulaterActiveTrialValues
bool PopulaterActiveTrialValues(FieldTrial *active_trial_p, char **id_ss, char **programme_id_ss, const char **name_ss, const char **team_ss, LinkedList **existing_people_pp, ParameterSet *param_set_p, FieldTrialServiceData *dfw_data_p)
GetSubmissionFieldTrialParameterTypeForNamedParameter
bool GetSubmissionFieldTrialParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
AddSearchFieldTrialParams
bool AddSearchFieldTrialParams(ServiceData *data_p, ParameterSet *param_set_p)
dfw_field_trial_service_library.h
AddTrialEditor
bool AddTrialEditor(const char *const name_s, const char *const team_s, const char *const programme_id_s, LinkedList *existing_people_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, FieldTrialServiceData *dfw_data_p)
GetAllFieldTrialsAsJSON
json_t * GetAllFieldTrialsAsJSON(const FieldTrialServiceData *data_p, const bool full_data_flag)
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
FieldTrial
A datatype that represents a Field Trial that can contain one or more Studies.
Definition: field_trial.h:50
field_trial.h
LinkedList
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
PT_BOOLEAN
A boolean parameter.
Definition: parameter_type.h:38
GetSearchFieldTrialParameterTypeForNamedParameter
bool GetSearchFieldTrialParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
AddTrialsListFromJSON
bool AddTrialsListFromJSON(const char *id_s, json_t *trials_json_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char *empty_option_s, FieldTrialServiceData *dfw_data_p)
FIELD_TRIAL_JOB_STRUCT_VAL
NamedParameterType FIELD_TRIAL_NAME FIELD_TRIAL_JOB_STRUCT_VAL("FT Name", PT_STRING)
RunForSearchFieldTrialParams
bool RunForSearchFieldTrialParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
AddSubmissionFieldTrialParams
bool AddSubmissionFieldTrialParams(ServiceData *data_p, ParameterSet *param_set_p, FieldTrial *active_trial_p, const bool read_only_flag)
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
json_processor.h
GetFieldTrialIndexingData
json_t * GetFieldTrialIndexingData(Service *service_p)
string_parameter.h
GetFieldTrialJSONForId
json_t * GetFieldTrialJSONForId(const char *id_s, const ViewFormat format, JSONProcessor *processor_p, char **name_ss, FieldTrialServiceData *data_p)
RunForSubmissionFieldTrialParams
bool RunForSubmissionFieldTrialParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p)
SetUpFieldTrialsListParameterFromJSON
bool SetUpFieldTrialsListParameterFromJSON(const FieldTrialServiceData *data_p, Parameter *param_p, const char *active_trial_id_s, const bool empty_option_flag, json_t *trials_p)