Schema skeleton dialog preview was broken by some previous checkin.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@866 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-05-27 05:06:47 +00:00
parent b026c90399
commit bf1fb5ebcd
2 changed files with 14 additions and 2 deletions

View File

@ -58,7 +58,7 @@ public class PreviewProtographCommand extends Command {
nodeFactory.flush(); nodeFactory.flush();
sb.append(", \"mqllike\" : "); sb.append(", \"mqllike\" : ");
sb.append(sb.toString()); sb.append(stringWriter.toString());
} }
sb.append(" }"); sb.append(" }");

View File

@ -8,6 +8,7 @@ import java.util.List;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter;
import com.metaweb.gridworks.model.Cell; import com.metaweb.gridworks.model.Cell;
import com.metaweb.gridworks.model.Recon; import com.metaweb.gridworks.model.Recon;
@ -43,7 +44,18 @@ public class MqlwriteLikeTransposedNodeFactory implements TransposedNodeFactory
@Override @Override
public void flush() throws IOException { public void flush() throws IOException {
writer.write(getJSON().toString()); try {
JSONWriter jsonWriter = new JSONWriter(writer);
jsonWriter.array();
for (JSONObject obj : rootObjects) {
jsonWriter.value(obj);
}
jsonWriter.endArray();
} catch (JSONException e) {
e.printStackTrace();
}
writer.flush(); writer.flush();
} }