Examples of Memento


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

        // 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

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

                @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

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

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

        return oid.hashCode();
    }

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

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SimpleOidGenerator.Memento

        mockMemento = context.mock(SimpleOidGenerator.Memento.class);
    }

    @Test
    public void noOidGeneratorInitially() throws Exception {
        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
        assertThat(oidGeneratorMemento, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SimpleOidGenerator.Memento

    }

    @Test
    public void oidGeneratorStoredOnceSaved() throws Exception {
        persistedObjects.saveOidGeneratorMemento(mockMemento);
        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
        assertThat(oidGeneratorMemento, is(mockMemento));
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SimpleOidGenerator.Memento

        mockMemento = context.mock(SimpleOidGenerator.Memento.class);
    }

    @Test
    public void noOidGeneratorInitially() throws Exception {
        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
        assertThat(oidGeneratorMemento, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SimpleOidGenerator.Memento

    }

    @Test
    public void oidGeneratorStoredOnceSaved() throws Exception {
        persistedObjects.saveOidGeneratorMemento(mockMemento);
        final Memento oidGeneratorMemento = persistedObjects.getOidGeneratorMemento();
        assertThat(oidGeneratorMemento, is(mockMemento));
    }
View Full Code Here

Examples of org.gdbms.engine.data.persistence.Memento

     *
     * @throws Throwable DOCUMENT ME!
     */
    public void testXMLMemento() throws Throwable {
        DataSource d = ds.executeSQL("select * from persona;");
        Memento m = d.getMemento();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Handler h = new Handler();
        PrintWriter pw = new PrintWriter(out);
        h.setOut(pw);
        m.setContentHandler(h);
        m.getXML();
        pw.close();

        XMLReader reader = XMLReaderFactory.createXMLReader(
                "org.apache.crimson.parser.XMLReaderImpl");
        MementoContentHandler mch = new MementoContentHandler();
View Full Code Here

Examples of org.gdbms.engine.data.persistence.Memento

     *
     * @throws Throwable DOCUMENT ME!
     */
    public void testXMLMementoOfQueryDataSource() throws Throwable {
        DataSource d = ds.getDataSource("hsqldbapellido");
        Memento m = d.getMemento();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Handler h = new Handler();
        PrintWriter pw = new PrintWriter(out);
        h.setOut(pw);
        m.setContentHandler(h);
        m.getXML();
        pw.close();

        XMLReader reader = XMLReaderFactory.createXMLReader(
                "org.apache.crimson.parser.XMLReaderImpl");
        MementoContentHandler mch = new MementoContentHandler();
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.