int displayType = event.getDisplayType();
long userUniqueId = event.getUserUniqueId();
if (displayType == GUIControllerRequest.QUERY)
{
KeelResponse result = getKeelResultList(controllerTypeId, "list", userUniqueId, "", "");
if (result == null)
{
return;
}
ResponseElement resultList = result.get("list");
Controller controller = createController(controllerTypeId);
WidgetDescription wdGroup = createWidget(controller.getUniqueId(), controllerTypeId, "group", "group",
false, true);
controller.addWidgetDescription(wdGroup);
for (Iterator i = ((ResponseElement) resultList.getAttribute("header")).getAll().iterator(); i.hasNext();)
{
ResponseElement field = (ResponseElement) i.next();
String attributeName = (String) ((Output) field).getContent();
String fieldLabel = (String) ((Output) field).getAttribute("label");
boolean hide = ((Output) field).getAttribute("hide") != null ? true : false;
wdGroup.addWidgetDescription(createWidget(controller.getUniqueId(), fieldLabel, attributeName,
attributeName, false, hide));
}
Input attribute = (Input) result.get("listSearchCategory");
if (attribute != null)
{
controller.addWidgetDescription(createWidget(controller.getUniqueId(), "listSearchCategory",
"listSearchCategory", "listSearchCategory", false, false));
}
// Wird noch ben�tigt um zu �perpr�fen ob �berhaupt die Neuanlage
// erlaubt ist.
// Command cmdNew = (Command) resultList.getAttribute ("cmdNew");
Command cmdEdit = (Command) resultList.getAttribute("cmdEdit");
if (cmdEdit != null)
{
controller.addCommandDescription(createCommand(controller.getUniqueId(), "NewAkteraObjectCommand",
cmdEdit.getModel(), "new", "new", "des", true, true));
controller.addCommandDescription(createCommand(controller.getUniqueId(), "EditAkteraObjectCommand",
cmdEdit.getModel(), "edit", "edit", "des", true, true));
}
ResponseElement itemCommands = (ResponseElement) resultList.getAttribute("itemCommands");
if (itemCommands != null)
{
for (Iterator i = itemCommands.getAll().iterator(); i.hasNext();)
{
Command command = (Command) i.next();
if (command.getName().equals("delete"))
{
controller.addCommandDescription(createCommand(controller.getUniqueId(),
"DeleteAkteraObjectCommand", command.getModel(), "delete", "delete", "des",
true, true));
}
}
}
controller.addCommandDescription(createCommand(controller.getUniqueId(), "CancelAkteraObjectCommand",
"cancel", "cancel", "cancel", "des", true, true));
guiManager.addController(controllerTypeId, controller);
}
if (displayType == GUIControllerRequest.DATAOBJECT)
{
KeelResponse keelForm = getKeelObject(controllerTypeId, "0", userUniqueId);
Controller controller = createController(controllerTypeId);
ResponseElement groups = keelForm.get("groups");
for (Iterator i = groups.getAll().iterator(); i.hasNext();)
{
ResponseElement group = (ResponseElement) i.next();
WidgetDescription wdGroup = createWidget(controller.getUniqueId(), (String) ((Output) group)
.getContent(), "group", "group", false, true);
controller.addWidgetDescription(wdGroup);
for (Iterator j = group.getAll().iterator(); j.hasNext();)
{
Input field = (Input) j.next();
String fieldName = field.getName();
String fieldLabel = field.getLabel();
boolean duty = field.getAttribute("duty") == null ? false : true;
WidgetDescription fieldWidget = createWidget(controller.getUniqueId(), fieldLabel, fieldName,
(String) ((Input) field).getAttribute("editor"), duty, true);
wdGroup.addWidgetDescription(fieldWidget);
}
}
Command cmdSave = (Command) keelForm.get("save");
if (cmdSave != null)
{
controller.addCommandDescription(createCommand(controller.getUniqueId(), "SaveAkteraObjectCommand",
cmdSave.getModel(), "save", "save", "des", true, true));