use of org.guvnor.ala.ui.openshift.model.TemplateParam in project kie-wb-common by kiegroup.
the class OpenShiftClientServiceImpl method getTemplateModel.
@Override
public TemplateDescriptorModel getTemplateModel(final String url) {
checkNotNull("url", url);
OpenShiftTemplate template = new OpenShiftTemplate(url);
List<TemplateParam> params = buildTemplateParams(template);
final TemplateDescriptorModel descriptorModel = new TemplateDescriptorModel(params);
return descriptorModel;
}
use of org.guvnor.ala.ui.openshift.model.TemplateParam in project kie-wb-common by kiegroup.
the class TemplateParamsTableView method addParamValueColumn.
private void addParamValueColumn() {
final Column<TemplateParam, String> column = new Column<TemplateParam, String>(new EditTextCell()) {
@Override
public String getValue(TemplateParam templateParam) {
if (templateParam.getValue() != null) {
return templateParam.getValue();
} else {
return EMPTY_STRING;
}
}
};
column.setFieldUpdater(new ParamValueFieldUpdater((EditTextCell) column.getCell()));
dataGrid.addColumn(column, translationService.getTranslation(TemplateParamsTableView_ParamValueColumn));
dataGrid.setColumnWidth(column, 55, Style.Unit.PCT);
}
use of org.guvnor.ala.ui.openshift.model.TemplateParam in project kie-wb-common by kiegroup.
the class TemplateParamsTableView method addParamRequiredColumn.
private void addParamRequiredColumn() {
Column<TemplateParam, String> column = new Column<TemplateParam, String>(new TextCell()) {
@Override
public String getValue(TemplateParam templateParam) {
return templateParam.isRequired() ? "*" : "";
}
};
dataGrid.addColumn(column, " ");
dataGrid.setColumnWidth(column, 30, Style.Unit.PX);
}
use of org.guvnor.ala.ui.openshift.model.TemplateParam in project kie-wb-common by kiegroup.
the class TemplateParamsFormPresenterTest method initializeParams.
private void initializeParams() {
requiredTemplateParams = mockParams("required", REQUIRED_TEMPLATE_PARAMS_COUNT, true);
nonRequiredTemplateParams = mockParams("nonRequired", NON_REQUIRED_TEMPLATE_PARAMS_COUNT, false);
// add the banned parameters
bannedTemplateParams = new ArrayList<>();
bannedTemplateParams.add(new TemplateParam(IMAGE_STREAM_NAMESPACE_TEMPLATE_PARAM, null, null, true, null));
bannedTemplateParams.add(new TemplateParam(APPLICATION_NAME_TEMPLATE_PARAM, null, null, true, null));
allTemplateParams = new ArrayList<>();
allTemplateParams.addAll(requiredTemplateParams);
allTemplateParams.addAll(nonRequiredTemplateParams);
allTemplateParams.addAll(bannedTemplateParams);
// the banned parameters are not shown in the ui
managedTemplateParams = new ArrayList<>();
managedTemplateParams.addAll(requiredTemplateParams);
managedTemplateParams.addAll(nonRequiredTemplateParams);
}
use of org.guvnor.ala.ui.openshift.model.TemplateParam in project kie-wb-common by kiegroup.
the class OpenShiftClientServiceImplTest method testGetTemplateModel.
@Test
public void testGetTemplateModel() throws Exception {
String url = getClass().getClassLoader().getResource(TEMPLATE).toString();
TemplateDescriptorModel model = service.getTemplateModel(url);
List<TemplateParam> expectedParams = buildExpectedParams(PARAMS_COUNT);
assertEquals(expectedParams, model.getParams());
}
Aggregations