Package org.apache.isis.viewer.wicket.model.models

Examples of org.apache.isis.viewer.wicket.model.models.ActionModel


     * @return whether to clear args or not (they aren't if there was a validation exception)
     */
    private boolean executeActionOnTargetAndProcessResults(ObjectAdapter targetAdapter, MarkupContainer feedbackForm) {

        // validate the action parameters (if any)
        final ActionModel actionModel = getActionModel();
        final String invalidReasonIfAny = actionModel.getReasonInvalidIfAny();
        if (invalidReasonIfAny != null) {
            feedbackForm.error(invalidReasonIfAny);
            return false;
        }
        // the object store could raise an exception (eg uniqueness constraint)
        // so we handle it here.
        try {
            // could be programmatic flushing, so must include in the try... finally
            final ObjectAdapter resultAdapter = executeActionHandlingApplicationExceptions();
     
            // flush any queued changes, so concurrency or violation exceptions (if any)
            // will be thrown here
            getTransactionManager().flushTransaction();
           
            final ResultType resultType = ResultType.determineFor(resultAdapter);
            resultType.addResults(this, resultAdapter);

            if (actionModel.isBookmarkable()) {
                bookmarkPage(actionModel);
            }

            //return true;
            // change in policy: never clear args (need them, even after successful execution, for bulk actions).
View Full Code Here


     *
     * <p>
     * Any other types of exception will be ignored (to be picked up higher up in the callstack)
     */
    private ObjectAdapter executeActionHandlingApplicationExceptions() {
        final ActionModel actionModel = getActionModel();
        try {
            ObjectAdapter resultAdapter = actionModel.getObject();
            return resultAdapter;

        } catch (RuntimeException ex) {
           
            // see if is an application-defined exception
View Full Code Here

                    } finally {
                        Bulk.InteractionContext.current.set(null);
                    }
                   
                    model.clearToggleMementosList();
                    final ActionModel actionModelHint = model.getActionModelHint();
                    if(actionModelHint != null) {
                        ObjectAdapter resultAdapter = actionModelHint.getObject();
                        model.setObjectList(resultAdapter);
                    } else {
                        model.setObject(persistentAdaptersWithin(model.getObject()));
                    }
View Full Code Here

            @Override
            public void onClick() {
                // TODO: seems like can't use REDIRECT, since won't
                // let multiple setResponsePage() calls once
                // committed to redirecting (I'm guessing)
                final ActionModel actionModel = ActionModel.create(adapterMemento, actionMemento, actionMode, SingleResultsMode.INLINE);
                setResponsePage(new ActionPage(actionModel));
            }
        };
    }
View Full Code Here

        return ApplicationAdvice.APPLIES;
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final ActionModel actionModel = (ActionModel) model;
        return new EmptyCollectionPanel(id, actionModel);
    }
View Full Code Here

    @Override
    protected ApplicationAdvice appliesTo(IModel<?> model) {
        if(!(model instanceof ActionModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final ActionModel actionModel = (ActionModel) model;
        final ActionSemantics.Of semantics = actionModel.getActionMemento().getAction().getSemantics();
        return ApplicationAdvice.appliesIf(semantics == ActionSemantics.Of.SAFE);
    }
View Full Code Here

        return ApplicationAdvice.appliesIf(semantics == ActionSemantics.Of.SAFE);
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final ActionModel actionModel = (ActionModel) model;
        return new ActionLinkPanel(id, actionModel);
    }
View Full Code Here

        addBookmarkedPages();
    }

    public ActionPage(final PageParameters pageParameters) {
        super(pageParameters, ApplicationActions.INCLUDE, ComponentType.ACTION);
        final ActionModel model = buildModel();
        addChildComponents(model);
       
        // no need to bookmark because the ActionPanel will have done so for us
        addBookmarkedPages();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.wicket.model.models.ActionModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.