content.addElement(new HR());
if( component instanceof GUIConfigurationIF) {
GUIContext guiContext = ((GUIConfigurationIF) component).getGUIContext();
if(guiContext != null) {
// Component might have it's own labels...
LabelResource customLabelResource = PipeComponentUtils.getCustomLabelResource(new Locale(
environment.getLanguage(session)), labels, component.getClass());
Map fields = guiContext.makeFields(component, customLabelResource, req);
// -----------
// Handle post
// -----------
if(requestType == POST_REQUEST && parameters.wasGiven(ACTION)) {
int action = parameters.getInt(ACTION);
if(action == 1) {
if(guiContext.hasBeenEdited(fields)) {
guiContext.commitFields(fields);
//System.out.println("Saving PipeComponentData, ID: " + componentData.getId());
pers.update(componentData);
}
} else
guiContext.revertFields(fields);
}
// -----------------------
// Print the field editors
// -----------------------
String guiHtml;
// Use template if the component provides one
String templateStr = ((GUIConfigurationIF) component).getGUITemplate();
if(templateStr != null) {
Template template = Template.createTemplate(templateStr);
guiContext.writeEditors(fields, template);
template.write();
guiHtml = template.toString();
}
// Else just print them...
else {