private ViewStateModel parseViewState(Element element) { ViewStateModel state = new ViewStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setView(element.getAttribute("view")); state.setRedirect(element.getAttribute("redirect")); state.setPopup(element.getAttribute("popup")); state.setModel(element.getAttribute("model")); state.setValidationHints(element.getAttribute("validation-hints")); state.setVars(parseVars(element)); state.setBinder(parseBinder(element)); state.setOnRenderActions(parseOnRenderActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }
public Model createCopy() { ViewStateModel copy = new ViewStateModel(getId()); super.fillCopy(copy); copy.setView(view); copy.setRedirect(redirect); copy.setPopup(popup); copy.setModel(model); copy.setValidationHints(validationHints); copy.setVars(copyList(vars)); copy.setBinder((BinderModel) copy(binder)); copy.setOnRenderActions(copyList(onRenderActions)); return copy; }
private static void createDuoRedirectToRegistrationAction(final List<AbstractStateModel> states) { val endModel = new ViewStateModel(VIEW_ID_REDIRECT_TO_DUO_REGISTRATION); endModel.setView("externalRedirect:#{flowScope.duoRegistrationUrl}"); states.add(endModel); }
private static void createDuoLoginViewState(final List<AbstractStateModel> states) { val viewState = new ViewStateModel(STATE_ID_VIEW_LOGIN_FORM_DUO); viewState.setView("casDuoLoginView"); viewState.setModel(CasWebflowConstants.VAR_ID_CREDENTIAL); val bm = new BinderModel(); val bindings = new LinkedList<BindingModel>(); val bme = new BindingModel("signedDuoResponse", null, null); bindings.add(bme); bm.setBindings(bindings); viewState.setBinder(bm); val actions = new LinkedList<AbstractActionModel>(); actions.add(new EvaluateModel(ACTION_PREPARE_DUO_WEB_LOGIN_FORM_ACTION)); viewState.setOnEntryActions(actions); val trans = new LinkedList<TransitionModel>(); val transModel = new TransitionModel(); transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUBMIT); transModel.setTo(CasWebflowConstants.STATE_ID_REAL_SUBMIT); transModel.setBind(Boolean.TRUE.toString()); transModel.setValidate(Boolean.FALSE.toString()); trans.add(transModel); viewState.setTransitions(trans); states.add(viewState); }
public void merge(Model model) { ViewStateModel state = (ViewStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setView(merge(getView(), state.getView())); setRedirect(merge(getRedirect(), state.getRedirect())); setPopup(merge(getPopup(), state.getPopup())); setModel(merge(getModel(), state.getModel())); setValidationHints(mergeValidationHints(getValidationHints(), state.getValidationHints())); setVars(merge(getVars(), state.getVars(), false)); setBinder((BinderModel) merge(getBinder(), state.getBinder())); setOnRenderActions(merge(getOnRenderActions(), state.getOnRenderActions(), false)); }
private ViewStateModel parseViewState(Element element) { ViewStateModel state = new ViewStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setView(element.getAttribute("view")); state.setRedirect(element.getAttribute("redirect")); state.setPopup(element.getAttribute("popup")); state.setModel(element.getAttribute("model")); state.setValidationHints(element.getAttribute("validation-hints")); state.setVars(parseVars(element)); state.setBinder(parseBinder(element)); state.setOnRenderActions(parseOnRenderActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }
private ViewStateModel parseViewState(Element element) { ViewStateModel state = new ViewStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setView(element.getAttribute("view")); state.setRedirect(element.getAttribute("redirect")); state.setPopup(element.getAttribute("popup")); state.setModel(element.getAttribute("model")); state.setVars(parseVars(element)); state.setBinder(parseBinder(element)); state.setOnRenderActions(parseOnRenderActions(element)); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); return state; }
public Model createCopy() { ViewStateModel copy = new ViewStateModel(getId()); super.fillCopy(copy); copy.setView(view); copy.setRedirect(redirect); copy.setPopup(popup); copy.setModel(model); copy.setValidationHints(validationHints); copy.setVars(copyList(vars)); copy.setBinder((BinderModel) copy(binder)); copy.setOnRenderActions(copyList(onRenderActions)); return copy; }
public void testViewStateFlowRedirect() { ViewStateModel state = new ViewStateModel("view"); state.setView("flowRedirect:myFlow?input=#{flowScope.foo}"); model.setStates(asList(state)); Flow flow = getFlow(model); ViewFactory vf = ((ViewState) flow.getStateInstance("view")).getViewFactory(); assertTrue(vf instanceof ActionExecutingViewFactory); ActionExecutingViewFactory avf = (ActionExecutingViewFactory) vf; assertTrue(avf.getAction() instanceof FlowDefinitionRedirectAction); }
public void testMergeStates() { FlowModel child = new FlowModel(); child.setStates(asList(new ViewStateModel("view"), new EndStateModel("end"))); FlowModel parent = new FlowModel(); ViewStateModel view = new ViewStateModel("view"); view.setView("jsp"); parent.setStates(asList(view, new DecisionStateModel("decider"), new ActionStateModel("action"))); child.merge(parent); assertEquals(4, child.getStates().size()); assertEquals("jsp", ((ViewStateModel) child.getStates().get(0)).getView()); }
public void testViewStateExternalRedirect() { ViewStateModel state = new ViewStateModel("view"); state.setView("externalRedirect:http://www.paypal.com?_callbackUrl=#{flowExecutionUri}"); model.setStates(asList(state)); Flow flow = getFlow(model); ViewFactory vf = ((ViewState) flow.getStateInstance("view")).getViewFactory(); assertTrue(vf instanceof ActionExecutingViewFactory); ActionExecutingViewFactory avf = (ActionExecutingViewFactory) vf; assertTrue(avf.getAction() instanceof ExternalRedirectAction); }
parent.setModel("fooModel"); parent.setValidationHints("foo"); parent.setView("fooView");
public void merge(Model model) { ViewStateModel state = (ViewStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setView(merge(getView(), state.getView())); setRedirect(merge(getRedirect(), state.getRedirect())); setPopup(merge(getPopup(), state.getPopup())); setModel(merge(getModel(), state.getModel())); setVars(merge(getVars(), state.getVars(), false)); setBinder((BinderModel) merge(getBinder(), state.getBinder())); setOnRenderActions(merge(getOnRenderActions(), state.getOnRenderActions(), false)); }
public void merge(Model model) { ViewStateModel state = (ViewStateModel) model; setParent(null); setAttributes(merge(getAttributes(), state.getAttributes())); setSecured((SecuredModel) merge(getSecured(), state.getSecured())); setOnEntryActions(merge(getOnEntryActions(), state.getOnEntryActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), state.getExceptionHandlers())); setTransitions(merge(getTransitions(), state.getTransitions())); setOnExitActions(merge(getOnExitActions(), state.getOnExitActions(), false)); setView(merge(getView(), state.getView())); setRedirect(merge(getRedirect(), state.getRedirect())); setPopup(merge(getPopup(), state.getPopup())); setModel(merge(getModel(), state.getModel())); setValidationHints(mergeValidationHints(getValidationHints(), state.getValidationHints())); setVars(merge(getVars(), state.getVars(), false)); setBinder((BinderModel) merge(getBinder(), state.getBinder())); setOnRenderActions(merge(getOnRenderActions(), state.getOnRenderActions(), false)); }