Examples of ActionModel


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

        addBookmarkedPages();
       
    }

    private static String actionNameFrom(final ValueModel valueModel) {
        ActionModel actionModel = valueModel.getActionModelHint();
        if(actionModel != null) {
            return actionModel.getActionMemento().getAction().getName();
        }
        return "Results"; // fallback, probably not required because hint should always exist on the model.
    }
View Full Code Here

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

        return appliesIf(model instanceof ActionModel);
    }

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

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

    private boolean executeActionOnTargetAndProcessResults(
            final ObjectAdapter targetAdapter,
            final AjaxRequestTarget target,
            final Form<?> feedbackForm) {
       
        final ActionModel actionModel = getActionModel();
       
        // validate the action parameters (if any)
        final String invalidReasonIfAny = actionModel.getReasonInvalidIfAny();
       
        if (invalidReasonIfAny != null) {
            raiseWarning(target, feedbackForm, invalidReasonIfAny);
            return false;
        }
       
        final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
        final Command command;
        if (commandContext != null) {
            command = commandContext.getCommand();
            command.setExecutor(Executor.USER);
        } else {
            command = null;
        }
       
       
        // 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();
           
            ActionResultResponse resultResponse = ActionResultResponseType.determineAndInterpretResult(this.getActionModel(), target, resultAdapter);
            resultResponse.getHandlingStrategy().handleResults(this, resultResponse);

            if (actionModel.isBookmarkable()) {
                bookmarkPage(actionModel);
            }
           
            if(actionPrompt != null) {
                actionPrompt.close(target);
                // cos will be reused next time, so mustn't cache em.
                actionModel.clearArguments();
            }

            return true;

        } catch (RuntimeException ex) {
View Full Code Here

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

     *
     * <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) {

            // TODO: some duplication between this code and ActionLinkFactoryAbstract
View Full Code Here

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

        return appliesIf(model instanceof ActionModel);
    }

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

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

    @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

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

        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

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

        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

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

        buildGui(entityCollectionModel);
    }

    private void buildGui(final EntityCollectionModel entityCollectionModel) {
       
        ActionModel actionModel = entityCollectionModel.getActionModelHint();
        ObjectAction action = actionModel.getActionMemento().getAction();
        addOrReplace(new Label(StandaloneCollectionPanel.ID_ACTION_NAME, Model.of(action.getName())));
       
        final ComponentFactoryRegistry componentFactoryRegistry = getComponentFactoryRegistry();
        componentFactoryRegistry.addOrReplaceComponent(this, ComponentType.COLLECTION_CONTENTS, entityCollectionModel);
    }
View Full Code Here

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

    @Override
    protected ApplicationAdvice appliesTo(final IModel<?> model) {
        if (!(model instanceof ActionModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final ActionModel actionModel = (ActionModel) model;

        final NoResultsHandler hasNoResultsHandler = actionModel.getNoResultsHandler();
        // fail fast if a NoResultsHandler has not been specified
        return appliesIf(hasNoResultsHandler != null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.