@Override public void onSaveScript() { VariableDuplicationHelper variableDuplicationHelper = new VariableDuplicationHelper(variable); VariableDto newVariable = variableDuplicationHelper.getDerivedVariable(); VariableDtos.setScript(newVariable, scriptEditorPresenter.getScript()); newVariable.setValueType(scriptEditorPresenter.getValueEntityType().getLabel()); newVariable.setIsRepeatable(scriptEditorPresenter.isRepeatable()); compileScript(newVariable); }
@Override public VariableDto getVariableDto(String script) { VariableDto variableDto = VariableDto.create(); variableDto.setName(variableName.getValue()); variableDto.setIsRepeatable(repeatableCheckbox.getValue()); if (repeatableCheckbox.getValue()) variableDto.setOccurrenceGroup(occurrenceGroup.getValue()); variableDto.setValueType(valueType.getValue(valueType.getSelectedIndex())); variableDto.setEntityType(entityType); variableDto.setMimeType(mimeType.getValue()); variableDto.setUnit(unit.getValue()); VariableDtos.setScript(variableDto, script); return variableDto; }