@Override protected CommandResult execute(CommandContext context, Object item) { return new GotoUrlResult(context.getScreenContext().createItemContext(item)); }
@Override @SuppressWarnings("unchecked") public CommandResult handleInput(CommandContext context, Selection selection, Object input, String button) { Map<String, String> model = (Map<String, String>) input; ScreenContext itemContext = context.getScreenContext() .createNewItemContext(getParent(context, selection).getObject()); StringBuffer url = new StringBuffer(); url.append(itemContext.getLink().getUrl()); ServletUtils.appendParameter(url, "formId", model.get("type")); return new GotoUrlResult(itemContext.getRequest(), url.toString()); }
@Override protected CommandResult execute(CommandContext context, Object item) { if (context.getScreen().getItemScreen() instanceof ListScreen) { return new GotoUrlResult(context.getScreenContext() .createItemContext(item)); } else { RiotScreen screen = findChildScreen(context); return new GotoUrlResult(context.getScreenContext() .createItemContext(item).createChildContext(screen)); } }
@Override protected CommandResult execute(CommandContext context, Page page) { ScreenContext targetContext = null; if (page instanceof ContentPage) { targetContext = context.getScreenContext().createItemContext(page); } else if (page instanceof VirtualPage) { VirtualPage virualPage = (VirtualPage) page; Object object = virualPage.getObject(); String formId = formRepository.findFormId(object.getClass()); if (formId != null) { FormScreen formScreen = screenRepository.findFormScreen(formId); ScreenContext screenContext = new DefaultScreenContext(formScreen, object, context.getParent(), false, context.getScreenContext()); targetContext = screenContext.createItemContext(object); } } return new GotoUrlResult(targetContext); }
@Override public CommandResult execute(CommandContext context, Selection selection) { SelectionItem parent = getParent(context, selection); ScreenContext itemContext = context.getScreenContext() .createNewItemContext(parent.getObject()); if (itemContext.getScreen() instanceof FormScreen) { FormScreen formScreen = (FormScreen) itemContext.getScreen(); if (formScreen.isFormChooser()) { return super.execute(context, selection); } } return new GotoUrlResult(itemContext); }
public CommandResult execute(CommandContext context, Selection selection) { ScreenContext nextContext = new DefaultScreenContext(nextList, null, selection.getSingleItem().getObject(), false, screenContext); ChooserSettings settings = new ChooserSettings(chooserTarget.getId(), null, state.getChooserSettings().getTargetClass()); ScreenLink link = settings.appendTo(nextContext.getLink()); return new GotoUrlResult(context.getRequest(), link.getUrl()); } }