VOGroup.cpp 4.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*************************************************************************
 *   Copyright (C) 2007 by Oliver Bock                                   *
 *   bock@tfh-berlin.de                                                  *
 *                                                                       *
 *   This file is part of Fidelity.                                      *
 *                                                                       *
 *   Fidelity is free software: you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published   *
 *   by the Free Software Foundation, version 3 of the License.          *
 *                                                                       *
 *   Fidelity is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the        *
 *   GNU General Public License for more details.                        *
 *                                                                       *
 *   You should have received a copy of the GNU General Public License   *
 *   along with Fidelity. If not, see <http://www.gnu.org/licenses/>.    *
 *                                                                       *
 *************************************************************************/

#include "VOGroup.h"

Fidelity::Common::VOGroup::VOGroup()
{
	initAttributes();
}

Fidelity::Common::VOGroup::~VOGroup()
{
	delete m_FieldRefList;
	delete m_ParamList;
	delete m_ParamRefList;
33
	delete m_GroupList;
34
35
36
37
38
39
40
}

void Fidelity::Common::VOGroup::initAttributes()
{
	m_FieldRefList = new QList<VOFieldRef*>();
	m_ParamList = new QList<VOParam*>();
	m_ParamRefList = new QList<VOParamRef*>();
41
	m_GroupList = new QList<VOGroup*>();
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
}


bool Fidelity::Common::VOGroup::buildXml(QDomElement* parent)
{
	parent->setTagName("GROUP");

	QDomDocument doc = parent->ownerDocument();

	if (!m_ID.isEmpty()) {
		parent->setAttribute("ID", m_ID);
	}

	if (!m_Name.isEmpty()) {
		parent->setAttribute("name", m_Name);
	}

	if (!m_Ref.isEmpty()) {
		parent->setAttribute("ref", m_Ref);
	}

	if (!m_UCD.isEmpty()) {
		parent->setAttribute("ucd", m_UCD);
	}

	if (!m_UType.isEmpty()) {
		parent->setAttribute("utype", m_UType);
	}

	if (!m_Description.isEmpty()) {
		QDomElement tag = doc.createElement("DESCRIPTION");
		parent->appendChild(tag);
		QDomText text = doc.createTextNode(m_Description);
		parent->appendChild(text);
	}

	if (!m_FieldRefList->isEmpty()) {
		for (int i = 0;i < m_FieldRefList->size();i++) {
			QDomElement tag = doc.createElement("FIELDref");
			if(m_FieldRefList->at(i)->buildXml(&tag) == false) {
				return(false);
			}
			parent->appendChild(tag);
		}
	}

	if (!m_ParamList->isEmpty()) {
		for (int i = 0;i < m_ParamList->size();i++) {
			QDomElement tag = doc.createElement("PARAM");
			if(m_ParamList->at(i)->buildXml(&tag) == false) {
				return(false);
			}
			parent->appendChild(tag);
		}
	}

	if (!m_ParamRefList->isEmpty()) {
		for (int i = 0;i < m_ParamRefList->size();i++) {
			QDomElement tag = doc.createElement("PARAMref");
			if(m_ParamRefList->at(i)->buildXml(&tag) == false) {
				return(false);
			}
			parent->appendChild(tag);
		}
	}

108
109
110
111
112
113
114
115
116
	if (!m_GroupList->isEmpty()) {
		for (int i = 0;i < m_GroupList->size();i++) {
			QDomElement tag = doc.createElement("GROUP");
			if(m_GroupList->at(i)->buildXml(&tag) == false) {
				return(false);
			}
			parent->appendChild(tag);
		}
	}
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

	return(true);
}


void Fidelity::Common::VOGroup::setID(QString new_var)
{
	m_ID = new_var;
}

QString Fidelity::Common::VOGroup::ID()
{
	return m_ID;
}

void Fidelity::Common::VOGroup::setName(QString new_var)
{
	m_Name = new_var;
}

QString Fidelity::Common::VOGroup::Name()
{
	return m_Name;
}

void Fidelity::Common::VOGroup::setRef(QString new_var)
{
	m_Ref = new_var;
}

QString Fidelity::Common::VOGroup::Ref()
{
	return m_Ref;
}

void Fidelity::Common::VOGroup::setUCD(QString new_var)
{
	m_UCD = new_var;
}

QString Fidelity::Common::VOGroup::UCD()
{
	return m_UCD;
}

void Fidelity::Common::VOGroup::setUType(QString new_var)
{
	m_UType = new_var;
}

QString Fidelity::Common::VOGroup::UType()
{
	return m_UType;
}

void Fidelity::Common::VOGroup::setDescription(QString new_var)
{
	m_Description = new_var;
}

QString Fidelity::Common::VOGroup::Description()
{
	return m_Description;
}

QList<VOFieldRef*>* Fidelity::Common::VOGroup::FieldRefList()
{
	return m_FieldRefList;
}

QList<VOParam*>* Fidelity::Common::VOGroup::ParamList()
{
	return m_ParamList;
}

QList<VOParamRef*>* Fidelity::Common::VOGroup::ParamRefList()
{
	return m_ParamRefList;
}
196
197
198
199
200

QList<VOGroup*>* Fidelity::Common::VOGroup::GroupList()
{
	return m_GroupList;
}