Package org.apache.isis.applib.services.command

Examples of org.apache.isis.applib.services.command.CommandContext


            }
        }
    }

    private void createCommandIfConfigured() {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext == null) {
            return;
        }
        final CommandService commandService = getServiceOrNull(CommandService.class);
        final Command command =
                commandService != null
                    ? commandService.create()
                    : new CommandDefault();
        commandContext.setCommand(command);

        if(command.getTimestamp() == null) {
            command.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
        }
        if(command.getUser() == null) {
View Full Code Here


    /**
     * Called by IsisTransactionManager on start
     */
    public void startTransactionOnCommandIfConfigured(final UUID transactionId) {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext == null) {
            return;
        }
        final CommandService commandService = getServiceOrNull(CommandService.class);
        if(commandService == null) {
            return;
        }
        final Command command = commandContext.getCommand();
        commandService.startTransaction(command, transactionId);
    }
View Full Code Here

            ebs.close();
        }
    }

    private void completeCommandIfConfigured() {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext != null) {
            final CommandService commandService = getServiceOrNull(CommandService.class);
            if(commandService != null) {
                final Command command = commandContext.getCommand();
                commandService.complete(command);
            }
        }
    }
View Full Code Here

            final ObjectAction owningAction,
            final ObjectAdapter targetAdapter,
            final ObjectAdapter[] arguments) {
     
        final Bulk.InteractionContext bulkInteractionContext = getServicesInjector().lookupService(Bulk.InteractionContext.class);
        final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
        final Command command = commandContext != null ? commandContext.getCommand() : null;

        try {
            final Object[] executionParameters = new Object[arguments.length];
            for (int i = 0; i < arguments.length; i++) {
                executionParameters[i] = unwrap(arguments[i]);
View Full Code Here

           
            bulkInteractionContext.setInvokedAs(InvokedAs.REGULAR);
            bulkInteractionContext.setDomainObjects(Collections.singletonList(contributee.getObject()));
        }

        final CommandContext commandContext = getServicesProvider().lookupService(CommandContext.class);
        final Command command = commandContext != null ? commandContext.getCommand() : null;

        if(command != null && command.getExecutor() == Executor.USER) {

            command.setTargetClass(CommandUtil.targetClassNameFor(contributee));
            command.setTargetAction(CommandUtil.targetActionNameFor(this));
View Full Code Here

            final ObjectAction owningAction,
            final ObjectAdapter targetAdapter,
            final ObjectAdapter[] arguments) {

        final Bulk.InteractionContext bulkInteractionContext = getServicesInjector().lookupService(Bulk.InteractionContext.class);
        final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
        final Command command = commandContext != null ? commandContext.getCommand() : null;

        try {
            final Object[] executionParameters = new Object[arguments.length];
            for (int i = 0; i < arguments.length; i++) {
                executionParameters[i] = unwrap(arguments[i]);
View Full Code Here

            }
        }
    }

    private void createCommandIfConfigured() {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext == null) {
            return;
        }
        final CommandService commandService = getServiceOrNull(CommandService.class);
        final Command command =
                commandService != null
                    ? commandService.create()
                    : new CommandDefault();
        commandContext.setCommand(command);

        if(command.getTimestamp() == null) {
            command.setTimestamp(Clock.getTimeAsJavaSqlTimestamp());
        }
        if(command.getUser() == null) {
View Full Code Here

    /**
     * Called by IsisTransactionManager on start
     */
    public void startTransactionOnCommandIfConfigured(final UUID transactionId) {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext == null) {
            return;
        }
        final CommandService commandService = getServiceOrNull(CommandService.class);
        if(commandService == null) {
            return;
        }
        final Command command = commandContext.getCommand();
        commandService.startTransaction(command, transactionId);
    }
View Full Code Here

            ebs.close();
        }
    }

    private void completeCommandIfConfigured() {
        final CommandContext commandContext = getServiceOrNull(CommandContext.class);
        if(commandContext != null) {
            final CommandService commandService = getServiceOrNull(CommandService.class);
            if(commandService != null) {
                final Command command = commandContext.getCommand();
                commandService.complete(command);
            }
        }
    }
View Full Code Here

            final ObjectAdapter targetAdapter,
            final ObjectAdapter[] arguments) {

        try {

            final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
            final Command command = commandContext != null ? commandContext.getCommand() : null;

            // pick up existing event (saved in thread local during the validation phase)
            final ActionInteractionEvent<?> existingEvent = actionInteractionFacet.currentInteraction.get();

            // ... post the executing event
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.services.command.CommandContext

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.