Examples of ObjectAction


Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

                        final Object targetObject = bookmarkService.lookup(targetBookmark);
                       
                        final ObjectAdapter targetAdapter = adapterFor(targetObject);
                        final ObjectSpecification specification = targetAdapter.getSpecification();
              
                        final ObjectAction objectAction = findAction(specification, actionId);
                        if(objectAction == null) {
                            throw new Exception("Unknown action '" + actionId + "'");
                        }
                       
                        final ObjectAdapter[] argAdapters = argAdaptersFor(aim);
                        final ObjectAdapter resultAdapter = objectAction.execute(targetAdapter, argAdapters);
                        if(resultAdapter != null) {
                            Bookmark resultBookmark = CommandUtil.bookmarkFor(resultAdapter);
                            command.setResult(resultBookmark);
                        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

                event = newActionInteractionEvent(eventType, identifier, source, arguments);
            }

            if(identified instanceof ObjectAction) {
                // should always be the case...
                final ObjectAction objectAction = (ObjectAction) identified;
                event.setActionSemantics(objectAction.getSemantics());
            }

            event.setPhase(phase);
            getEventBusService().post(event);
            return event;
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

    // getInstance
    // /////////////////////////////////////////////////////////////

    @Override
    public Instance getInstance(final ObjectAdapter adapter) {
        final ObjectAction specification = this;
        return adapter.getInstance(specification);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

        return (isTransient() ? "UNSAVED " : "") + getSpecification().getSingularName();
    }

    @Override
    public Consent canDrop(final Content sourceContent) {
        final ObjectAction action = actionFor(sourceContent);
        if (action == null) {
            return Veto.DEFAULT;
        } else {
            final ObjectAdapter source = sourceContent.getAdapter();
            final Consent parameterSetValid = action.isProposedArgumentSetValid(adapter, new ObjectAdapter[] { source });
            parameterSetValid.setDescription("Execute '" + action.getName() + "' with " + source.titleString());
            return parameterSetValid;
        }
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

            return parameterSetValid;
        }
    }

    private ObjectAction actionFor(final Content sourceContent) {
        ObjectAction action;
        action = adapter.getSpecification().getObjectAction(ActionType.USER, null, Arrays.asList(sourceContent.getSpecification()));
        return action;
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

        return action;
    }

    @Override
    public ObjectAdapter drop(final Content sourceContent) {
        final ObjectAction action = actionFor(sourceContent);
        final ObjectAdapter source = sourceContent.getAdapter();
        return action.execute(adapter, new ObjectAdapter[] { source });
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

            final ActionModel actionModel = getActionModel();
           
            final ObjectAdapter[] pendingArguments = actionModel.getArgumentsAsArray();
           
            try {
                final ObjectAction action = actionModel.getActionMemento().getAction();
                final int numParams = action.getParameterCount();
                for (int i = 0; i < numParams; i++) {
                    final ScalarPanelAbstract paramPanel = paramPanels.get(i);
                    if(paramPanel != null) {
                        // this could throw a ConcurrencyException as we may have to reload the
                        // object adapter of the action in order to compute the choices
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

    // BookmarkableModel
    //////////////////////////////////////////////////

    public PageParameters getPageParameters() {
        final ObjectAdapter adapter = getTargetAdapter();
        final ObjectAction objectAction = getActionMemento().getAction();
        final PageParameters pageParameters = createPageParameters(
                adapter, objectAction, ConcurrencyChecking.NO_CHECK);

        // capture argument values
        final ObjectAdapter[] argumentsAsArray = getArgumentsAsArray();
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

    }

    @Override
    public String getTitle() {
        final ObjectAdapter adapter = getTargetAdapter();
        final ObjectAction objectAction = getActionMemento().getAction();
       
        final StringBuilder buf = new StringBuilder();
        final ObjectAdapter[] argumentsAsArray = getArgumentsAsArray();
        for(ObjectAdapter argumentAdapter: argumentsAsArray) {
            if(buf.length() > 0) {
                buf.append(",");
            }
            buf.append(abbreviated(titleOf(argumentAdapter), 8));
        }

        return adapter.titleString(null) + "." + objectAction.getName() + (buf.length()>0?"(" + buf.toString() + ")":"");
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.ObjectAction

    }

    private void setArgumentsIfPossible(final PageParameters pageParameters) {
        List<String> args = PageParameterNames.ACTION_ARGS.getListFrom(pageParameters);

        final ObjectAction action = actionMemento.getAction();
        final List<ObjectSpecification> parameterTypes = action.getParameterTypes();

        for (int paramNum = 0; paramNum < args.size(); paramNum++) {
            String encoded = args.get(paramNum);
            setArgument(paramNum, parameterTypes.get(paramNum), encoded);
        }
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.