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.
programme_jobs.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2020 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  * program_jobs.h
18  *
19  * Created on: 13 Nov 2020
20  * Author: billy
21  */
22 
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_PROGRAMME_JOBS_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_PROGRAMME_JOBS_H_
25 
28 
29 #include "programme.h"
30 #include "string_parameter.h"
31 
32 
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 
35 #ifdef ALLOCATE_PROGRAMME_JOB_CONSTANTS
36  #define PROGRAMME_JOB_PREFIX DFW_FIELD_TRIAL_SERVICE_API
37  #define PROGRAMME_JOB_STRUCT_VAL(x,y) = { x, y}
38 #else
39  #define PROGRAMME_JOB_PREFIX extern
40  #define PROGRAMME_JOB_STRUCT_VAL(x,y)
41 #endif
42 
43 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
44 
45 
46 /*
47  * Programme parameters
48  */
49 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_ID PROGRAMME_JOB_STRUCT_VAL("PR Id", PT_STRING);
50 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_ABBREVIATION PROGRAMME_JOB_STRUCT_VAL("PR Abbreviation", PT_STRING);
51 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_CROP PROGRAMME_JOB_STRUCT_VAL("PR Crop", PT_STRING);
52 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_URL PROGRAMME_JOB_STRUCT_VAL("PR Url", PT_STRING);
53 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_NAME PROGRAMME_JOB_STRUCT_VAL("PR Name", PT_STRING);
54 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_OBJECTIVE PROGRAMME_JOB_STRUCT_VAL("PR Objective", PT_LARGE_STRING);
55 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_LOGO PROGRAMME_JOB_STRUCT_VAL("PR Logo", PT_STRING);
56 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_FUNDER PROGRAMME_JOB_STRUCT_VAL("PR Funder", PT_STRING);
57 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_USER PROGRAMME_JOB_STRUCT_VAL("PR User", PT_STRING);
58 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_CODE PROGRAMME_JOB_STRUCT_VAL("PR Code", PT_STRING);
59 
60 
61 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_PI_NAME PROGRAMME_JOB_STRUCT_VAL("PR PI Name", PT_STRING);
62 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_PI_EMAIL PROGRAMME_JOB_STRUCT_VAL("PR PI Email", PT_STRING);
63 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_PI_ROLE PROGRAMME_JOB_STRUCT_VAL("PR PI Role", PT_STRING);
64 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_PI_AFFILATION PROGRAMME_JOB_STRUCT_VAL("PR PI Affiliation", PT_STRING);
65 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_PI_ORCID PROGRAMME_JOB_STRUCT_VAL("PR PI Orcid", PT_STRING);
66 
67 
68 PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_SEARCH PROGRAMME_JOB_STRUCT_VAL("PR Search", PT_STRING);
69 
70 
71 #ifdef __cplusplus
72 extern "C"
73 {
74 #endif
75 
76 
77 DFW_FIELD_TRIAL_SERVICE_LOCAL bool SetUpProgrammesListParameter (const FieldTrialServiceData *data_p, StringParameter *param_p, const Programme *active_program_p, const bool empty_option_flag);
78 
79 
80 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddSubmissionProgrammeParams (ServiceData *data_p, ParameterSet *param_set_p, Programme *active_programme_p, const bool read_only_flag);
81 
82 
84 
85 
86 DFW_FIELD_TRIAL_SERVICE_LOCAL json_t *GetAllProgrammesAsJSON (const FieldTrialServiceData *data_p, const bool full_data_flag);
87 
88 
90 
91 
93 
94 
96 
97 
99 
100 
102 
103 
105 
106 
108 
109 
111 
113 
114 
116 
117 
118 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddProgrammesListFromJSON (const char *id_s, json_t *programmes_json_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char *empty_option_s, FieldTrialServiceData *ft_data_p);
119 
120 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddProgrammesList (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);
121 
122 
123 
124 DFW_FIELD_TRIAL_SERVICE_LOCAL bool AddProgrammeEditor (Programme *programme_p, const char *id_s,
125  ParameterSet *param_set_p, const bool read_only_flag, FieldTrialServiceData *dfw_data_p);
126 
127 
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 
134 #endif /* SERVICES_FIELD_TRIALS_INCLUDE_PROGRAMME_JOBS_H_ */
RunForSearchProgrammeParams
bool RunForSearchProgrammeParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_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
AddProgrammesListFromJSON
bool AddProgrammesListFromJSON(const char *id_s, json_t *programmes_json_p, ParameterSet *param_set_p, ParameterGroup *group_p, const bool read_only_flag, const char *empty_option_s, FieldTrialServiceData *ft_data_p)
SaveProgrammeAsFrictionlessData
bool SaveProgrammeAsFrictionlessData(const Programme *programme_p, const FieldTrialServiceData *data_p)
AddProgrammesList
bool AddProgrammesList(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)
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
GetSearchProgrammeParameterTypeForNamedParameter
bool GetSearchProgrammeParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
PT_STRING
A c-style string.
Definition: parameter_type.h:58
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
AddSubmissionProgrammeParams
bool AddSubmissionProgrammeParams(ServiceData *data_p, ParameterSet *param_set_p, Programme *active_programme_p, const bool read_only_flag)
AddProgrammeEditor
bool AddProgrammeEditor(Programme *programme_p, const char *id_s, ParameterSet *param_set_p, const bool read_only_flag, FieldTrialServiceData *dfw_data_p)
PT_LARGE_STRING
A potentially large c-style string.
Definition: parameter_type.h:90
AddProgrammeToServiceJob
bool AddProgrammeToServiceJob(ServiceJob *job_p, Programme *program_p, const ViewFormat format, FieldTrialServiceData *data_p)
dfw_field_trial_service_library.h
DFW_FIELD_TRIAL_SERVICE_LOCAL
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
GetProgrammeFromResource
Programme * GetProgrammeFromResource(DataResource *resource_p, const NamedParameterType program_param_type, FieldTrialServiceData *dfw_data_p)
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
GetProgrammeAsFrictionlessDataResource
json_t * GetProgrammeAsFrictionlessDataResource(const Programme *programme_p, const FieldTrialServiceData *data_p)
programme.h
StringParameter
Definition: string_parameter.h:32
RunForSubmissionProgrammeParams
bool RunForSubmissionProgrammeParams(FieldTrialServiceData *data_p, ParameterSet *param_set_p, ServiceJob *job_p, User *user_p)
Programme
Definition: programme.h:46
AddSearchProgrammeParams
bool AddSearchProgrammeParams(ServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p)
GetProgrammeIndexingData
json_t * GetProgrammeIndexingData(Service *service_p)
User
A datatype to store user credentials.
Definition: user_details.h:40
GetAllProgrammesAsJSON
json_t * GetAllProgrammesAsJSON(const FieldTrialServiceData *data_p, const bool full_data_flag)
dfw_field_trial_service_data.h
GetProgrammeAsFrictionlessDataPackage
json_t * GetProgrammeAsFrictionlessDataPackage(const Programme *programme_p, const FieldTrialServiceData *data_p)
GetSubmissionProgrammeParameterTypeForNamedParameter
bool GetSubmissionProgrammeParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
PROGRAMME_JOB_STRUCT_VAL
PROGRAMME_JOB_PREFIX NamedParameterType PROGRAMME_ID PROGRAMME_JOB_STRUCT_VAL("PR Id", PT_STRING)
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
SetUpProgrammesListParameter
bool SetUpProgrammesListParameter(const FieldTrialServiceData *data_p, StringParameter *param_p, const Programme *active_program_p, const bool empty_option_flag)
string_parameter.h