public Naked invoke() { return action.execute(target, parameters); }
public Naked execute( Naked[] parameterNakeds) { return getNakedObjectAction().execute(getNakedObject(), parameterNakeds); }
public void execute() { Naked result; result = action.execute(target, null); if (result != null) { if (result instanceof NakedCollection) { NakedCollection collection = ((NakedCollection) result); if (collection.size() == 1) { result = collection.firstElement(); } } view.objectActionResult(result, at); } view.getViewManager().disposeUnneededViews(); view.getFeedbackManager().showMessagesAndWarnings(); }
protected void setUp() throws Exception { BasicConfigurator.configure(); LogManager.getRootLogger().setLevel(Level.OFF); encoder = createMock(ObjectEncoder.class); server = new ServerDistribution(null); server.setEncoder(encoder); server.init(); reset(encoder); // server calls encoder, so we need to ignore this system = new TestProxySystem(); system.init(); adapter = system.createPersistentTestObject(); oid = adapter.getOid(); targetData = new DummyIdentityData(oid, TestProxyNakedObject.class.getName(), new TestProxyVersion(1)); parameterData = new ReferenceData[] {}; TestProxySpecification proxySpecification = (TestProxySpecification) adapter.getSpecification(); action = createMock(NakedObjectAction.class); proxySpecification.setupAction(action); action.getId(); expectLastCall().andStubReturn("action()"); action.execute(eq(adapter), aryEq(new Naked[0])); expectLastCall().andReturn(adapter); }
Naked result = action.execute(object, parameters);
public Naked drop(final Content sourceContent) { if (sourceContent instanceof ObjectContent) { NakedObject source = (NakedObject) sourceContent.getNaked(); Assert.assertNotNull(source); NakedObject target = (NakedObject) getObject(); Assert.assertNotNull(target); if (canDrop(sourceContent).isAllowed()) { NakedObjectAction action = dropAction(source, target); if ((action != null) && action.isParameterSetValid(target, new NakedObject[] { source }).isAllowed()) { return action.execute(target, new NakedObject[] { source }); } else { NakedObjectField[] fields = target.getSpecification().getDynamicallyVisibleFields(target); for (int i = 0; i < fields.length; i++) { NakedObjectField fld = fields[i]; if (fld.isObject() && source.getSpecification().isOfType(fld.getSpecification())) { if (fld.get(target) == null && ((OneToOneAssociation) fld).isAssociationValid(target, source).isAllowed()) { ((OneToOneAssociation) fld).setAssociation(target, source); break; } } } } } } return null; }