Project

General

Profile

« Previous | Next » 

Revision 29386

Added by Eri Katsari almost 10 years ago

View differences:

Serializer.java
208 208
												// '-' and decimal.
209 209
	}
210 210

  
211
	// TODO there are topics with "null" as value -> repalce them
211 212
	private boolean isValidTopic(String t) {
212
		if (t != null && !t.isEmpty() && !t.equals(ENCLOSED + ENCLOSED + DELIM) && !t.equals(ENCLOSED + NULL_STRING + ENCLOSED + DELIM))
213 213

  
214
		{
215
			return true;
214
		if (t == null || t.isEmpty()) {
215
			return false;
216 216
		}
217
		return false;
217

  
218
		if (t.equals("") || t.equals(" ")) {
219
			return false;
220
		}
221
		if (t.equals("null") || t.equals("Null") || t.equals("NULL")) {
222
			return false;
223
		}
224

  
225
		if (t.equals(ENCLOSED + ENCLOSED + DELIM) || t.equals(ENCLOSED + NULL_STRING + ENCLOSED + DELIM)) {
226
			return false;
227
		}
228
		// skip dedups
229
		if (t.contains("ddc:")) {
230
			return false;
231
		}
232
		return true;
218 233
	}
219 234

  
220 235
	private HashMap<String, List<String>> getResultTopics(OafEntity valueEntity) {
......
226 241
		List<StructuredProperty> Topics = metadata.getSubjectList();
227 242
		for (StructuredProperty topic : Topics) {
228 243
			// TODOs
229
			if (topic.getValue() != null && !topic.getValue().isEmpty() && !topic.getValue().equals("") && !topic.getValue().equals(" ")) {
244
			if (topic.getValue() != null && !topic.getValue().isEmpty() && !topic.getValue().equals("") && !topic.getValue().equals(" ") && !topic.getValue().equals("null")) {
230 245

  
231 246
				if (!isNumeric(topic.getValue())) {
232 247
					String t = getStringField(topic.getValue());
......
311 326

  
312 327
		// `organization_datasources`,
313 328
		String full_id = getStringField(data.getId());
314
         buff += full_id;
329
		buff += full_id;
315 330
		// organization_projects
316 331
		buff += full_id;
317 332
		// `name`,

Also available in: Unified diff