Examples of DataList


Examples of com.linkedin.data.DataList

  {
    for (Map.Entry<DataSchema.Type, Class<? extends DirectArrayTemplate<?>>> entry: _dataSchemaTypeToprimitiveArrayMap.entrySet())
    {
      final PrimitiveDataSchema itemsSchema = DataSchemaUtil.dataSchemaTypeToPrimitiveDataSchema(entry.getKey());
      final ArrayDataSchema arraySchema = new ArrayDataSchema(itemsSchema);
      final DataList value = (DataList) SchemaSampleDataGenerator.buildData(arraySchema, _spec);
      final ParameterizedType arrayType = (ParameterizedType) entry.getValue().getGenericSuperclass();
      assert(arrayType.getRawType() == DirectArrayTemplate.class);
      Assert.assertSame(value.get(0).getClass(), arrayType.getActualTypeArguments()[0]);
    }
  }
View Full Code Here

Examples of com.linkedin.data.DataList

    expectedParameters.put("fields", "foo,bar,baz");
    expectedParameters.put("metadataFields", "city,region");
    expectedParameters.put("pagingFields", "start,links");
    expectedParameters.put("q", "test");
    DataMap testParam = new DataMap();
    DataList aValue = new DataList();
    aValue.add("b");
    aValue.add("c");
    aValue.add("d");
    testParam.put("a", aValue);
    expectedParameters.put("testParam", testParam);
    Assert.assertEquals(parameters, expectedParameters);
  }
View Full Code Here

Examples of com.linkedin.data.DataList

        RecordDataSchema recordSchema = new RecordDataSchema(name, recordType);
        schema = namedSchema = recordSchema;
        bindNameToSchema(name, aliasNames, recordSchema);
        List<RecordDataSchema.Field> fields = new ArrayList<RecordDataSchema.Field>();

        DataList includeList = getDataList(map, INCLUDE_KEY, false);
        DataList fieldsList = getDataList(map, FIELDS_KEY, true);

        // the parser must parse fields and include in the same order that they appear in the input.
        // determine whether to process fields first or include first
        boolean fieldsBeforeInclude = fieldsBeforeIncludes(includeList, fieldsList);
View Full Code Here

Examples of com.linkedin.data.DataList

        case TYPEREF:
          Object ref = map.get(REF_KEY);
          parseObject(ref);
          break;
        case RECORD:
          DataList includeList = getDataList(map, INCLUDE_KEY, false);
          if (includeList != null)
          {
            parseList(includeList);
          }
          DataList fieldsList = getDataList(map, FIELDS_KEY, true);
          if (fieldsList != null)
          {
            for (Object o : fieldsList)
            {
              if (o.getClass() == DataMap.class)
View Full Code Here

Examples of com.linkedin.data.DataList

    {
      // Parse all query parameters into a data map.
      DataMap allParametersDataMap = context.getParameters();

      // Get the batch request keys from the IDS list at the root of the map.
      DataList batchIds = allParametersDataMap.getDataList(RestConstants.QUERY_BATCH_IDS_PARAM);
      if (batchIds == null)
      {
        batchKeys = null;
      }
      else if (batchIds.isEmpty())
      {
        batchKeys = Collections.emptySet();
      }
      else
      {
        batchKeys = new HashSet<Object>();

        // Validate the complex keys and put them into the context batch keys
        for (Object complexKey : batchIds)
        {
          if (!(complexKey instanceof DataMap))
          {
            log.warn("Invalid structure of key '" + complexKey.toString() + "', skipping key.");
            context.getBatchKeyErrors().put(complexKey, new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST));
            continue;
          }
          batchKeys.add(ComplexResourceKey.buildFromDataMap((DataMap) complexKey, ComplexKeySpec.forClassesMaybeNull(resource.getKeyKeyClass(), resource.getKeyParamsClass())));
        }
      }
    }
    else if (CompoundKey.class.equals(keyClass)
      && version.compareTo(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion()) >= 0)
    {
      DataMap allParametersDataMap = context.getParameters();

      // Get the batch request keys from the IDS list at the root of the map.
      DataList batchIds = allParametersDataMap.getDataList(RestConstants.QUERY_BATCH_IDS_PARAM);
      if (batchIds == null)
      {
        batchKeys = null;
      }
      else if (batchIds.isEmpty())
      {
        batchKeys = Collections.emptySet();
      }
      else
      {
View Full Code Here

Examples of com.linkedin.data.DataList

  {
    private static final ArrayDataSchema SCHEMA = (ArrayDataSchema) DataTemplateUtil.parseSchema(EDGE_LIST_SCHEMA);

    public EdgeList()
    {
      super(new DataList(), SCHEMA, Edge.class);
    }
View Full Code Here

Examples of com.linkedin.data.DataList

        new Integer(1),
        new Long(1),
        new Float(1),
        new Double(1),
        new DataMap(),
        new DataList(),
        new String("\u0100"),
        new String("ab\u0100c"),
        new String("ab\u0100c\u0200")
    };
View Full Code Here

Examples of org.joget.apps.datalist.model.DataList

     * @return
     */
    public DataList fromJson(String json) {
        json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null);

        DataList dataList = JsonUtil.fromJson(json, DataList.class);
        return dataList;
    }
View Full Code Here

Examples of org.joget.apps.datalist.model.DataList

        }
        return null;
    }
   
    public static Object parseElementFromJsonObject(JSONObject obj) throws Exception {
        DataList object = (DataList) new DataList();
        if (object != null) {
           
            if (obj.has(PROPERTY_ID)) {
                object.setId(obj.getString(PROPERTY_ID));
            }
            if (obj.has(PROPERTY_NAME)) {
                object.setName(obj.getString(PROPERTY_NAME));
            }
            if (obj.has(PROPERTY_DESC)) {
                object.setDescription(obj.getString(PROPERTY_DESC));
            }
            if (obj.has(PROPERTY_PAGE_SIZE)) {
                object.setDefaultPageSize(obj.getInt(PROPERTY_PAGE_SIZE));
            }
            if (obj.has(PROPERTY_ORDER)) {
                object.setDefaultOrder(obj.getString(PROPERTY_ORDER));
            }
            if (obj.has(PROPERTY_ORDER_BY)) {
                object.setDefaultSortColumn(obj.getString(PROPERTY_ORDER_BY));
            }

            //set columns
            Collection<DataListColumn> columns = parseColumnsFromJsonObject(obj);
            DataListColumn[] temp = (DataListColumn[]) columns.toArray(new DataListColumn[columns.size()]);
            object.setColumns(temp);

            //set binder
            DataListBinder binder = parseBinderFromJsonObject(obj);
            object.setBinder(binder);

            //set actions
            Collection<DataListAction> actions = parseActionsFromJsonObject(obj);
            DataListAction[] temp2 = (DataListAction[]) actions.toArray(new DataListAction[actions.size()]);
            object.setActions(temp2);

            //set row actions
            Collection<DataListAction> rowActions = parseRowActionsFromJsonObject(obj);
            DataListAction[] temp3 = (DataListAction[]) rowActions.toArray(new DataListAction[rowActions.size()]);
            object.setRowActions(temp3);

            //set filters
            Collection<DataListFilter> filters = parseFiltersFromJsonObject(obj);
            DataListFilter[] temp4 = (DataListFilter[]) filters.toArray(new DataListFilter[filters.size()]);
            object.setFilters(temp4);
           
        }
       
        return object;
    }
View Full Code Here

Examples of org.joget.apps.datalist.model.DataList

    }

    protected void viewList() {
        try {
            // get data list
            DataList dataList = getDataList();
            dataList.setCheckboxPosition(DataList.CHECKBOX_POSITION_NO);
            dataList.setSize(getDataTotalRowCount());
            dataList.setRows(getRows(dataList));

            //overide datalist result to use userview result
            DataListActionResult ac = dataList.getActionResult();
            if (ac != null) {
                if (ac.getMessage() != null && !ac.getMessage().isEmpty()) {
                    setAlertMessage(ac.getMessage());
                }
                if (ac.getType() != null && DataListActionResult.TYPE_REDIRECT.equals(ac.getType()) &&
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.