Package org.apache.isis.runtimes.dflt.runtime.memento

Examples of org.apache.isis.runtimes.dflt.runtime.memento.Memento


    public TransientObjectMapping(final ObjectAdapter adapter) {
        oid = adapter.getOid();
        Assert.assertTrue("OID is for persistent", oid.isTransient());
        Assert.assertTrue("adapter is for persistent", adapter.isTransient());
        memento = new Memento(adapter);
    }
View Full Code Here


        return oid.hashCode();
    }

    @Override
    public void update() {
        memento = new Memento(getObject());
    }
View Full Code Here

                @Override
                public void onSubmit() {
                    if (!getForm().hasError()) {
                        final ObjectAdapter object = getEntityModel().getObject();
                        final Memento snapshotToRollbackToIfInvalid = new Memento(object);
                        // to perform object-level validation, we must apply the
                        // changes first
                        // contrast this with ActionPanel (for validating action
                        // arguments) where
                        // we do the validation prior to the execution of the
                        // action
                        getEntityModel().apply();
                        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
                        if (invalidReasonIfAny != null) {
                            getForm().error(invalidReasonIfAny);
                            snapshotToRollbackToIfInvalid.recreateObject();
                            return;
                        } else {
                            toViewMode(null);
                        }
                    } else {
View Full Code Here

            encodableValue = encodableFacet.toEncodedString(adapter);
            type = Type.ENCODEABLE;
        } else {
            final Oid oid = adapter.getOid();
            if (oid.isTransient()) {
                transientMemento = new Memento(adapter);
                type = Type.TRANSIENT;
            } else {
                persistentOid = oid;
                type = Type.PERSISTENT;
            }
View Full Code Here

    public TransientObjectMapping(final ObjectAdapter adapter) {
        oid = adapter.getOid();
        Assert.assertTrue("OID is for persistent", oid.isTransient());
        Assert.assertTrue("adapter is for persistent", adapter.isTransient());
        memento = new Memento(adapter);
    }
View Full Code Here

        // to perform object-level validation, we must apply the changes first
        // Contrast this with ActionPanel (for validating action arguments)
        // where
        // we do the validation prior to the execution of the action.
        final ObjectAdapter object = getEntityModel().getObject();
        final Memento snapshotToRollbackToIfInvalid = new Memento(object);

        getEntityModel().apply();
        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
        if (invalidReasonIfAny != null) {
            form.error(invalidReasonIfAny);
            snapshotToRollbackToIfInvalid.recreateObject();
            return false;
        }

        // ok
        return true;
View Full Code Here

            encodableValue = encodableFacet.toEncodedString(adapter);
            type = Type.ENCODEABLE;
        } else {
            final Oid oid = adapter.getOid();
            if (oid.isTransient()) {
                transientMemento = new Memento(adapter);
                type = Type.TRANSIENT;
            } else {
                persistentOid = oid;
                type = Type.PERSISTENT;
            }
View Full Code Here

        // to perform object-level validation, we must apply the changes first
        // Contrast this with ActionPanel (for validating action arguments)
        // where
        // we do the validation prior to the execution of the action.
        final ObjectAdapter object = getEntityModel().getObject();
        final Memento snapshotToRollbackToIfInvalid = new Memento(object);

        getEntityModel().apply();
        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
        if (invalidReasonIfAny != null) {
            form.error(invalidReasonIfAny);
            snapshotToRollbackToIfInvalid.recreateObject();
            return false;
        }

        // ok
        return true;
View Full Code Here

                @Override
                public void onSubmit() {
                    if (!getForm().hasError()) {
                        final ObjectAdapter object = getEntityModel().getObject();
                        final Memento snapshotToRollbackToIfInvalid = new Memento(object);
                        // to perform object-level validation, we must apply the changes first
                        // contrast this with ActionPanel (for validating action arguments) where
                        // we do the validation prior to the execution of the action
                        getEntityModel().apply();
                        final String invalidReasonIfAny = getEntityModel().getReasonInvalidIfAny();
                        if (invalidReasonIfAny != null) {
                            getForm().error(invalidReasonIfAny);
                            snapshotToRollbackToIfInvalid.recreateObject();
                            return;
                        } else {
                            toViewMode(null);
                        }
                    } else {
View Full Code Here

    public TransientObjectMapping(final ObjectAdapter adapter) {
        oid = adapter.getOid();
        Assert.assertTrue("OID is for persistent", oid.isTransient());
        Assert.assertTrue("adapter is for persistent", adapter.isTransient());
        memento = new Memento(adapter);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.memento.Memento

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.