Package org.molgenis.framework.tupletable.view.JQGridJSObjects

Examples of org.molgenis.framework.tupletable.view.JQGridJSObjects.JQGridResult


  {
    @Override
    public void export(MolgenisRequest request, String fileName, TupleTable tupleTable, int totalPages,
        int currentPage) throws TableException, IOException
    {
      final JQGridResult result = JQGridView.buildJQGridResults(tupleTable.getCount(), totalPages, currentPage,
          tupleTable);

      Writer writer = new OutputStreamWriter(request.getResponse().getOutputStream(), Charset.forName("UTF-8"));
      try
      {
View Full Code Here


   */

  public static JQGridResult buildJQGridResults(final int rowCount, final int totalPages, final int page,
      final TupleTable table) throws TableException
  {
    final JQGridResult result = new JQGridResult(page, totalPages, rowCount);

    for (Iterator<Tuple> it = table.iterator(); it.hasNext();)
    {
      Tuple row = it.next();
      final LinkedHashMap<String, String> rowMap = new LinkedHashMap<String, String>();

      for (String fieldName : row.getColNames())
      {
        String rowValue = !row.isNull(fieldName) ? row.getString(fieldName) : "null";
        rowMap.put(fieldName, rowValue); // TODO encode to HTML
      }
      result.addRow(rowMap);
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of org.molgenis.framework.tupletable.view.JQGridJSObjects.JQGridResult

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.