private ActionStateModel parseActionState(Element element) { ActionStateModel state = new ActionStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); state.setActions(parseActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); return state; }
public void merge(Model model) { ActionStateModel state = (ActionStateModel) 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)); setActions(merge(getActions(), state.getActions(), false)); }
private void parseAndAddActionState(ActionStateModel state, Flow flow) { MutableAttributeMap<Object> attributes = parseMetaAttributes(state.getAttributes()); parseAndPutSecured(state.getSecured(), attributes); getLocalContext().getFlowArtifactFactory().createActionState(state.getId(), flow, parseActions(state.getOnEntryActions()), parseActions(state.getActions()), parseTransitions(state.getTransitions()), parseExceptionHandlers(state.getExceptionHandlers(), state.getTransitions()), parseActions(state.getOnExitActions()), attributes); }
public Model createCopy() { ActionStateModel copy = new ActionStateModel(getId()); super.fillCopy(copy); copy.setActions(copyList(actions)); return copy; }
public void testMerge() { ActionStateModel child = new ActionStateModel("child"); ActionStateModel parent = new ActionStateModel("parent"); LinkedList<AbstractActionModel> actions = new LinkedList<>(); EvaluateModel eval = new EvaluateModel("foo.bar"); actions.add(eval); parent.setActions(actions); parent.setSecured(new SecuredModel("secured")); child.merge(parent); assertNotNull(child.getSecured()); assertEquals("foo.bar", ((EvaluateModel) child.getActions().get(0)).getExpression()); }
private static void createDuoDoNonWebAuthenticationAction(final List<AbstractStateModel> states) { val actModel = new ActionStateModel(STATE_ID_DUO_NON_WEB_AUTHENTICATION); val actions = new LinkedList<AbstractActionModel>(); actions.add(new EvaluateModel(ACTION_DUO_NON_WEB_AUTHENTICATION_ACTION)); actModel.setActions(actions); val trans = new LinkedList<TransitionModel>(); val transModel = new TransitionModel(); transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS); transModel.setTo(STATE_ID_FINALIZE_AUTHENTICATION); trans.add(transModel); actModel.setTransitions(trans); states.add(actModel); }
public void testNotMergeable() { ActionStateModel child = new ActionStateModel("child"); ActionStateModel parent = new ActionStateModel("parent"); assertFalse(child.isMergeableWith(parent)); }
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()); }
private static void createDuoFinalizeAuthenticationAction(final List<AbstractStateModel> states) { val actModel = new ActionStateModel(STATE_ID_FINALIZE_AUTHENTICATION); val actions = new LinkedList<AbstractActionModel>(); actions.add(new EvaluateModel(ACTION_DUO_AUTHENTICATION_WEBFLOW)); actModel.setActions(actions); val trans = new LinkedList<TransitionModel>(); val transModel = new TransitionModel(); transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS); transModel.setTo(CasWebflowConstants.TRANSITION_ID_SUCCESS); trans.add(transModel); actModel.setTransitions(trans); states.add(actModel); }
public Model createCopy() { ActionStateModel copy = new ActionStateModel(getId()); super.fillCopy(copy); copy.setActions(copyList(actions)); return copy; }
public void testNotMergeableWithNull() { ActionStateModel child = new ActionStateModel("child"); assertFalse(child.isMergeableWith(null)); }
public void merge(Model model) { ActionStateModel state = (ActionStateModel) 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)); setActions(merge(getActions(), state.getActions(), false)); }
private ActionStateModel parseActionState(Element element) { ActionStateModel state = new ActionStateModel(element.getAttribute("id")); state.setParent(element.getAttribute("parent")); state.setAttributes(parseAttributes(element)); state.setSecured(parseSecured(element)); state.setOnEntryActions(parseOnEntryActions(element)); state.setTransitions(parseTransitions(element)); state.setOnExitActions(parseOnExitActions(element)); state.setActions(parseActions(element)); state.setExceptionHandlers(parseExceptionHandlers(element)); return state; }
private void parseAndAddActionState(ActionStateModel state, Flow flow) { MutableAttributeMap<Object> attributes = parseMetaAttributes(state.getAttributes()); parseAndPutSecured(state.getSecured(), attributes); getLocalContext().getFlowArtifactFactory().createActionState(state.getId(), flow, parseActions(state.getOnEntryActions()), parseActions(state.getActions()), parseTransitions(state.getTransitions()), parseExceptionHandlers(state.getExceptionHandlers(), state.getTransitions()), parseActions(state.getOnExitActions()), attributes); }
private static LinkedList<AbstractActionModel> createDuoInitializeLoginAction(final List<AbstractStateModel> states) { val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM); val actions = new LinkedList<AbstractActionModel>(); actions.add(new EvaluateModel("initializeLoginAction")); actModel.setActions(actions); val trans = new LinkedList<TransitionModel>(); val transModel = new TransitionModel(); transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS); transModel.setTo(STATE_ID_DETERMINE_DUO_USER_ACCOUNT); trans.add(transModel); actModel.setTransitions(trans); states.add(actModel); return actions; }
public void testMergeable() { ActionStateModel child = new ActionStateModel("child"); assertTrue(child.isMergeableWith(child)); }
public void merge(Model model) { ActionStateModel state = (ActionStateModel) 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)); setActions(merge(getActions(), state.getActions(), false)); }