Subversion Repositories eFlore/Applications.del

Rev

Rev 888 | Rev 893 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 888 Rev 889
Line 74... Line 74...
74
		}
74
		}
75
		return observation;
75
		return observation;
76
	}
76
	}
Line 77... Line 77...
77
	
77
	
78
	public static List<InterventionForum> parserInterventions(JSONObject interventions, Observation observation) {
78
	public static List<InterventionForum> parserInterventions(JSONObject interventions, Observation observation) {
Line 79... Line 79...
79
		List<InterventionForum> interventionsNonTypees = new ArrayList<InterventionForum>();
79
		HashMap<String, InterventionForum> interventionsNonTypees = new HashMap<String, InterventionForum>();
80
		
80
		
81
		//parcourir les interventions et en faire un tableau
81
		//parcourir les interventions et en faire un tableau
82
		Iterator<String> itInterventions = interventions.keySet().iterator();
82
		Iterator<String> itInterventions = interventions.keySet().iterator();
Line 115... Line 115...
115
				if(jsonIntervention.get("votes") != null && jsonIntervention.get("votes").isObject() != null) {
115
				if(jsonIntervention.get("votes") != null && jsonIntervention.get("votes").isObject() != null) {
116
					intervention.setVotesDeterminations(parserVotesDetermination(jsonIntervention.get("votes").isObject(), intervention));
116
					intervention.setVotesDeterminations(parserVotesDetermination(jsonIntervention.get("votes").isObject(), intervention));
117
				}
117
				}
Line 118... Line 118...
118
				
118
				
119
				intervention.setDate(date);
119
				intervention.setDate(date);
Line 120... Line 120...
120
				interventionsNonTypees.add(intervention);
120
				interventionsNonTypees.put(intervention.getId(), intervention);
121
				
121
				
122
				
122
				
123
			} else {
123
			} else {
Line 124... Line 124...
124
				Commentaire intervention = new Commentaire(contributeur, date, texte);
124
				Commentaire intervention = new Commentaire(contributeur, date, texte);
125
				intervention.setDate(date);
125
				intervention.setDate(date);
Line 126... Line 126...
126
				interventionsNonTypees.add(intervention);
126
				interventionsNonTypees.put(intervention.getId(), intervention);
127
				
127
				
128
			}
-
 
-
 
128
			}
-
 
129
		}
-
 
130
 
-
 
131
		Iterator<String> itIntervention = interventionsNonTypees.keySet().iterator();
-
 
132
		while (itIntervention.hasNext()) {
129
		}
133
			String id = itIntervention.next();
130
 
134
			InterventionForum intervention = interventionsNonTypees.get(id);
Line -... Line 135...
-
 
135
			String idParent = intervention.getIdParent();
131
		Iterator<InterventionForum> itIntervention = interventionsNonTypees.iterator();
136
			if (idParent != null && !idParent.equals("")) {
-
 
137
				intervention.setParent(interventionsNonTypees.get(idParent));
132
		/*while (itIntervention ) {
138
			}
Line 133... Line 139...
133
			
139
		}
134
		}*/
140