}
JSONObject gfJsonObject;
try {
gfJsonObject = containerJsonObject.getJSONObject("gadgets.features");
} catch (JSONException jsone) {
throw new SocialSpiException(ResponseError.INTERNAL_ERROR,
"Error while retrieving "
+ "JsonObject for gadgets.features from container.js", jsone);
}
Iterator itr = gfJsonObject.keys();
String osKey = null;
while (itr.hasNext()) {
osKey = itr.next().toString();
if (osKey.startsWith("opensocial")) {
break;
}
}
JSONObject osJsonObjectValue = null;
JSONObject supportFieldsJsonObjectValue = null;
JSONArray activityFields = null;
try {
osJsonObjectValue = gfJsonObject.getJSONObject(osKey);
supportFieldsJsonObjectValue = osJsonObjectValue
.getJSONObject("supportedFields");
activityFields = supportFieldsJsonObjectValue.getJSONArray("activity");
activityFieldsList = new LinkedList<String>();
for (int i = 0; i < activityFields.length(); i++) {
activityFieldsList.add(activityFields.get(i).toString());
}
} catch (JSONException jsone) {
throw new SocialSpiException(ResponseError.INTERNAL_ERROR, jsone
.toString(), jsone);
}
}