@Override public void run( VariantTableContent content, Resource resource, IProgressMonitor monitor, Map<String, VCObject> seenObjects, List<Option> options) throws Exception { VariantTable table = content.getTable(); JCoFunction deletefunc = maintainEntries(content, monitor, options, true); executeTransaction(monitor, "DELETE " + table.getName(), deletefunc); JCoFunction createfunc = maintainEntries(content, monitor, options, false); JCoTable entries = createfunc.getTableParameterList().getTable("VAR_TAB_ENTRIES"); EList<Row> rows = content.getRows(); List<VariantTableArgument> arguments = table.getArguments(); for (Row row : rows) { for (VariantTableArgument arg : arguments) { String cstic = arg.getCharacteristic().getName(); int index = arguments.indexOf(arg); entries.appendRow(); Literal literal = row.getValues().get(index); entries.setValue("VTCHARACT", cstic); entries.setValue("VTLINENO", "" + rows.indexOf(row)); entries.setValue("VTVALUE", getValue(literal)); } } executeTransaction(monitor, "CREATE/CHANGE " + table.getName(), createfunc); }
public static VariantTableArgument mkVariantTableArgument(Characteristic cstic, boolean key) { VariantTableArgument vta = VCML.createVariantTableArgument(); vta.setCharacteristic(cstic); vta.setKey(key); return vta; }