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.
|
Go to the documentation of this file.
23 #ifndef SERVICES_FIELD_TRIALS_INCLUDE_PROGRAM_H_
24 #define SERVICES_FIELD_TRIALS_INCLUDE_PROGRAM_H_
130 #ifndef DOXYGEN_SHOULD_SKIP_THIS
132 #ifdef ALLOCATE_PROGRAMME_TAGS
133 #define PROGRAMME_PREFIX DFW_FIELD_TRIAL_SERVICE_API
134 #define PROGRAMME_VAL(x) = x
135 #define PROGRAMME_CONCAT_VAL(x,y) = x y
137 #define PROGRAMME_PREFIX extern
138 #define PROGRAMME_VAL(x)
139 #define PROGRAMME_CONCAT_VAL(x,y)
152 PROGRAMME_PREFIX
const char *PR_TRIALS_S
PROGRAMME_VAL (
"trials");
156 PROGRAMME_PREFIX
const char *PR_PI_S
PROGRAMME_VAL (
"principal_investigator");
158 PROGRAMME_PREFIX
const char *PR_CROP_S
PROGRAMME_VAL (
"crop");
165 PROGRAMME_PREFIX
const char *PR_FD_NAME_S
PROGRAMME_VAL (
"name");
167 PROGRAMME_PREFIX
const char *PR_FUNDERS_S
PROGRAMME_VAL(
"funders");
169 PROGRAMME_PREFIX
const char *PR_CODE_S
PROGRAMME_VAL(
"code");
172 PROGRAMME_PREFIX
const char *PR_FUNDING_IDENTIFIER_S
PROGRAMME_VAL(
"identifier");
173 PROGRAMME_PREFIX
const char *PR_FUNDING_ORG_NAME_S
PROGRAMME_VAL(
"name");
174 PROGRAMME_PREFIX
const char *PR_GRANT_FUNDER_S
PROGRAMME_VAL(
"funder");
175 PROGRAMME_PREFIX
const char *PR_FUNDING_S
PROGRAMME_VAL(
"funding");
183 DFW_FIELD_TRIAL_SERVICE_LOCAL Programme *
AllocateProgramme (bson_oid_t *id_p,
User *user_p,
PermissionsGroup *permissions_group_p,
const bool owns_user_flag,
const char *abbreviation_s,
Crop *crop_p,
const char *documentation_url_s,
const char *name_s,
const char *objective_s,
Person *pi_p,
const char *logo_url_s,
const char *funders_s,
const char *project_code_s,
const char *timestamp_s);
json_t * GetProgrammeAsJSON(Programme *programme_p, const ViewFormat format, const FieldTrialServiceData *data_p)
uint32 GetNumberOfProgrammeFieldTrials(const Programme *programme_p)
Programme * GetProgrammeFromJSON(const json_t *json_p, const ViewFormat format, const FieldTrialServiceData *data_p)
char * pr_documentation_url_s
The web address for any documentaion about this Programme.
Definition: programme.h:79
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
A datatype to represent a running task.
Definition: service_job.h:72
char * pr_timestamp_s
The time when this Field Trial was saved.
Definition: programme.h:63
char * pr_abbreviation_s
The abbreviation for this Programme.
Definition: programme.h:69
bool pr_owns_user_flag
Definition: programme.h:58
LinkedList * GetProgrammesByName(const char *const programme_s, const FieldTrialServiceData *data_p)
LinkedList * pr_trials_p
A LinkedList of FieldTrialNodes for all of the FieldTrials in this Programme.
Definition: programme.h:101
char * pr_funding_organisation_s
The name of the funding organisation.
Definition: programme.h:113
ProgrammeNode * AllocateProgrammeNode(Programme *programme_p)
const PROGRAMME_PREFIX char *PR_ID_S PROGRAMME_VAL("_id")
Programme * GetProgrammeByIdString(const char *program_id_s, const ViewFormat format, const FieldTrialServiceData *data_p)
void FreeProgramme(Programme *programme_p)
Free a given Programme.
const PROGRAMME_PREFIX char *PR_NAME_S PROGRAMME_CONCAT_VAL(CONTEXT_PREFIX_SCHEMA_ORG_S, "name")
#define DFW_FIELD_TRIAL_SERVICE_LOCAL
Definition: dfw_field_trial_service_library.h:43
#define CONTEXT_PREFIX_SCHEMA_ORG_S
Definition: schema_keys.h:103
char * pr_project_code_s
The programme's pproject or grant code.
Definition: programme.h:118
A datatype that represents a Field Trial that can contain one or more Studies.
Definition: field_trial.h:50
Definition: permission.h:41
Programme * AllocateProgramme(bson_oid_t *id_p, User *user_p, PermissionsGroup *permissions_group_p, const bool owns_user_flag, const char *abbreviation_s, Crop *crop_p, const char *documentation_url_s, const char *name_s, const char *objective_s, Person *pi_p, const char *logo_url_s, const char *funders_s, const char *project_code_s, const char *timestamp_s)
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
PermissionsGroup * pr_permissions_p
Definition: programme.h:51
bool RemoveProgrammeFieldTrial(Programme *programme_p, FieldTrial *trial_p)
Remove a FieldTrial from a given Programme.
Crop * pr_crop_p
The Crop that this Programme is researching.
Definition: programme.h:74
OperationStatus
The current status of an Operation.
Definition: operation.h:96
Definition: programme.h:46
Programme * pn_programme_p
Definition: programme.h:126
char * pr_logo_url_s
Web address of on optional logo.
Definition: programme.h:107
Programme * GetVersionedProgramme(const char *programme_id_s, const char *timestamp_s, const ViewFormat format, const FieldTrialServiceData *data_p)
bson_oid_t * pr_id_p
Definition: programme.h:48
Programme * GetProgrammeById(const bson_oid_t *id_p, const ViewFormat format, const FieldTrialServiceData *data_p)
char * pr_objective_s
The objective of this Programme.
Definition: programme.h:89
bool AddFieldTrialsToProgrammeJSON(Programme *programme_p, json_t *program_json_p, const ViewFormat format, FieldTrialServiceData *data_p)
OperationStatus SaveProgramme(Programme *programme_p, ServiceJob *job_p, FieldTrialServiceData *data_p)
A datatype to store user credentials.
Definition: user_details.h:40
Person * pr_pi_p
The Person leading the Programme.
Definition: programme.h:94
void FreeProgrammeNode(ListItem *node_p)
User * pr_user_p
The User that saved this version of the Programme.
Definition: programme.h:56
void SetProgrammeUser(Programme *programme_p, User *user_p, bool owns_user_flag)
char * pr_name_s
The name of this Programme.
Definition: programme.h:84
bool AddProgrammeFieldTrial(Programme *programme_p, FieldTrial *trial_p, MEM_FLAG mf)
The configuration data used by the DFW Field Trial Service.
Definition: dfw_field_trial_service_data.h:118
ListItem pn_node
Definition: programme.h:125
Definition: programme.h:123
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43
Programme * GetUniqueProgrammeBySearchString(const char *programme_s, const ViewFormat format, const FieldTrialServiceData *data_p)