Package org.apache.shindig.social.opensocial.spi

Examples of org.apache.shindig.social.opensocial.spi.SocialSpiException


        }
      }
      db.getJSONObject(DATA_TABLE).put(user, newPersonData);
      return ImmediateFuture.newInstance(null);
    } catch (JSONException je) {
      throw new SocialSpiException(ResponseError.INTERNAL_ERROR, je.getMessage(), je);
    }
  }
View Full Code Here


      for (Map.Entry<String, String> entry : values.entrySet()) {
        personData.put(entry.getKey(), entry.getValue());
      }
      return ImmediateFuture.newInstance(null);
    } catch (JSONException je) {
      throw new SocialSpiException(ResponseError.INTERNAL_ERROR, je.getMessage(), je);
    }
  }
View Full Code Here

    }
    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);
    }
  }
View Full Code Here

    JSONObject jsonObject = (JSONObject) this.getContainerObject();

    try {
      gfJsonObject = jsonObject.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;

    try {
      osJsonObjectValue = gfJsonObject.getJSONObject(osKey);
      JSONObject personFieldsJsonObject = osJsonObjectValue
          .getJSONObject("supportedFields");
      personFieldsJsonArray = personFieldsJsonObject.getJSONArray("person");
    } catch (JSONException jsone) {
      throw new SocialSpiException(ResponseError.INTERNAL_ERROR, jsone
          .toString(), jsone);
    }
    return personFieldsJsonArray;
  }
View Full Code Here

      // select self
      sb.append(PersonDb.JPQL_FINDPERSON);
      lastPos = JPQLUtils.addInClause(sb, "p", "id", lastPos, paramList.size());
      break;
    default:
      throw new SocialSpiException(ResponseError.BAD_REQUEST, "Group ID not recognized");

    }


    int filterPos = addFilterClause(sb, PersonDb.getFilterCapability(), collectionOptions,
View Full Code Here

      Set<String> fields, String activityId, SecurityToken token) throws SocialSpiException {
    Activity activity = getActivities(userId, activityId,  token);
    if ( activity != null  ) {
      return ImmediateFuture.newInstance(activity);
    }
    throw new SocialSpiException(ResponseError.BAD_REQUEST,"Cant find activity");
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.spi.SocialSpiException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.