1 #include "GDESession.hpp"
2 #include "UserService.hpp"
3 #include "StudyService.hpp"
4 #include "AttributesService.hpp"
5 #include "ProfilesService.hpp"
8 gde::GDESession::getServiceURI(const std::string& serviceName) const
10 std::string uri = serviceName;
12 if (*serviceName.begin() == '/') // begins with '/'
15 if (*_serverAddress.rbegin() != '/') // does not end with '/'
18 uri = _serverAddress + uri;
25 gde::GDESession::createUser(const std::string& name, const std::string& password)
27 return gde::UserService(*this).createUser(name, password);
31 gde::GDESession::deleteUser(const User& user)
33 return gde::UserService(*this).deleteUser(user);
37 gde::GDESession::findUser(const std::string& name)
39 return gde::UserService(*this).findUser(name);
43 gde::GDESession::createUserGroup(const std::string& name)
45 return gde::UserService(*this).createUserGroup(name);
49 gde::GDESession::deleteUserGroup(const gde::UserGroup& group)
51 return gde::UserService(*this).deleteUserGroup(group);
55 gde::GDESession::findUserGroup(const std::string& name)
57 return gde::UserService(*this).findUserGroup(name);
61 gde::GDESession::addToUserGroup(const gde::UserGroup& group, const gde::User& user)
63 return gde::UserService(*this).addToUserGroup(group, user);
67 gde::GDESession::removeFromUserGroup(const gde::UserGroup& group, const gde::User& user)
69 return gde::UserService(*this).removeFromUserGroup(group, user);
75 gde::GDESession::createStudy(const std::string& name)
77 return gde::StudyService(*this).createStudy(name);
81 gde::GDESession::deleteStudy(const gde::Study& study)
83 return gde::StudyService(*this).deleteStudy(study);
87 gde::GDESession::setStudyState(const gde::Study& study, int lock)
89 return gde::StudyService(*this).setStudyState(study, lock);
93 gde::GDESession::readStudy(int studyId)
95 return gde::StudyService(*this).readStudy(studyId);
98 /* AttributesService */
101 gde::GDESession::createAttribute(const std::string& name, const std::string& type, const std::string& value, int groupId, bool mandatory)
103 return gde::AttributesService(*this).createAttribute(name, type, value, groupId, mandatory);
107 gde::GDESession::deleteAttribute(const gde::Attribute& attribute)
109 return gde::AttributesService(*this).deleteAttribute(attribute);
113 gde::GDESession::readAttribute(int attributeId)
115 return gde::AttributesService(*this).readAttribute(attributeId);
118 const gde::AttributeGroup
119 gde::GDESession::createAttributeGroup(const AttributeGroup& attributeGroup)
121 return gde::AttributesService(*this).createAttributeGroup(attributeGroup);
125 gde::GDESession::deleteAttributeGroup(const gde::AttributeGroup& attributeGroup)
127 return gde::AttributesService(*this).deleteAttributeGroup(attributeGroup);
130 const gde::AttributeGroup
131 gde::GDESession::updateAttributeGroup(const gde::AttributeGroup& attributeGroup)
133 return gde::AttributesService(*this).updateAttributeGroup(attributeGroup);
136 const gde::AttributeGroup
137 gde::GDESession::readAttributeGroup(int attributeGroupId)
139 return gde::AttributesService(*this).readAttributeGroup(attributeGroupId);
142 /* ProfilesService */
144 gde::GDESession::createProfile(const gde::Profile& profile)
146 return gde::ProfilesService(*this).createProfile(profile);
150 gde::GDESession::deleteProfile(const gde::Profile& profile)
152 return gde::ProfilesService(*this).deleteProfile(profile);
156 gde::GDESession::readProfile(int profileId)
158 return gde::ProfilesService(*this).readProfile(profileId);
162 gde::GDESession::updateProfile(const gde::Profile& profile)
164 return gde::ProfilesService(*this).updateProfile(profile);
167 const gde::ProfileAttribute
168 gde::GDESession::createProfileAttribute(const std::string& name, const std::string& type, int profileId, bool mandatory)
170 return gde::ProfilesService(*this).createProfileAttribute(name, type, profileId, mandatory);
174 gde::GDESession::deleteProfileAttribute(const gde::ProfileAttribute& attribute)
176 return gde::ProfilesService(*this).deleteProfileAttribute(attribute);
179 const gde::ProfileAttribute
180 gde::GDESession::readProfileAttribute(int attributeId)
182 return gde::ProfilesService(*this).readProfileAttribute(attributeId);
185 const gde::ProfileAttribute
186 gde::GDESession::updateProfileAttribute(const gde::ProfileAttribute& attribute)
188 return gde::ProfilesService(*this).updateProfileAttribute(attribute);