bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
Collection.cc
1//
2// Created by ndp on 10/31/22.
3//
4#include "config.h"
5#include <cstdio>
6#include <sstream>
7
8#include "nlohmann/json.hpp"
9
10#include "BESDebug.h"
11#include "CmrNames.h"
12#include "Collection.h"
13
14using json = nlohmann::json;
15using namespace std;
16
17namespace cmr {
18
19std::string Collection::id() {
20 return d_collection_json_obj[CMR_META_KEY][CMR_CONCEPT_ID_KEY].get<std::string>();
21}
22
23std::string Collection::abstract() {
24 return d_collection_json_obj[CMR_UMM_KEY][CMR_COLLECTION_ABSTRACT_KEY].get<std::string>();
25}
26
27std::string Collection::entry_title() {
28 return d_collection_json_obj[CMR_UMM_KEY][CMR_COLLECTION_ENTRY_TITLE_KEY].get<std::string>();
29}
30
31std::string Collection::short_name() {
32 return d_collection_json_obj[CMR_UMM_KEY][CMR_COLLECTION_SHORT_NAME_KEY].get<std::string>();
33}
34
35string Collection::to_string() {
36 stringstream msg;
37 msg << "# # # # # # # # # # # # # # # # # # " << endl;
38 msg << "# Collection" << endl;
39 msg << "# concept-id: " << id() << endl;
40 msg << "# short_name: " << short_name() << endl;
41 msg << "# entry_title: " << entry_title() << endl;
42 msg << "# abstract: " << abstract() << endl;
43 msg << "#" << endl;
44 return msg.str();
45}
46
47} // cmr