Package org.persvr.data

Examples of org.persvr.data.PersistableArray


   * The creates a new JavaScript array. It will be persisted if it
   * is ever added as a property value to another persisted object.
   * @return the new persistable JavaScript array
   */
  public static PersistableArray newArray() {
    PersistableArray result = new PersistableArray(0);
        ScriptRuntime.setObjectProtoAndParent((ScriptableObject) result, GlobalData.getGlobalScope());
        return result;
  }
View Full Code Here


  }
  public static PersistableArray newArray(DataSource source) {
    if(PersistableObject.isSecurityEnabled()){
      PersistableObject.checkSecurity(ObjectId.idForObject(source, "").getTarget(), PermissionLevel.APPEND_LEVEL.level);
    }
    PersistableArray result = PersistableObject.initArray(source);
        Transaction.currentTransaction().addNewItem(result);
        return (PersistableArray) result; 
  }
View Full Code Here

        for (Entry<String,Integer> entry : permissionNameLevelMap.entrySet()){
          String levelName = entry.getKey();
          Integer level = entry.getValue();
          Object grantedObject = noCheckGet(levelName);
          if (grantedObject instanceof PersistableArray) {
            PersistableArray granted = (PersistableArray) grantedObject;
 
             
            i = 0;
            while((grantee = granted.noCheckGet(i++)) instanceof Persistable){
              allGranted.put(((Persistable) grantee).getId(), level);
            }
          }
        }
      }
View Full Code Here

      Persistable result = Persevere.newObject();
      result.put("id", result, id);
      if (message instanceof RPCall) {
        result.put("object",result,((RPCall) message).getTarget());
        result.put("method",result,((RPCall) message).getFunctionName());
        result.put("params",result,new PersistableArray(((RPCall) message).getParameters()));
      }
      else if (message instanceof RPCResponse) {
        result.put("result",result,((RPCResponse) message).getResult());
        result.put("error",result,((RPCResponse) message).getError());
      }
View Full Code Here

      PostMethod method = new PostMethod(target.toString());
    Persistable request = new PersistableObject();
    request.put("id", request, rpcId++);
   
    request.put("method",request, methodName);
    request.put("params",request, new PersistableArray(args));
    Client.IndividualRequest clientRequest = new Client("server-request").getIndividualRequest(null, null);
    clientRequest.setRequestedPath(target.toString(), target);
    String jsonRpcMessage = clientRequest.serialize(request);
      method.setRequestBody(jsonRpcMessage);
      try {
View Full Code Here

TOP

Related Classes of org.persvr.data.PersistableArray

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.